Ignore:
Timestamp:
Jun 21, 2017, 2:32:44 PM (8 years ago)
Author:
[email protected]
Message:

Web Inspector: Using "break on all exceptions" when throwing stack overflow hangs inspector
https://bugs.webkit.org/show_bug.cgi?id=172432
<rdar://problem/29870873>

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2017-06-21
Reviewed by Saam Barati.

Source/JavaScriptCore:

Avoid pausing on StackOverflow and OutOfMemory errors to avoid a hang.
We will proceed to improve debugging of these cases in the follow-up bugs.

  • debugger/Debugger.cpp:

(JSC::Debugger::exception):
Ignore pausing on these errors.

  • runtime/ErrorInstance.h:

(JSC::ErrorInstance::setStackOverflowError):
(JSC::ErrorInstance::isStackOverflowError):
(JSC::ErrorInstance::setOutOfMemoryError):
(JSC::ErrorInstance::isOutOfMemoryError):

  • runtime/ExceptionHelpers.cpp:

(JSC::createStackOverflowError):

  • runtime/Error.cpp:

(JSC::createOutOfMemoryError):
Mark these kinds of errors.

LayoutTests:

  • inspector/debugger/no-pause-out-of-memory-exception-expected.txt: Added.
  • inspector/debugger/no-pause-out-of-memory-exception.html: Added.
  • inspector/debugger/no-pause-stack-overflow-exception-expected.txt: Added.
  • inspector/debugger/no-pause-stack-overflow-exception.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/debugger/Debugger.cpp

    r216428 r218652  
    758758        return;
    759759
     760    if (JSObject* object = jsDynamicCast<JSObject*>(m_vm, exception)) {
     761        if (object->isErrorInstance()) {
     762            ErrorInstance* error = static_cast<ErrorInstance*>(object);
     763            // FIXME: <https://webkit.org/b/173625> Web Inspector: Should be able to pause and debug a StackOverflow Exception
     764            // FIXME: <https://webkit.org/b/173627> Web Inspector: Should be able to pause and debug an OutOfMemory Exception
     765            if (error->isStackOverflowError() || error->isOutOfMemoryError())
     766                return;
     767        }
     768    }
     769
    760770    PauseReasonDeclaration reason(*this, PausedForException);
    761771    if (m_pauseOnExceptionsState == PauseOnAllExceptions || (m_pauseOnExceptionsState == PauseOnUncaughtExceptions && !hasCatchHandler)) {
Note: See TracChangeset for help on using the changeset viewer.