diff options
author | mpage <mpage@meta.com> | 2024-12-03 17:50:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-03 17:50:58 (GMT) |
commit | 13b68e1a61e92a032d255aff5d5af435bbb63e8b (patch) | |
tree | 733ba0835481ecee9ab9b6887df75a815ac1ea40 /Python | |
parent | 0cb52220790d8bc70ec325fd89d52b5f3b7ad29c (diff) | |
download | cpython-13b68e1a61e92a032d255aff5d5af435bbb63e8b.zip cpython-13b68e1a61e92a032d255aff5d5af435bbb63e8b.tar.gz cpython-13b68e1a61e92a032d255aff5d5af435bbb63e8b.tar.bz2 |
gh-127421: Fix race in test_start_new_thread_failed (#127549)
Fix race in test_start_new_thread_failed
When we succeed in starting a new thread, for example if setrlimit
was ineffective, we must wait for the newly spawned thread to exit.
Otherwise, we run the risk that the newly spawned thread will race
with runtime finalization and access memory that has already been
clobbered/freed.
`_thread.start_new_thread()` only spawns daemon threads, which the runtime
does not wait for at shutdown, and does not return a handle. Use
`_thread.start_joinable_thread()` and join the resulting handle when
the thread is started successfully.
Diffstat (limited to 'Python')
0 files changed, 0 insertions, 0 deletions