Repository navigation
Various data races in subinterpreter tests under TSAN #129824
Copy link
Copy link
Open
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-subinterpreterstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
- addedinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Feb 7, 2025 - changed the title
[-]Various data races in `InterpreterPoolMixin` tests under TSAN[/-][+]Various data races in subinterpreter tests under TSAN[/+]on Feb 7, 2025 - added 8 commits that reference this issue
on Feb 7, 2025 14 remaining items
- added 5 commits that reference this issue
on Jan 5, 2026
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-subinterpreterstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
- StatusShow more project fieldsTodo
Bug report
Thread sanitizer reports a number of data races when running subinterpreter tests
InterpreterPoolMixin(test_concurrent_futures)run_eval_code_obj: see Race on_PyRuntime.signals.unhandled_keyboard_interruptwhen callingeval()concurrently in free-threading mode #128130posixmodule_execmodifies globalswaitid_result_descandstat_result_desc_PyBuiltins_AddExceptions: modifies globalsPyExc_EnvironmentError, etc.cpython/Objects/exceptions.c
Lines 4354 to 4355 in 49bd47d
_PyInterpreterState_FinalizeAllocatedBlocks: modifies _PyRuntime variable _PyInterpreterState_FinalizeAllocatedBlocks_globals_fini+clear_interpreter: data race on_globals.module_count(the read inclear_interpreterhappens outside of a lock)init_static_exctypes: modifies globals_PyExc_InterpreterError, etc._structmodule_exec: data race reported onptr->unpack = native->unpackI think for now it would make sense to skip the
InterpreterPoolMixintests when running with TSAN.test__interpchannelsfind_name_in_mroand_waiting_release: I don't understand this one, but it happens duringtest_send_recv_different_interpreters_and_threadstest__interpretersandtest_interpreterstype_ready_set_new:cpython/Objects/typeobject.c
Line 8509 in 7b2e01b
type_ready: (see Data race ontp_flagswith subinterpreters and static types #129817)test_api.LowLevelTests.test_is_runningandtest_running:close()concurrent withread()on the same file descriptor.managed_static_type_state_initintest.test_interpreters.test_stress.StressTests.test_create_many_threaded: data race on the non-atomic read ofinterp_count.memo_statisticsmutex is currently only used in free threading build (seen in test_create_many_threaded)NEXT_GLOBAL_VERSION_TAG,type->tp_versions_used, andtp->tp_version_tagmodifications are not thread-safe (seen in test_create_many_threaded)test_capi.test_misc.assign_version_tagNEXT_GLOBAL_VERSION_TAGinassign_version_tag(see above)Linked PRs