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
test_create_many_threaded() of test_interpreters.test_stress Hitting an Assert #120524
There is a race in initialization of static builtin types. gh-120182 introduced an assert which has exposed the race. (The 3.13 backport, gh-120518, exposed the same race.)
The problem was identified by multiple stable buildbots, both on main and 3.13. Here's the error:
Assertion failed: (_PyRuntime.types.managed_static.types[full_index].interp_count > 0), function managed_static_type_state_clear, file typeobject.c, line 296.
I was able to reproduce this locally with the following command:
./python -m test test_interpreters -m test_create_many_threaded -v -u cpu --forever
My debugger indicates that there are two threads hitting that assert at the same time, simultaneously trying to finalize PyStdPrinter_Type, though I expect which type hits the race would vary.
I plan on tracking down the problem but in the meantime I'm going to temporarily skip test_create_many_threaded() to get the buildbots back to green.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Output from running 'python -VV' on the command line:
Activity
gh-120524: Temporarily Skip test_create_many_threaded In test_interpr…
[3.13] gh-120524: Temporarily Skip test_create_many_threaded In test_…
ericsnowcurrently commentedon Jun 15, 2024
I've temporarily disabled the failing test. I'll land an actual fix probably Monday.
Merge branch 'main' into fix-pythongh-120524-racy-builtin-type-lifecycle
gh-120524: Avoid a Race On _PyRuntime.types.managed_static.types[i].i…
pythongh-120524: Avoid a Race On _PyRuntime.types.managed_static.type…
ericsnowcurrently commentedon Jun 17, 2024
I've landed the proper fix.
[3.13] gh-120524: Avoid a Race On _PyRuntime.types.managed_static.typ…
pythongh-120524: Temporarily Skip test_create_many_threaded In test_i…
pythongh-120524: Avoid a Race On _PyRuntime.types.managed_static.type…
pythongh-120524: Temporarily Skip test_create_many_threaded In test_i…
pythongh-120524: Avoid a Race On _PyRuntime.types.managed_static.type…