Skip to content

SIGSEGV in test_isinstance and test_json with --enable-experimental-jit=yes and --with-lto=full #142543

Description

@ashm-dev

Bug report

Bug description:

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

Reproduction:

./python -X dev -m test -j8 -uall

Crash 1: test_isinstance
Test: test_isinstance.py -> test_infinite_cycle_in_bases

Fatal Python error: Segmentation fault

Current thread 0x00007bac0e60f780 [python] (most recent call first):
  File "/home/shamil/oss/cpython/main/Lib/test/test_isinstance.py", line 338 in __bases__
  ...
  File "/home/shamil/oss/cpython/main/Lib/test/test_isinstance.py", line 340 in test_infinite_cycle_in_bases
  ...
Current thread's C stack trace (most recent call first):
  Binary file "/home/shamil/oss/cpython/main/python", at _Py_DumpStack+0x29
  ...
  Binary file "/home/shamil/oss/cpython/main/python", at _PyEval_EvalFrameDefault+0x1aa1a
  Binary file "/home/shamil/oss/cpython/main/python", at _PyFunction_Vectorcall+0xb83
  Binary file "/home/shamil/oss/cpython/main/python", at PyObject_CallOneArg+0x54
  ...
  <repeated calls>

Crash 2: test_json
Test: test_json/test_recursion.py -> test_endless_recursion

Fatal Python error: Segmentation fault

Current thread 0x00007e1fc251b780 [python] (most recent call first):
  File "/home/shamil/oss/cpython/main/Lib/test/test_json/test_recursion.py", line 109 in default
  File "/home/shamil/oss/cpython/main/Lib/json/encoder.py", line 263 in iterencode
  ...
Current thread's C stack trace (most recent call first):
  Binary file "/home/shamil/oss/cpython/main/python", at _Py_DumpStack+0x29
  ...
  Binary file "/home/shamil/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6afb
  Binary file "/home/shamil/oss/cpython/main/build/lib.linux-x86_64-3.15/_json.cpython-315-x86_64-linux-gnu.so", at +0x6a7c
  <repeated calls>

Full tests log - tests.log

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions