Changeset 180907 in webkit


Ignore:
Timestamp:
Mar 2, 2015 4:24:24 PM (9 years ago)
Author:
mark.lam@apple.com
Message:

Source/JavaScriptCore:
Exception stack unwinding in JSC hangs while the Timeline Profiler is enabled.
<https://webkit.org/b/142191>

Reviewed by Geoffrey Garen.

Imagine a scenario where the Inspector is paused / suspended at a breakpoint or
while the user is stepping through JS code. The user then tries to evaluate an
expression in the console, and that evaluation results in an exception being
thrown. Currently, if the Timeline Profiler is enabled while this exception is
being thrown, the WebProcess will hang while trying to handle that exception.

The issue is that the Timeline Profiler's ProfileGenerator::didExecute() will
return early and decline to process ProfileNodes if the Inspector is paused.
This is proper because it does not want to count work done for injected scripts
(e.g. from the console) towards the timeline profile of the webpage being run.
However, this is in conflict with ProfileGenerator::exceptionUnwind()'s
expectation that didExecute() will process ProfileNodes in order to do the stack
unwinding for the exception handling. As a result,
ProfileGenerator::exceptionUnwind() hangs.

ProfileGenerator::exceptionUnwind() is in error. While the Inspector is paused,
there will not be any ProfileNodes that it needs to "unwind". Hence, the fix is
simply to return early also in ProfileGenerator::exceptionUnwind() if the
Inspector is paused.

  • profiler/ProfileGenerator.cpp:

(JSC::ProfileGenerator::exceptionUnwind):

LayoutTests:
Last gardening after r177774

Unreviewed.

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2015-03-02

  • fast/text/font-kerning-expected.html:
  • fast/text/font-variant-ligatures-expected.html:
  • fast/text/whitespace/inline-whitespace-wrapping-7-expected.html:
  • fast/text/whitespace/inline-whitespace-wrapping-7.html:
  • mathml/presentation/scripts-subsup-expected.html:
  • mathml/presentation/scripts-subsup.html:
  • platform/mac/TestExpectations:
  • platform/mac/fast/text/multiple-codeunit-vertical-upright-expected.html:
  • platform/mac/fast/text/multiple-codeunit-vertical-upright.html:
  • platform/mac/fast/text/resources/multiple-codeunit-vertical-upright.otf: Removed.
  • svg/text/svg-font-word-rounding-hacks-spaces-expected.html:
  • svg/text/svg-font-word-rounding-hacks-spaces.html:
  • svg/text/tspan-outline-expected.svg:
  • svg/text/tspan-outline.html:
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r180904 r180907  
    1919        * svg/text/tspan-outline-expected.svg:
    2020        * svg/text/tspan-outline.html:
     21
     222015-03-02  Mark Lam  <mark.lam@apple.com>
     23
     24        Exception stack unwinding in JSC hangs while the Timeline Profiler is enabled.
     25        <https://webkit.org/b/142191>
     26
     27        Reviewed by Geoffrey Garen.
     28
     29        * inspector/timeline/exception-in-injected-script-while-recording-expected.txt: Added.
     30        * inspector/timeline/exception-in-injected-script-while-recording.html: Added.
    2131
    22322015-03-02  Mark Lam  <mark.lam@apple.com>
  • trunk/Source/JavaScriptCore/ChangeLog

    r180903 r180907  
     12015-03-02  Mark Lam  <mark.lam@apple.com>
     2
     3        Exception stack unwinding in JSC hangs while the Timeline Profiler is enabled.
     4        <https://webkit.org/b/142191>
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Imagine a scenario where the Inspector is paused / suspended at a breakpoint or
     9        while the user is stepping through JS code. The user then tries to evaluate an
     10        expression in the console, and that evaluation results in an exception being
     11        thrown. Currently, if the Timeline Profiler is enabled while this exception is
     12        being thrown, the WebProcess will hang while trying to handle that exception.
     13
     14        The issue is that the Timeline Profiler's ProfileGenerator::didExecute() will
     15        return early and decline to process ProfileNodes if the Inspector is paused.
     16        This is proper because it does not want to count work done for injected scripts
     17        (e.g. from the console) towards the timeline profile of the webpage being run.
     18        However, this is in conflict with ProfileGenerator::exceptionUnwind()'s
     19        expectation that didExecute() will process ProfileNodes in order to do the stack
     20        unwinding for the exception handling. As a result,
     21        ProfileGenerator::exceptionUnwind() hangs.
     22
     23        ProfileGenerator::exceptionUnwind() is in error. While the Inspector is paused,
     24        there will not be any ProfileNodes that it needs to "unwind". Hence, the fix is
     25        simply to return early also in ProfileGenerator::exceptionUnwind() if the
     26        Inspector is paused.
     27
     28        * profiler/ProfileGenerator.cpp:
     29        (JSC::ProfileGenerator::exceptionUnwind):
     30
    1312015-03-02  Filip Pizlo  <fpizlo@apple.com>
    232
  • trunk/Source/JavaScriptCore/profiler/ProfileGenerator.cpp

    r175203 r180907  
    195195void ProfileGenerator::exceptionUnwind(ExecState* handlerCallFrame, const CallIdentifier&)
    196196{
     197    if (m_suspended)
     198        return;
     199
    197200    // If the current node was called by the handler (==) or any
    198201    // more nested function (>) the we have exited early from it.
Note: See TracChangeset for help on using the changeset viewer.