Skip to content

3.16.0a1 freethreading-debug build on i686: test_destroy_subinterpreter_does_not_abort triggers assertion in mimalloc #159462

Open

Description

@befeleme

Bug report

When building a freethreading debug Python 3.16.0a1 for Fedora Linux 46 on i686 architecture, test_destroy_subinterpreter_does_not_abort fails with SIGABRT.

The crashing assertion python: /builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/Objects/obmalloc.c:215: _PyMem_mi_page_reclaimed: Assertion tstate == (_PyThreadStateImpl *)_PyThreadState_GET()' failed. has already been dealt with: #153176 -- but probably not for 32bit arches?

Re-running test.test_free_threading.test_interpreters in verbose mode (matching: test_destroy_subinterpreter_does_not_abort)
test_destroy_subinterpreter_does_not_abort (test.test_free_threading.test_interpreters.InterpreterTeardownTests.test_destroy_subinterpreter_does_not_abort) ... FAIL
======================================================================
FAIL: test_destroy_subinterpreter_does_not_abort (test.test_free_threading.test_interpreters.InterpreterTeardownTests.test_destroy_subinterpreter_does_not_abort)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/Lib/test/test_free_threading/test_interpreters.py", line 25, in test_destroy_subinterpreter_does_not_abort
    script_helper.assert_python_ok('-c', script)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/Lib/test/support/script_helper.py", line 182, in assert_python_ok
    return _assert_python(True, *args, **env_vars)
  File "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/Lib/test/support/script_helper.py", line 167, in _assert_python
    res.fail(cmd_line)
    ~~~~~~~~^^^^^^^^^^
  File "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/Lib/test/support/script_helper.py", line 80, in fail
    raise AssertionError(f"Process return code is {exitcode}\n"
    ...<10 lines>...
                         f"---")
AssertionError: Process return code is -6 (SIGABRT)
command line: ['/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/python', '-X', 'faulthandler', '-I', '-c', '\nimport _testinternalcapi\n\ninterpid = _testinternalcapi.create_interpreter()\n_testinternalcapi.destroy_interpreter(interpid, basic=True)\n']
stdout:
---
---
stderr:
---
python: /builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/Objects/obmalloc.c:215: _PyMem_mi_page_reclaimed: Assertion `tstate == (_PyThreadStateImpl *)_PyThreadState_GET()' failed.
Fatal Python error: Aborted
<Cannot show all threads while the GIL is disabled>
Stack (most recent call first):
Current thread's C stack trace (most recent call first):
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at _Py_DumpStack+0x48 [0xf7d8736f]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x61158f [0xf7dad58f]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x611945 [0xf7dad945]
  Binary file "linux-gate.so.1", at __kernel_sigreturn+0x0 [0xf7f2a430]
  Binary file "linux-gate.so.1", at __kernel_vsyscall+0xc [0xf7f2a40c]
  Binary file "/lib/libc.so.6", at +0xb18bd [0xf763a8bd]
  Binary file "/lib/libc.so.6", at abort+0x34 [0xf761fdc2]
  Binary file "/lib/libc.so.6", at +0x97f71 [0xf7620f71]
  Binary file "/lib/libc.so.6", at __assert_fail+0xad [0xf7630ddd]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x3d44b2 [0xf7b704b2]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x3c8f6f [0xf7b64f6f]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x3cfc86 [0xf7b6bc86]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x3cfde5 [0xf7b6bde5]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x3c27f1 [0xf7b5e7f1]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x3c294b [0xf7b5e94b]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x5be3d9 [0xf7d5a3d9]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at PyThreadState_Clear+0x5da [0xf7d57911]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x5bbeb0 [0xf7d57eb0]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at Py_EndInterpreter+0x12c [0xf7d50827]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/build/lib.linux-i686-3.16/_testinternalcapi.cpython-316td-i386-linux-gnu.so", at +0x1ba52 [0xef187a52]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x3ab393 [0xf7b47393]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at _PyObject_MakeTpCall+0x23a [0xf7ab5e0c]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x319280 [0xf7ab5280]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at PyObject_Vectorcall+0x2f [0xf7ab61ae]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at _Py_VectorCallInstrumentation_StackRefSteal+0xb8 [0xf7c6c311]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at _PyEval_EvalFrameDefault+0xd11c [0xf7c7a31c]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x4cc824 [0xf7c68824]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x506a2a [0xf7ca2a2a]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at PyEval_EvalCode+0xe1 [0xf7c6bd45]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x5c26a0 [0xf7d5e6a0]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x5c2aa8 [0xf7d5eaa8]
  Binary file "/builddir/build/BUILD/python3.16-3.16.0_a1-build/Python-3.16.0a1/build/freethreading-debug/libpython3.16td.so.1.0", at +0x5c230d [0xf7d5e30d]
  <truncated rest of calls>
Extension modules: _testinternalcapi (total: 1)
---

CPython versions tested on:

3.16

Operating systems tested on:

Linux

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions