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
Test runner should try to increase stack size if it is too low #71464
Comments
Fresh clone and running test_exceptions testcase caught a Seg fault. [/loc/rom/pyd/cpython] $ ./python
[/loc/rom/pyd/cpython] $ ./python ../coveragepy/ run --pylib Lib/test/regrtest.py test_exceptions Current thread 0x00007fc7324d1700 (most recent call first): |
Debugged with gdb and found the following (gdb) run ../coveragepy/ run --pylib Lib/test/regrtest.py test_exceptions Program received signal SIGSEGV, Segmentation fault. |
This test asserts that indefinite recursion causes a RecursionError, but such recursion can instead segfault if the amount of stack space available is less than Python's recursion limit (sys.getrecursionlimit()). Are you using any unusual settings for the recursion limit? Perhaps the solution here is to have CPython use a lower default recursion limit on your platform. |
It's set to 1000, I didnt change during install, so it's likely set to the default value. >>> import sys
>>> sys.getrecursionlimit()
1000 I also have a lot of memory free (87G) to run scripts (should be able to handle without running into issues) [/loc/rom/pyd/cpython] $ free -m |
Can you please try without coveragepy?
|
Leads to the same Segfault [/loc/rom/pyd/cpython] $ ./python -m test test_exceptions Current thread 0x00007fb466572700 (most recent call first): |
This is an issue with the stack size. It was encountered recently while building Python 3.6 under CentOS 6 [0] and the way to fix it was to increase the maximum stack size using ulimit e.g. [1] [0] https://bugzilla.redhat.com/show_bug.cgi?id=1572150 |
In a perfect world, unit tests should not depend on the environment. So Python may *try* to increase the maximum stack size when running these tests. (If the limit cannot be increased, it's fine.) |
I just pushed a change to reduce the stack memory usage when deleting a chain of exceptions in bpo-44348. I consider that this issue is a duplicate. If it's not the case, please reopen the issue. commit fb30509 (upstream/main, main)
|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: