You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SIGSEGV in test_isinstance and test_json with --enable-experimental-jit=yes and --with-lto=full #142543
I encountered segmentation faults (SIGSEGV, Exit code -11) while running the test suite on the main branch (3.15). The crashes occur during recursion tests in test_isinstance and test_json.
Build Environment:
Compiler: Clang 21
Flags:-march=native
Configuration:
CC=clang-21 CXX=clang++-21 CFLAGS='-march=native' ./configure --enable-optimizations --enable-experimental-jit=yes --with-lto=full && make -j8
$ ./python -X dev -m test test_isinstance -j8 -uall
Using random seed: 211998123
0:00:00 load avg: 1.41 Run 1 test in parallel using 1 worker process
0:00:00 load avg: 1.41 [1/1/1] test_isinstance worker non-zero exit code (Exit code -11 (SIGSEGV))
Fatal Python error: Segmentation fault
Current thread 0x00007f62cca3d780 [python] (most recent call first):
File "/home/boss/projects/oss/cpython/main/Lib/test/test_isinstance.py", line 338 in __bases__
File "/home/boss/projects/oss/cpython/main/Lib/unittest/case.py", line 245 in handle
File "/home/boss/projects/oss/cpython/main/Lib/unittest/case.py", line 811 in assertRaises
File "/home/boss/projects/oss/cpython/main/Lib/test/test_isinstance.py", line 340 in test_infinite_cycle_in_bases
File "/home/boss/projects/oss/cpython/main/Lib/unittest/case.py", line 613 in _callTestMethod
File "/home/boss/projects/oss/cpython/main/Lib/unittest/case.py", line 667 in run
File "/home/boss/projects/oss/cpython/main/Lib/unittest/case.py", line 723 in __call__
File "/home/boss/projects/oss/cpython/main/Lib/unittest/suite.py", line 122 in run
File "/home/boss/projects/oss/cpython/main/Lib/unittest/suite.py", line 84 in __call__
File "/home/boss/projects/oss/cpython/main/Lib/unittest/suite.py", line 122 in run
File "/home/boss/projects/oss/cpython/main/Lib/unittest/suite.py", line 84 in __call__
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/testresult.py", line 148 in run
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 84 in _run_suite
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 42 in run_unittest
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 162 in test_func
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 118 in regrtest_runner
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 165 in _load_run_test
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 210 in _runtest_env_changed_exc
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 319 in _runtest
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 348 in run_single_test
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/worker.py", line 99 in worker_process
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/worker.py", line 134 in main
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/worker.py", line 138 in <module>
File "<frozen runpy>", line 87 in _run_code
File "<frozen runpy>", line 196 in _run_module_as_main
Current thread's C stack trace (most recent call first):
Binary file "/home/boss/projects/oss/cpython/main/python", at _Py_DumpStack+0x3a [0x55aea94cdbba]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0x16bb38 [0x55aea94dbb38]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0x16ba77 [0x55aea94dba77]
Binary file "/usr/lib/libc.so.6", at +0x3e4d0 [0x7f62cc83e4d0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0x1ef289 [0x55aea955f289]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0x3a4bf6 [0x55aea9714bf6]
Binary file "/home/boss/projects/oss/cpython/main/python", at _PyEval_EvalFrameDefault+0x1c380 [0x55aea95b6de0]
Binary file "/home/boss/projects/oss/cpython/main/python", at _PyFunction_Vectorcall+0xc0e [0x55aea952b4fe]
Binary file "/home/boss/projects/oss/cpython/main/python", at PyObject_CallOneArg+0x61 [0x55aea9425681]
Binary file "/home/boss/projects/oss/cpython/main/python", at PyObject_GetOptionalAttr+0x1d8f [0x55aea9449e7f]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0d05 [0x55aea9420d05]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0c0b [0x55aea9420c0b]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0xb0cc0 [0x55aea9420cc0]
<truncated rest of calls>
Extension modules: math.integer, _testinternalcapi (total: 2)
== Tests result: FAILURE ==
1 test failed:
test_isinstance
Total duration: 276 ms
Total tests: run=0
Total test files: run=1/1 failed=1
Result: FAILURE
test_json
$ ./python -X dev -m test test_json -j8 -uall
Using random seed: 2949834397
0:00:00 load avg: 0.58 Run 1 test in parallel using 1 worker process
0:00:00 load avg: 0.58 [1/1/1] test_json worker non-zero exit code (Exit code -11 (SIGSEGV))
Fatal Python error: Segmentation fault
Current thread 0x00007f763b0cb780 [python] (most recent call first):
File "/home/boss/projects/oss/cpython/main/Lib/test/test_json/test_recursion.py", line 109 in default
File "/home/boss/projects/oss/cpython/main/Lib/json/encoder.py", line 263 in iterencode
File "/home/boss/projects/oss/cpython/main/Lib/json/encoder.py", line 202 in encode
File "/home/boss/projects/oss/cpython/main/Lib/test/test_json/test_recursion.py", line 113 in test_endless_recursion
File "/home/boss/projects/oss/cpython/main/Lib/unittest/case.py", line 613 in _callTestMethod
File "/home/boss/projects/oss/cpython/main/Lib/unittest/case.py", line 667 in run
File "/home/boss/projects/oss/cpython/main/Lib/unittest/case.py", line 723 in __call__
File "/home/boss/projects/oss/cpython/main/Lib/unittest/suite.py", line 122 in run
File "/home/boss/projects/oss/cpython/main/Lib/unittest/suite.py", line 84 in __call__
File "/home/boss/projects/oss/cpython/main/Lib/unittest/suite.py", line 122 in run
File "/home/boss/projects/oss/cpython/main/Lib/unittest/suite.py", line 84 in __call__
File "/home/boss/projects/oss/cpython/main/Lib/unittest/suite.py", line 122 in run
File "/home/boss/projects/oss/cpython/main/Lib/unittest/suite.py", line 84 in __call__
File "/home/boss/projects/oss/cpython/main/Lib/unittest/suite.py", line 122 in run
File "/home/boss/projects/oss/cpython/main/Lib/unittest/suite.py", line 84 in __call__
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/testresult.py", line 148 in run
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 84 in _run_suite
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 42 in run_unittest
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 162 in test_func
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 118 in regrtest_runner
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 165 in _load_run_test
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 210 in _runtest_env_changed_exc
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 319 in _runtest
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/single.py", line 348 in run_single_test
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/worker.py", line 99 in worker_process
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/worker.py", line 134 in main
File "/home/boss/projects/oss/cpython/main/Lib/test/libregrtest/worker.py", line 138 in <module>
File "<frozen runpy>", line 87 in _run_code
File "<frozen runpy>", line 196 in _run_module_as_main
Current thread's C stack trace (most recent call first):
Binary file "/home/boss/projects/oss/cpython/main/python", at _Py_DumpStack+0x3a [0x55fcbcb0ebba]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0x16bb38 [0x55fcbcb1cb38]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0x16ba77 [0x55fcbcb1ca77]
Binary file "/usr/lib/libc.so.6", at +0x3e4d0 [0x7f763ae3e4d0]
Binary file "/home/boss/projects/oss/cpython/main/python", at _PyEval_EvalFrameDefault+0x118db [0x55fcbcbed33b]
Binary file "/home/boss/projects/oss/cpython/main/python", at _PyFunction_Vectorcall+0xc0e [0x55fcbcb6c4fe]
Binary file "/home/boss/projects/oss/cpython/main/python", at +0x1be2c5 [0x55fcbcb6f2c5]
Binary file "/home/boss/projects/oss/cpython/main/python", at PyObject_CallOneArg+0x61 [0x55fcbca66681]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6b06 [0x7f763b029b06]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6a6e [0x7f763b029a6e]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6b3c [0x7f763b029b3c]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6a6e [0x7f763b029a6e]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6b3c [0x7f763b029b3c]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6a6e [0x7f763b029a6e]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6b3c [0x7f763b029b3c]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6a6e [0x7f763b029a6e]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6b3c [0x7f763b029b3c]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6a6e [0x7f763b029a6e]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6b3c [0x7f763b029b3c]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6a6e [0x7f763b029a6e]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6b3c [0x7f763b029b3c]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6a6e [0x7f763b029a6e]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6b3c [0x7f763b029b3c]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6a6e [0x7f763b029a6e]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6b3c [0x7f763b029b3c]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6a6e [0x7f763b029a6e]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6b3c [0x7f763b029b3c]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6a6e [0x7f763b029a6e]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6b3c [0x7f763b029b3c]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6a6e [0x7f763b029a6e]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6b3c [0x7f763b029b3c]
Binary file "/home/boss/projects/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6a6e [0x7f763b029a6e]
<truncated rest of calls>
Extension modules: math.integer, _testinternalcapi (total: 2)
== Tests result: FAILURE ==
1 test failed:
test_json
Total duration: 365 ms
Total tests: run=0
Total test files: run=1/1 failed=1
Result: FAILURE
$ ./python -X dev -m test test_isinstance -j8 -uall
Using random seed: 2606059884
0:00:00 load avg: 1.64 Run 1 test in parallel using 1 worker process
0:00:02 load avg: 1.59 [1/1] test_isinstance passed
== Tests result: SUCCESS ==
1 test OK.
Total duration: 2.5 sec
Total tests: run=23
Total test files: run=1/1
Result: SUCCESS
test_json
$ ./python -X dev -m test test_json -j8 -uall
Using random seed: 2493830420
0:00:00 load avg: 1.92 Run 1 test in parallel using 1 worker process
0:00:03 load avg: 1.85 [1/1] test_json passed
== Tests result: SUCCESS ==
1 test OK.
Total duration: 3.6 sec
Total tests: run=213 skipped=1
Total test files: run=1/1
Result: SUCCESS
Activity
Fidget-Spinner commentedon Dec 10, 2025
Did you manage to narrow down where the SEGV is pointing to?
Recursion shouldn't even trigger JIT compilation, only loops at the moment.
ashm-dev commentedon Dec 10, 2025
I'm still trying to understand
ashm-dev commentedon Dec 13, 2025
In this case, I don’t understand what’s causing the issue, since the segfaults do not reproduce in debug mode and/or with ASan enabled.
Fidget-Spinner commentedon Dec 13, 2025
Does it reproduce with the tail call interpreter option with:
If it doesn't, then it's likely the C stack taking up too much space again on JIT builds.
Fidget-Spinner commentedon Dec 13, 2025
Also can you provide the full stack trace please instead of a partial one? That will give much more info.
ashm-dev commentedon Dec 16, 2025
CC=clang-21 CXX=clang++-21 CFLAGS='-march=native' ./configure --enable-optimizations --enable-experimental-jit=yes --with-lto=full
test_isinstance
test_json
CC=clang-21 CXX=clang++-21 CFLAGS='-march=native' ./configure --enable-optimizations --with-tail-call-interp --enable-experimental-jit=yes --with-lto=full
test_isinstanse
test_json
Fidget-Spinner commentedon Dec 16, 2025
Ok so that pretty much confirms this is a stack overflow issue. Thank you.
Fidget-Spinner commentedon Dec 16, 2025
I think this is similar to #137731
gh-142543: Mark tracer functions as Py_NO_INLINE (GH-142846)
Fidget-Spinner commentedon Dec 17, 2025
@ashm-dev thanks for the bug report. Can you please try main now again? I checked on my machine that it should've fixed your issues.
ashm-dev commentedon Dec 17, 2025
Yes, it's all right now.