python-trio / python-trio/trio
Race condition in trio.hazmat.WaitForSingleObject
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.3k
- Forks
- 431
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 6
Description
https://github.com/python-trio/trio/pull/575/files#diff-ed34813c30595dc83bb2a66e0973e22dR54
This appears to have a race condition. The new thread might start waiting only after the handle has been closed. This could be fixed by making the thread close the cancel_handle.
Originally posted by @GSPP in https://github.com/python-trio/trio/issues/233#issuecomment-546681264
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the change shown in pull request #575, especially the diff at line 54 for trio.hazmat.WaitForSingleObject. Trace how the new thread waits and how the handle and cancel_handle are closed; done means eliminating the race where waiting begins after the handle closes, with coverage for that ordering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100