Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging not possible due to Fatal Python error: Cannot recover from stack overflow. #1318

Closed
RobDBob opened this issue Apr 7, 2020 · 4 comments

Comments

@RobDBob
Copy link

RobDBob commented Apr 7, 2020

Describe the bug

Any attempt to use debugger on working code results in Fatal Python error.
Note: code in non-debug mode works fine, test execute as expected. UI is spawn on localhost address and it is usable.

Expected behavior

No error and able to debug.

Actual behavior

Connected to pydev debugger (build 191.7479.30)
Fatal Python error: Cannot recover from stack overflow.

Thread 0x00005a30 (most recent call first):
File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\pydevd.py", line 114 in _on_run
File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev_pydevd_bundle\pydevd_comm.py", line 321 in run
File "C:\Python37\lib\threading.py", line 917 in _bootstrap_inner
File "C:\Python37\lib\threading.py", line 885 in _bootstrap

Thread 0x00005994 (most recent call first):
File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev_pydevd_bundle\pydevd_comm.py", line 383 in _on_run
File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev_pydevd_bundle\pydevd_comm.py", line 321 in run
File "C:\Python37\lib\threading.py", line 917 in _bootstrap_inner
File "C:\Python37\lib\threading.py", line 885 in _bootstrap

Current thread 0x00005630 (most recent call first):
File "C:\Python37\lib\threading.py", line 1222 in current_thread
File "C:\Python37\lib\threading.py", line 1222 in current_thread
File "C:\Python37\lib\threading.py", line 1222 in current_thread
File "C:\Python37\lib\threading.py", line 1222 in current_thread
(...)
Thread 0x00005b04 (most recent call first):
File "", line 98 in acquire
File "", line 202 in _lock_unlock_module
File "C:\Repos\qa-functional-automation-entitlement-services\venv\lib\site-packages\locust\core.py", line 17 in
File "", line 219 in _call_with_frames_removed
File "", line 728 in exec_module
File "", line 677 in _load_unlocked
File "", line 967 in _find_and_load_unlocked
File "", line 983 in find_and_load
File "C:\Repos\qa-functional-automation-entitlement-services\venv\lib\site-packages\locust_init
.py", line 1 in
File "", line 219 in _call_with_frames_removed
File "", line 728 in exec_module
File "", line 677 in _load_unlocked
File "", line 967 in _find_and_load_unlocked
File "", line 983 in _find_and_load
File "C:/Repos/qa-functional-automation-entitlement-services/test_some.py", line 4 in
File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev_pydev_imps_pydev_execfile.py", line 18 in execfile
File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\pydevd.py", line 1147 in run
File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\pydevd.py", line 1752 in main
File "C:\Program Files\JetBrains\PyCharm 2019.1.3\helpers\pydev\pydevd.py", line 1758 in

Process finished with exit code -1073740791 (0xC0000409)

Steps to reproduce

Followed steps from accepted solution with remote debugging (see #613)

Environment

PyCharm 2019.1.3 (Professional Edition)
Build #PY-191.7479.30, built on May 29, 2019
You have a perpetual fallback license for this version
Subscription is active until January 1, 2021
JRE: 11.0.2+9-b159.60 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

  • OS: Windows 10, JetBrains Intellij PyCharm
  • Python version: 3.7
  • Locust version: 0.14.5
  • Locust command line that you ran:
  • Locust file contents (anonymized if necessary):
@RobDBob RobDBob added the bug label Apr 7, 2020
@heyman
Copy link
Member

heyman commented Apr 7, 2020

I think this is an issue with the debugger and out of the control of Locust.

Are you able to debug other python code where Gevent's monkey patching has been applied?

@cyberw
Copy link
Collaborator

cyberw commented Apr 7, 2020

I've never used PyCharm to debug locust, but you may find the the VS Code solution in locust-plugins helpful: https://github.com/SvenskaSpel/locust-plugins/blob/master/examples/debug.py

For VS you explicitly need to tell the debugger you're using gevent and I only ever got it to work for running a single standalone Locust class, not the full locust runner.

Also note that the latest git version of locust-plugins is only compatible with locust 1.0, which is only available from git (the pypi releases differs a little from master)

@RobDBob
Copy link
Author

RobDBob commented Apr 10, 2020

Haven't use gevents before at all.
Have google it with pycharm and there is an existing option to switch on support.
See https://blog.jetbrains.com/pycharm/2012/08/gevent-debug-support/

Thank you for your support guys!

@RobDBob RobDBob closed this as completed Apr 10, 2020
@cyberw
Copy link
Collaborator

cyberw commented Apr 11, 2020

Cool! @RobDBob , did it work out of the box once you enabled that setting or did you also have to use my approach of running a single Locust class?

@cyberw cyberw added the invalid label Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants