Skip to content

Parallel parsing sometimes crashes when compiled in free-threaded Python #21578

@ilevkivskyi

Description

@ilevkivskyi

I don't have a way to reproduce this, but just noticed this random crash in testOutputJsonParallel:

Current thread's C stack trace (most recent call first):
  Binary file "/opt/hostedtoolcache/Python/3.14.5/arm64-freethreaded/lib/libpython3.14t.so.1.0", at _Py_DumpStack+0x4c [0xff4fb2f871ac]
  Binary file "/opt/hostedtoolcache/Python/3.14.5/arm64-freethreaded/lib/libpython3.14t.so.1.0", at +0xed7ac [0xff4fb2f8d7ac]
  Binary file "linux-vdso.so.1", at __kernel_rt_sigreturn+0x0 [0xff4fb3536938]
  Binary file "/lib/aarch64-linux-gnu/libc.so.6", at +0x87608 [0xff4fb2d67608]
  Binary file "/lib/aarch64-linux-gnu/libc.so.6", at gsignal+0x1c [0xff4fb2d1cb3c]
  Binary file "/lib/aarch64-linux-gnu/libc.so.6", at abort+0xf4 [0xff4fb2d07e00]
  Binary file "/lib/aarch64-linux-gnu/libc.so.6", at +0x35cc0 [0xff4fb2d15cc0]
  Binary file "/lib/aarch64-linux-gnu/libc.so.6", at __assert_perror_fail+0x0 [0xff4fb2d15d30]
  Binary file "/home/runner/work/mypy/mypy/fb62009ad6f7d3457273__mypyc.cpython-314t-aarch64-linux-gnu.so", at +0x2bde554 [0xff4fab4ee554]
  Binary file "/home/runner/work/mypy/mypy/fb62009ad6f7d3457273__mypyc.cpython-314t-aarch64-linux-gnu.so", at +0x6118dc [0xff4fa8f218dc]
  Binary file "/home/runner/work/mypy/mypy/fb62009ad6f7d3457273__mypyc.cpython-314t-aarch64-linux-gnu.so", at CPyArg_ParseStackAndKeywordsSimple+0x1b0 [0xff4fa8f22e9c]
  Binary file "/home/runner/work/mypy/mypy/fb62009ad6f7d3457273__mypyc.cpython-314t-aarch64-linux-gnu.so", at CPyPy_mypy___build___State___parse_file_inner+0x48 [0xff4fa90d8f98]
  Binary file "/opt/hostedtoolcache/Python/3.14.5/arm64-freethreaded/lib/libpython3.14t.so.1.0", at _PyEval_EvalFrameDefault+0x48c4 [0xff4fb30620a4]

It looks like some C-level assertion failure (because of a race condition?) FWIW I have never seen this issue in regular (non-free-threaded) Python.

cc @JukkaL (as you have been interested in making native parser more stable)

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions