14

Short Description

I'm using PyCharm and am writing a pytest unit test. I can run the test normally but if I try to debug it the debugger crashes.

Windows fatal exception: access violation

Stack Trace:

Thread 0x00003588 (most recent call first): File "C:\Users\MyUserName\AppData\Local\Programs\Python\Python310\lib\threading.py", line 324 in wait File "C:\Users\MyUserName\AppData\Local\Programs\Python\Python310\lib\threading.py", line 600 in wait File "C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev\pydevd.py", line 150 in _on_run File "C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev_pydevd_bundle\pydevd_comm.py", line 218 in run File "C:\Users\MyUserName\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009 in _bootstrap_inner File "C:\Users\MyUserName\AppData\Local\Programs\Python\Python310\lib\threading.py", line 966 in _bootstrap

Thread 0x000023f0 (most recent call first): File "C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev_pydevd_bundle\pydevd_comm.py", line 292 in _on_run File "C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev_pydevd_bundle\pydevd_comm.py", line 218 in run File "C:\Users\MyUserName\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009 in _bootstrap_inner File "C:\Users\MyUserName\AppData\Local\Programs\Python\Python310\lib\threading.py", line 966 in _bootstrap ... File "C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18 in execfile File "C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev\pydevd.py", line 1483 in _exec File "C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev\pydevd.py", line 1476 in run File "C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev\pydevd.py", line 2164 in main File "C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev\pydevd.py", line 2173 in

Process finished with exit code -1073741819 (0xC0000005)

koks der drache
  • 1,398
  • 1
  • 16
  • 33

4 Answers4

16

Disabling all breakpoints fixed it for me: enter image description here

Then I was able to set new ones.

koks der drache
  • 1,398
  • 1
  • 16
  • 33
  • other than suggested in the PyCharm BugTracker neither updating the IDE nor restarting nor uninstallting various package versions fixed it for me. – koks der drache Apr 27 '22 at 15:26
  • You might want to delete all those breakpoints – Code-Apprentice Apr 27 '22 at 15:27
  • I might. But they are there for a reason ;) – koks der drache Apr 27 '22 at 15:32
  • 1
    This has happened to me, PyCharm doesn't automatically delete breakpoints because they may contain complex information [one example](https://stackoverflow.com/questions/66954715), and [another example](https://stackoverflow.com/questions/66838346) the user may want to preserve as backup even if the module/project is long gone. It's strange that on occasion the IDE's debugger can still have some dependency on the outdated breakpoints (maybe to populate the GUI history) but yes it does happen and makes for an unexpected crash. – bad_coder Apr 27 '22 at 15:35
  • 2
    I still see this with Build #PY-221.5787.24, built on May 31, 2022 (Professional) with no solution yet. I confirm reinstalling Python and IDE did not help. – thoku Jun 03 '22 at 07:55
  • 1
    My observation is, that the error initially occurs if breakpoints are are set near/inside a codepath that may be "optimized" away, like close to an exception that is being raised, a continue or break statement. However the error does not go away if you remove only this single breakpoint. I do not have a MWE for that. – koks der drache Jun 20 '22 at 08:48
  • I'm experiencing a similar issue with another error message. A type error , that only occurs in debugging a unittest but not when running it: "TypeError: unhashable type: 'cell'" can also be fixed by disabling all breakpoints. – koks der drache Oct 10 '22 at 09:05
1

For me moving from python 3.10 to 3.9 solved the issue.

Hagai Drory
  • 141
  • 1
  • 5
1

Removing the breakpoints did not solve this for me. Moving from Python 3.10 to Python 3.11 did.

SigmaGamma
  • 19
  • 5
0

i had exactly the same issue, what works for me right now , is to disable "attach to subprocess automatically" in the pycharm debugger settings.

no idea why it works exactly...