You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d6d27c0
Browse filesBrowse the repository at this point in the historyBrowse files
[JSC][WASM][Debugger] Fix WASM debugger stop-the-world races during VM construction and destruction
https://bugs.webkit.org/show_bug.cgi?id=310328
rdar://172974905
Reviewed by Mark Lam.
Fix crashes and assertion failures in the Wasm debugger's stop-the-world
(STW) machinery when VMs are created or destroyed concurrently with a
debugger interrupt.
- Move m_numberOfStoppedVMs and m_numberOfActiveVMs from Atomic<unsigned>
to plain unsigned WTF_GUARDED_BY_LOCK(m_worldLock), and consolidate all
counter updates and debugState()->setStopped()/clearStop() into the same
lock acquisitions as the mode checks, eliminating races where the counters
could be observed in an inconsistent state across separate lock acquisitions.
- Remove vm.requestStop() from notifyVMConstruction and notifyVMActivation.
requestStop() installs a VMTrap to indirectly drive notifyVMStop(), but
both functions already call notifyVMStop() directly, making the requestStop() redundant.
- Separate VMManager registration from VMThreadContext lifecycle. Call
notifyVMConstruction() explicitly at the end of VM::VM() after all VM
state is initialized, so any STW triggered immediately on registration
sees a fully constructed VM. Call notifyVMDestruction() explicitly at
the start of VM::~VM() before any teardown. VMThreadContext is now a
pure data holder with a default constructor and destructor.
- Fix VMTraps::handleTraps() to tolerate a NoEvent result from
takeTopPriorityTrap() when cancelStop() races with trap dispatch.
Tests: JSC::Wasm::testExecutionHandlerVMLifecycle
Canonical link: https://commits.webkit.org/309965@main
Copy file name to clipboardExpand all lines: Source/JavaScriptCore/wasm/debugger/README.md
-9Lines changed: 0 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -230,15 +230,6 @@ See [RWI_ARCHITECTURE.md](./RWI_ARCHITECTURE.md) for complete setup instructions
230
230
-**Issue**: Thread select and stop reply protocol handlers need improvement to correctly display multi-VM data in LLDB
231
231
-**Current Status**: Multi-VM stop-the-world is implemented, but thread information may not display correctly in LLDB UI
232
232
233
-
### VM Lifecycle and Synchronization Testing
234
-
235
-
-**Issue**: ExecutionHandler stress tests need additional coverage for VM lifecycle edge cases and race conditions
236
-
-**Current Test Limitations**: Tests wait for VM construction and instance registration, but this doesn't guarantee VMs are actively running code that checks traps
237
-
-**Missing Test Coverage**:
238
-
- VM lifecycle edge cases (construction, initialization, instance registration)
239
-
-`interrupt()` race conditions when VMs are not yet executing code
240
-
- Synchronization between VM construction and actual code execution
241
-
242
233
### X86_64 Support
243
234
244
235
-**Issue**: The WebAssembly debugger is currently restricted to ARM64 platforms only
0 commit comments