Skip to content

Various data races in subinterpreter tests under TSAN #129824

Description

@colesbury

Bug report

Thread sanitizer reports a number of data races when running subinterpreter tests

InterpreterPoolMixin (test_concurrent_futures)

I think for now it would make sense to skip the InterpreterPoolMixin tests when running with TSAN.

test__interpchannels

test__interpreters and test_interpreters

  • type_ready_set_new:
    type->tp_flags |= Py_TPFLAGS_DISALLOW_INSTANTIATION;
  • type_ready: (see Data race on tp_flags with subinterpreters and static types #129817)
  • File descriptor race in test_api.LowLevelTests.test_is_running and test_running: close() concurrent with read() on the same file descriptor.
  • managed_static_type_state_init in test.test_interpreters.test_stress.StressTests.test_create_many_threaded: data race on the non-atomic read of interp_count.
  • pegen memo_statistics mutex is currently only used in free threading build (seen in test_create_many_threaded)
  • version tags on static types: NEXT_GLOBAL_VERSION_TAG, type->tp_versions_used, and tp->tp_version_tag modifications are not thread-safe (seen in test_create_many_threaded)

test_capi.test_misc.assign_version_tag

  • race on NEXT_GLOBAL_VERSION_TAG in assign_version_tag (see above)

Linked PRs

Activity

  1. added a commit that references this issue on Feb 7, 2025
  2. changed the title [-]Various data races in `InterpreterPoolMixin` tests under TSAN[/-] [+]Various data races in subinterpreter tests under TSAN[/+] on Feb 7, 2025
  3. added 8 commits that reference this issue on Feb 7, 2025
  4. 14 remaining items

  5. added a commit that references this issue on Jul 4, 2025
  6. added a commit that references this issue on Jul 6, 2025
  7. added a commit that references this issue on Jul 11, 2025
  8. added a commit that references this issue on Jul 12, 2025
  9. added a commit that references this issue on Jul 13, 2025
  10. added a commit that references this issue on Aug 4, 2025
  11. added a commit that references this issue on Aug 19, 2025
  12. added 5 commits that reference this issue on Jan 5, 2026
  13. added a commit that references this issue on Jan 12, 2026
  14. added 2 commits that reference this issue on Feb 15, 2026
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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions