Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various data races in subinterpreter tests under TSAN #129824

Open
colesbury opened this issue Feb 7, 2025 · 2 comments
Open

Various data races in subinterpreter tests under TSAN #129824

colesbury opened this issue Feb 7, 2025 · 2 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-subinterpreters type-bug An unexpected behavior, bug, or error

Comments

@colesbury
Copy link
Contributor

colesbury commented Feb 7, 2025

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

@colesbury colesbury added interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-subinterpreters type-bug An unexpected behavior, bug, or error labels Feb 7, 2025
colesbury added a commit to colesbury/cpython that referenced this issue Feb 7, 2025
There are multiple data races reported when running the
InterpreterPoolMixin tests, but it's still useful to run the other
test_concurrent_futures tests under TSAN.

Add test_concurrent_futures to the TSAN test suite.
@colesbury colesbury changed the title Various data races in InterpreterPoolMixin tests under TSAN Various data races in subinterpreter tests under TSAN Feb 7, 2025
colesbury added a commit to colesbury/cpython that referenced this issue Feb 7, 2025
Also add test_interpreters to the list of TSAN tests. The test_running
and test_is_running test cases are skipped for now as they have file
descriptor races.
colesbury added a commit to colesbury/cpython that referenced this issue Feb 10, 2025
There are multiple data races reported when running the
InterpreterPoolMixin tests, but it's still useful to run the other
test_concurrent_futures tests under TSAN.
colesbury added a commit to colesbury/cpython that referenced this issue Feb 10, 2025
Also add test_interpreters to the list of TSAN tests. The test_running
and test_is_running test cases are skipped for now as they have file
descriptor races.
colesbury added a commit to colesbury/cpython that referenced this issue Feb 13, 2025
There are multiple data races reported when running the
InterpreterPoolMixin tests, but it's still useful to run the other
test_concurrent_futures tests under TSAN.
colesbury added a commit to colesbury/cpython that referenced this issue Feb 13, 2025
Also add test_interpreters to the list of TSAN tests. The test_running
and test_is_running test cases are skipped for now as they have file
descriptor races.
colesbury added a commit to colesbury/cpython that referenced this issue Feb 19, 2025
colesbury added a commit that referenced this issue Feb 25, 2025
…-129826)

There are multiple data races reported when running the
InterpreterPoolMixin tests, but it's still useful to run the other
test_concurrent_futures tests under TSAN.

Add test_concurrent_futures to the TSAN test suite.
colesbury added a commit to colesbury/cpython that referenced this issue Feb 27, 2025
Also add test_interpreters to the list of TSAN tests. The test_running
and test_is_running test cases are skipped for now as they have file
descriptor races.
colesbury added a commit to colesbury/cpython that referenced this issue Feb 27, 2025
colesbury added a commit to colesbury/cpython that referenced this issue Mar 3, 2025
Also add test_interpreters to the list of TSAN tests. The test_running
and test_is_running test cases are skipped for now as they have file
descriptor races.
colesbury added a commit to colesbury/cpython that referenced this issue Mar 3, 2025
@ZeroIntensity
Copy link
Member

Are you still working on this? I'm happy to take a stab at some of these.

@colesbury
Copy link
Contributor Author

No, I'm not actively working on them. Go for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-subinterpreters type-bug An unexpected behavior, bug, or error
Projects
Status: Todo
Development

No branches or pull requests

2 participants