Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

PyCharm pydevd debug crash #240

Closed
egmkang opened this issue Apr 19, 2021 · 8 comments
Closed

PyCharm pydevd debug crash #240

egmkang opened this issue Apr 19, 2021 · 8 comments

Comments

@egmkang
Copy link

egmkang commented Apr 19, 2021

i'm using Python 3.7.5 x86-64: stackless-3.7.5-amd64.exe (26857280 Byte) (md5 f85ecddb2f4d83990ad764bd7c5c8aa8) .

using PyCharm to debug a hello world program, the python process wil crash, and error code is 0xC0000005.

here is log:

D:\Stackless37\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2021.1\plugins\python-ce\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 50654 --file D:/tttt/hello.py
Connected to pydev debugger (build 211.6693.115)

Process finished with exit code -1073741819 (0xC0000005)

@akruis
Copy link

akruis commented Apr 20, 2021

Hello egmkang,

thank you for the report. The exit code 0xC0000005 indicates an access violation. Could you please provide the source code of D:/tttt/hello.py. Does the crash also happen without the debugger attached?

Regards
Anselm

@egmkang
Copy link
Author

egmkang commented Apr 21, 2021

just one lineprint("hello world"), and use PyCharm to debug this file, it will crash. run this file is ok

@akruis
Copy link

akruis commented Apr 22, 2021

I can reproduce the crash.

@akruis
Copy link

akruis commented Apr 23, 2021

PyCharm - more precisely the debugger component pydevd - optionally uses the frame evaluation API "eval_frame" defined in PEP 523. Stackless can't support this API, because it evaluates frames quite differently than regular C-Python.

Fortunately there is a simple workaround: set the environment variable PYDEVD_USE_FRAME_EVAL=NO:

set PYDEVD_USE_FRAME_EVAL=NO
"\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\bin\pycharm64.exe"

A patch for pydevd to disable frame eval for Stackless would be good too.

@akruis
Copy link

akruis commented Apr 23, 2021

pull request for pydevd created

@akruis akruis closed this as completed Apr 23, 2021
@gemerden
Copy link

I have this issue (i think) but setting PYDEVD_USE_FRAME_EVAL=NO did not work for me. I have created an issue: https://youtrack.jetbrains.com/issue/PY-48739

@akruis
Copy link

akruis commented May 10, 2021

I have this issue (i think) but setting PYDEVD_USE_FRAME_EVAL=NO did not work for me. I have created an issue: https://youtrack.jetbrains.com/issue/PY-48739

First, double check, that Python actually sees the environment setting. Run:

import os
print(os.environ.get('PYDEVD_USE_FRAME_EVAL'))

You may also try the set the environment variable PYDEVD_USE_CYTHON=NO. Previous versions of cython were not compatible with Stackless Python (see #168) and Pycharm uses cython.

@gemerden
Copy link

Perfect, thanks, that solved my problem!

In the 'set environment variables' part of the run/debug dialog in PyCharm, i was separating the variables with "; " (space) instead of ";" (no space). This set the wrong (or no) variable. Umpfff.

Will also report to PyCharm issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants