Ignore:
Timestamp:
May 16, 2016, 10:31:35 PM (9 years ago)
Author:
[email protected]
Message:

ShadowChicken crashes when reading a scope from the frame during a stack overflow exception
https://bugs.webkit.org/show_bug.cgi?id=157770

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

ShadowChicken was reading the scope from a half formed
frame as it threw a stack overflow exception. The frame had
a valid CodeBlock pointer, but it did not have a valid scope.
The code in ShadowChicken's throw packet logging mechanism didn't
account for this. The fix is to respect whether genericUnwind wants
to unwind from the current frame or the caller's frame. For stack
overflow errors, we always unwind the caller's frame.

  • jit/JITExceptions.cpp:

(JSC::genericUnwind):

LayoutTests:

  • inspector/debugger/debugger-stack-overflow-expected.txt: Added.
  • inspector/debugger/debugger-stack-overflow.html: Added.
  • inspector/debugger/resources/stack-overflow.js: Added.

(foo):
(start):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITExceptions.cpp

    r199076 r200997  
    5252    }
    5353   
    54     vm->shadowChicken().log(*vm, callFrame, ShadowChicken::Packet::throwPacket());
     54    ExecState* shadowChickenTopFrame = callFrame;
     55    if (unwindStart == UnwindFromCallerFrame) {
     56        VMEntryFrame* topVMEntryFrame = vm->topVMEntryFrame;
     57        shadowChickenTopFrame = callFrame->callerFrame(topVMEntryFrame);
     58    }
     59    vm->shadowChicken().log(*vm, shadowChickenTopFrame, ShadowChicken::Packet::throwPacket());
    5560   
    5661    Exception* exception = vm->exception();
Note: See TracChangeset for help on using the changeset viewer.