| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…KEYWORDS protocol.
|
Seems that this PR has caused some segfaults in the buildbots: https://buildbot.python.org/all/#/builders/441/builds/1345/steps/5/logs/stdio Is still not clear that is exactly this one, but this is a possible candidate. |
Sorry, something went wrong.
|
YEah, I can reproduce the segfault locally and doesn't happen if I revert this PR: $ ./python -m test -u all -W --slowest --fail-env-changed test_lib2to3 -F -v File "/home/pablogsal/github/cpython/Lib/lib2to3/pytree.py", line 786 in _recursive_matches File "/home/pablogsal/github/cpython/Lib/lib2to3/pytree.py", line 786 in _recursive_matches File "/home/pablogsal/github/cpython/Lib/lib2to3/pytree.py", line 786 in _recursive_matches ... Extension modules: _testcapi (total: 1) [1] 26282 segmentation fault ./python -m test -u all -W --slowest --fail-env-changed test_lib2to3 -F -v This is the stack trace: Program received signal SIGSEGV, Segmentation fault. 0x00000000006a2c74 in _PyEval_EvalFrameDefault (tstate=0xaee548 <_PyRuntime+130792>, frame=0x7ffff5cee4a0, throwflag=0) at Python/ceval.c:1653 1653 _Py_EnsureTstateNotNULL(tstate); (gdb) (gdb) bt #0 0x00000000006a2c74 in _PyEval_EvalFrameDefault (tstate=0xaee548 <_PyRuntime+130792>, frame=0x7ffff5cee4a0, throwflag=0) at Python/ceval.c:1653 #1 0x000000000051eae9 in _PyEval_EvalFrame (tstate=0xaee548 <_PyRuntime+130792>, frame=0x7ffff5cee4a0, throwflag=0) at ./Include/internal/pycore_ceval.h:53 #2 0x000000000051e6c1 in gen_send_ex2 (gen=0x7ffff5cee450, arg=0x0, presult=0x7fffff7ff360, exc=0, closing=0) at Objects/genobject.c:219 #3 0x000000000051c385 in gen_iternext (gen=0x7ffff5cee450) at Objects/genobject.c:585 #4 0x00000000006b76cf in _PyEval_EvalFrameDefault (tstate=0xaee548 <_PyRuntime+130792>, frame=0x7ffff5da68a0, throwflag=0) at Python/ceval.c:4214 #5 0x000000000051eae9 in _PyEval_EvalFrame (tstate=0xaee548 <_PyRuntime+130792>, frame=0x7ffff5da68a0, throwflag=0) at ./Include/internal/pycore_ceval.h:53 #6 0x000000000051e6c1 in gen_send_ex2 (gen=0x7ffff5da6850, arg=0x0, presult=0x7fffff8015f0, exc=0, closing=0) at Objects/genobject.c:219 #7 0x000000000051c385 in gen_iternext (gen=0x7ffff5da6850) at Objects/genobject.c:585 #8 0x00000000006b76cf in _PyEval_EvalFrameDefault (tstate=0xaee548 <_PyRuntime+130792>, frame=0x7ffff5da6120, throwflag=0) at Python/ceval.c:4214 #9 0x000000000051eae9 in _PyEval_EvalFrame (tstate=0xaee548 <_PyRuntime+130792>, frame=0x7ffff5da6120, throwflag=0) at ./Include/internal/pycore_ceval.h:53 #10 0x000000000051e6c1 in gen_send_ex2 (gen=0x7ffff5da60d0, arg=0x0, presult=0x7fffff803880, exc=0, closing=0) at Objects/genobject.c:219 #11 0x000000000051c385 in gen_iternext (gen=0x7ffff5da60d0) at Objects/genobject.c:585 |
Sorry, something went wrong.
|
I can't reproduce the failure on Ubuntu linux with gcc. Which configure options and platform? |
Sorry, something went wrong.
|
I am using clang, configure with ---with-pydebug and I am running ./python -m test -u all -W --slowest --fail-env-changed test_lib2to3 -F -v |
Sorry, something went wrong.
|
I am probably going to revert this unless we have a fix soon as there are 35 buildbots failing Ugh, seems that this issue is piling up with more issues, we have almost all buildbots failing :(+- |
Sorry, something went wrong.
|
I am blocking the main branch until all these issues are resolved. Please ping me if you have a fix for this |
Sorry, something went wrong.
|
I can reproduce with clang, but it is mystifying. |
Sorry, something went wrong.
|
It's a C stack overflow. >>> import _testcapi
>>> def f():
... yield _testcapi.stack_pointer()
...
>>> _testcapi.stack_pointer() - next(f())Spot the odd one out:
I'd like to raise an exception, rather than segfaulting, but the SC rejected PEP 651. |
Sorry, something went wrong.
I'm not taking in the name of the SC here (and this is not the place to discuss this) but I'm sure we can agree this is an extreme and unhelpful oversimplification of the SC resolution. Unfortunately seems that this commit creates the stack overflow while it didn't happen before. Even if we raise an exception, that was not happening before so technically will be also a regression. Unless we have a fix for this, we probably need to revert the commit. Do you know why clang stack overflows but GCC doesn't? |
Sorry, something went wrong.
As explained above, Clang uses ridiculous amounts of stack space using --with-pydebug
|
Sorry, something went wrong.
|
Maybe relegate the clang with debug buildbot(s) to unstable? |
Sorry, something went wrong.
Absolutely not. They were passing before, and this breaks the buildbots. The solution is not deactivating previous passing checks. Notice that any system running the tests under clang will fail (which by default is MacOS systems) so this is clearly not acceptable.
Yeah, I get that, but why? |
Sorry, something went wrong.
|
Why? In release mode, it's fine as the stack consumption is ~600 bytes. We could reduce the default recursion depth to ~800 in debug mode. That seems the best solution, short term. Longer term there are two things I want to do:
|
Sorry, something went wrong.
That doesn't answer the question I think. The question is why GCC is not going over the limit and clang does. What is this extra stack space? What is this being used for?
That is subjective. I kind of agree with you, but I don't think this is something it can be decided here in this PR. Technically this makes functions that didn't raise/segfault now change their behaviour in debug mode and that's a backwards incompatible change so at least needs to be discussed in python-dev |
Sorry, something went wrong.
You'll need to ask the Clang/llvm developers. |
Sorry, something went wrong.
|
Why wouldn't just increasing the stack size for Clang debug builds be a solution? It was deemed an OK resolution when a similar overflow was occurring on Windows in bpo-17206. Also, the cause of increased stack usage for Clang may be for related reasons as in afore mentioned issue. |
Sorry, something went wrong.
👍 I'm ok with that as long as it doesn't need to be manually configured by the end user (so is automatically done by the configure step). |
Sorry, something went wrong.
https://bugs.python.org/issue17206 was closed in 2013. Are you sure about the issue number? https://bugs.python.org/issue17206 |
Sorry, something went wrong.
|
Very. I don't see how being an old, closed issue makes a difference as to the resolution. Mind you, the stack overflow wasn't mentioned until a while into the discussion. msg190623 is where that starts, coincidentally by yourself. |
Sorry, something went wrong.
|
Rather than increasing the allowed stack, how about setting Clang to -O1 for the debug build? |
Sorry, something went wrong.
I proposed to enable optimization on Windows debug build when debugging a test_exceptions crash: https://bugs.python.org/issue44348 => this idea was rejected, it's a bad idea: https://bugs.python.org/issue45115 The lib2to3 crash is tracked at https://bugs.python.org/issue46542 I already wrote a fix for test_json: use support.infinite_recursion() which reduces the recusion limit while running the test. For the lib2to3 crash, my problem is that so far I failed to reproduce it. Does someone know how to reproduce the test_lib2to3 crash? |
Sorry, something went wrong.
|
I proposed PR #31035 to prevent the crash without having to revert this change. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Splits most calls (excluding CALL_FUNCTION_EX) into a PRECALL and a CALL.
The two call opcodes CALL_FUNCTION and CALL_METHOD are unified into a single CALL opcode.
We already split method calls into PRECALL_METHOD and CALL_METHOD, this PR adds a PRECALL_FUNCTION and KW_NAMES.
"normal" calls, f(args) are split into PRECALL_FUNCTION; CALL.
"method" calls, o.m(args) are split into PRECALL_METHOD; CALL
Any calls with named arguments have KW_NAMES inserted in between the PRECALL and CALL.
https://bugs.python.org/issue46329