Skip to content

[Free Threading] test_opcache: test_binary_subscr_list_int(): list_get_item_ref: Assertion `cap != -1 && cap >= size' failed #127521

Closed
@vstinner

Description

@vstinner

test_binary_subscr_list_int() does crash randomly with an assertion error if Python is built with --disable-gil:

$ ./python -m test test_opcache -v -m test_binary_subscr_list_int -j10 -F
(...)
test_binary_subscr_list_int (test.test_opcache.TestRacesDoNotCrash.test_binary_subscr_list_int) ...

python: Objects/listobject.c:342: list_get_item_ref: Assertion `cap != -1 && cap >= size' failed.
Fatal Python error: Aborted

Thread 0x00007f244350f6c0 (most recent call first):
  File "/home/vstinner/python/main/Lib/test/test_opcache.py", line 638 in write
  File "/home/vstinner/python/main/Lib/threading.py", line 992 in run
  File "/home/vstinner/python/main/Lib/threading.py", line 1041 in _bootstrap_inner
  File "/home/vstinner/python/main/Lib/threading.py", line 1012 in _bootstrap

Thread 0x00007f2443d106c0 (most recent call first):
  File "/home/vstinner/python/main/Lib/test/test_opcache.py", line 639 in write
  File "/home/vstinner/python/main/Lib/threading.py", line 992 in run
  File "/home/vstinner/python/main/Lib/threading.py", line 1041 in _bootstrap_inner
  File "/home/vstinner/python/main/Lib/threading.py", line 1012 in _bootstrap

Current thread 0x00007f2451be5740 (most recent call first):
  File "/home/vstinner/python/main/Lib/test/test_opcache.py", line 632 in read
  File "/home/vstinner/python/main/Lib/test/test_opcache.py", line 586 in assert_races_do_not_crash
  File "/home/vstinner/python/main/Lib/test/test_opcache.py", line 22 in wrapper
  File "/home/vstinner/python/main/Lib/test/test_opcache.py", line 642 in test_binary_subscr_list_int
  (...)

Extension modules: _testinternalcapi (total: 1)

Bug seen on macOS CI, and reproduced on Linux.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14new features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions