Changeset 40396 in webkit


Ignore:
Timestamp:
Jan 29, 2009 7:09:35 PM (15 years ago)
Author:
cwzwarich@webkit.org
Message:

2009-01-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Oliver Hunt.

Bug 23551: Crash on page load with profiler enabled and running
<https://bugs.webkit.org/show_bug.cgi?id=23551>
<rdar://problem/6529521>

Interpreter::execute(FunctionBodyNode*, ...) calls Profiler::didExecute()
with a stale CallFrame. If some part of the scope chain has already been
freed, Profiler::didExecute() will crash when attempting to get the lexical
global object. The fix is to make the didExecute() call use the caller's
CallFrame, not the one made for the function call. In this case, the
willExecute() call should also be changed to match.

Since this occurs in the actual inspector JS, it is difficult to reduce.
I couldn't make a layout test.

  • interpreter/Interpreter.cpp: (JSC::Interpreter::execute):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r40345 r40396  
     12009-01-29  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Bug 23551: Crash on page load with profiler enabled and running
     6        <https://bugs.webkit.org/show_bug.cgi?id=23551>
     7        <rdar://problem/6529521>
     8
     9        Interpreter::execute(FunctionBodyNode*, ...) calls Profiler::didExecute()
     10        with a stale CallFrame. If some part of the scope chain has already been
     11        freed, Profiler::didExecute() will crash when attempting to get the lexical
     12        global object. The fix is to make the didExecute() call use the caller's
     13        CallFrame, not the one made for the function call. In this case, the
     14        willExecute() call should also be changed to match.
     15
     16        Since this occurs in the actual inspector JS, it is difficult to reduce.
     17        I couldn't make a layout test.
     18
     19        * interpreter/Interpreter.cpp:
     20        (JSC::Interpreter::execute):
     21
    1222009-01-28  Sam Weinig  <sam@webkit.org>
    223
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r40111 r40396  
    922922    Profiler** profiler = Profiler::enabledProfilerReference();
    923923    if (*profiler)
    924         (*profiler)->willExecute(newCallFrame, function);
     924        (*profiler)->willExecute(callFrame, function);
    925925
    926926    JSValuePtr result;
     
    940940
    941941    if (*profiler)
    942         (*profiler)->didExecute(newCallFrame, function);
     942        (*profiler)->didExecute(callFrame, function);
    943943
    944944    m_registerFile.shrink(oldEnd);
Note: See TracChangeset for help on using the changeset viewer.