Changeset 212458 in webkit


Ignore:
Timestamp:
Feb 16, 2017 1:04:25 PM (7 years ago)
Author:
keith_miller@apple.com
Message:
ASSERTION FAILED: vm.heap.mutatorState() == MutatorState::Running
vm.apiLock().ownerThread() != std::this_thread::get_id()

https://bugs.webkit.org/show_bug.cgi?id=168354

Reviewed by Filip Pizlo.

Add a new vmEntryGlobalObject method for the debugger so that
the debugger does not crash in debug builds when trying to
detach itself from a global object.

  • debugger/Debugger.cpp:

(JSC::Debugger::detach):

  • interpreter/CallFrame.cpp:

(JSC::CallFrame::vmEntryGlobalObjectForDebuggerDetach):

  • interpreter/CallFrame.h:
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r212453 r212458  
     12017-02-16  Keith Miller  <keith_miller@apple.com>
     2
     3        ASSERTION FAILED: vm.heap.mutatorState() == MutatorState::Running || vm.apiLock().ownerThread() != std::this_thread::get_id()
     4        https://bugs.webkit.org/show_bug.cgi?id=168354
     5
     6        Reviewed by Filip Pizlo.
     7
     8        Add a new vmEntryGlobalObject method for the debugger so that
     9        the debugger does not crash in debug builds when trying to
     10        detach itself from a global object.
     11
     12        * debugger/Debugger.cpp:
     13        (JSC::Debugger::detach):
     14        * interpreter/CallFrame.cpp:
     15        (JSC::CallFrame::vmEntryGlobalObjectForDebuggerDetach):
     16        * interpreter/CallFrame.h:
     17
    1182017-02-16  Keith Miller  <keith_miller@apple.com>
    219
  • trunk/Source/JavaScriptCore/debugger/Debugger.cpp

    r212448 r212458  
    172172    // stack, since we won't get further debugger callbacks to do so. Also, resume execution,
    173173    // since there's no point in staying paused once a window closes.
    174     if (m_isPaused && m_currentCallFrame && m_currentCallFrame->vmEntryGlobalObject() == globalObject) {
     174    if (m_isPaused && m_currentCallFrame && m_currentCallFrame->vmEntryGlobalObjectForDebuggerDetach() == globalObject) {
    175175        m_currentCallFrame = nullptr;
    176176        m_pauseOnCallFrame = nullptr;
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp

    r210149 r212458  
    198198}
    199199
     200JSGlobalObject* CallFrame::vmEntryGlobalObjectForDebuggerDetach()
     201{
     202    if (callee()->isObject()) {
     203        JSGlobalObject* global = static_cast<JSObject*>(callee())->globalObject();
     204        if (this == global->globalExec())
     205            return global;
     206    }
     207    // If we're not an object, we're wasm, and therefore we're executing code and the below is safe.
     208
     209    // For any ExecState that's not a globalExec, the
     210    // dynamic global object must be set since code is running
     211    ASSERT(vm().entryScope);
     212    return vm().entryScope->globalObject();
     213}
     214
    200215CallFrame* CallFrame::callerFrame(VMEntryFrame*& currVMEntryFrame)
    201216{
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.h

    r210149 r212458  
    103103        JS_EXPORT_PRIVATE JSGlobalObject* vmEntryGlobalObject();
    104104
     105        // We need a special version of vmEntryGlobalObject for detaching the debugger since
     106        // could be called by a finalizer.
     107        JSGlobalObject* vmEntryGlobalObjectForDebuggerDetach();
     108
    105109        // Global object in which the currently executing code was defined.
    106110        // Differs from vmEntryGlobalObject() during function calls across web browser frames.
Note: See TracChangeset for help on using the changeset viewer.