Changeset 213930 in webkit
- Timestamp:
- Mar 14, 2017, 12:29:26 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r213904 r213930 1 2017-03-14 Mark Lam <mark.lam@apple.com> 2 3 Add a null check in VMTraps::willDestroyVM() to handle a race condition. 4 https://bugs.webkit.org/show_bug.cgi?id=169620 5 6 Reviewed by Filip Pizlo. 7 8 There exists a race between VMTraps::willDestroyVM() (which removed SignalSenders 9 from its m_signalSenders list) and SignalSender::send() (which removes itself 10 from the list). In the event that SignalSender::send() removes itself between 11 the time that VMTraps::willDestroyVM() checks if m_signalSenders is empty and the 12 time it takes a sender from m_signalSenders, VMTraps::willDestroyVM() may end up 13 with a NULL sender pointer. The fix is to add the missing null check before using 14 the sender pointer. 15 16 * runtime/VMTraps.cpp: 17 (JSC::VMTraps::willDestroyVM): 18 (JSC::VMTraps::fireTrap): 19 * runtime/VMTraps.h: 20 1 21 2017-03-14 Mark Lam <mark.lam@apple.com> 2 22 -
trunk/Source/JavaScriptCore/runtime/VMTraps.cpp
r213886 r213930 404 404 void VMTraps::willDestroyVM() 405 405 { 406 m_isShuttingDown = true; 407 WTF::storeStoreFence(); 406 408 #if ENABLE(SIGNAL_BASED_VM_TRAPS) 407 409 while (!m_signalSenders.isEmpty()) { … … 414 416 auto locker = holdLock(m_lock); 415 417 sender = m_signalSenders.takeAny(); 418 if (!sender) 419 break; 416 420 } 417 421 sender->willDestroyVM(); 418 422 } 423 ASSERT(m_signalSenders.isEmpty()); 419 424 #endif 420 425 } … … 477 482 { 478 483 auto locker = holdLock(m_lock); 484 ASSERT(!m_isShuttingDown); 479 485 setTrapForEvent(locker, eventType); 480 486 m_needToInvalidatedCodeBlocks = true; -
trunk/Source/JavaScriptCore/runtime/VMTraps.h
r213652 r213930 168 168 }; 169 169 bool m_needToInvalidatedCodeBlocks { false }; 170 bool m_isShuttingDown { false }; 170 171 171 172 #if ENABLE(SIGNAL_BASED_VM_TRAPS)
Note:
See TracChangeset
for help on using the changeset viewer.