Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Bug description:
There is a potential race when_PyParkingLot_UnparkAll is executing in one thread and another thread is unblocked because of an interrupt in_PyParkingLot_Park. Consider the following scenario:
- Thread T0 isblocked in
_PyParkingLot_Parkon addressA. - Thread T1 executes
_PyParkingLot_UnparkAllon addressA. It finds thewait_entryforT0andunlinks its list node. - Immediately after (2), T0 is woken up due to an interrupt. It then segfaults trying tounlink the node that was previously unlinked in (2).
I haven't attempted to write a minimal repro for this. It occurs reliably on MacOS onthis PR when running./python.exe -m test test_asyncio.test_events --match test_get_event_loop_new_process.
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS