Windows: Wow64ProcessPendingCrossProcessItems can leave mutexes locked forever
- Dominant language
- C++
- Stars
- 8k
- Forks
- 351
- Avg merge
- 12h 31m
- Merged PRs (30d)
- 102
Description
I haven't seen this in practice, but if Wow64ProcessPendingCrossProcessItems is called when a pre but not post callback is in the queue the mutex can be locked on one thread, but then unlocked on another if a different thread calls Wow64ProcessPendingCrossProcessItems and processes the post callback.
This will need us to serialize Wow64ProcessPendingCrossProcessItems calls and manage the threadcreationmutex in a different way that's either eagerly locked or lazily locked with polling. this is not ideal.
Wow64ProcessPendingCrossProcessItems also needs to be called before every memory callback (that isnt itself invoked from Wow64ProcessPendingCrossProcessItems) for safety
Contributor guide
Research direction
Start by tracing Wow64ProcessPendingCrossProcessItems and the memory callbacks it can invoke, with particular attention to pre- and post-callback handling and threadcreationmutex ownership. Reproduce or reason through calls on different threads, then verify that callback processing cannot leave the mutex locked and that every relevant memory callback performs the required pending-item processing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100