Title: [187831] releases/WebKitGTK/webkit-2.8
Revision
187831
Author
[email protected]
Date
2015-08-04 02:40:08 -0700 (Tue, 04 Aug 2015)

Log Message

Merge r186606 - REGRESSION (r180248): Repro Crash: com.apple.WebKit.WebContent at com.apple._javascript_Core: JSC::createRangeError + 20
https://bugs.webkit.org/show_bug.cgi?id=146767

Reviewed by Geoffrey Garen.

Source/_javascript_Core:

If the stack check fails at the top most frame, we must use that frame to
generate the exception.  Reverted the code to always use the current frame to
throw an out of stack exception.

* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):

LayoutTests:

New test that generates a call to a function that involves creating a huge
object literal that exceeds the available stack space.

* http/tests/misc/large-js-program-expected.txt: Added.
* http/tests/misc/large-js-program.php: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog (187830 => 187831)


--- releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog	2015-08-04 09:33:08 UTC (rev 187830)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog	2015-08-04 09:40:08 UTC (rev 187831)
@@ -1,3 +1,16 @@
+2015-07-09  Michael Saboff  <[email protected]>
+
+        REGRESSION (r180248): Repro Crash: com.apple.WebKit.WebContent at com.apple._javascript_Core: JSC::createRangeError + 20
+        https://bugs.webkit.org/show_bug.cgi?id=146767
+
+        Reviewed by Geoffrey Garen.
+
+        New test that generates a call to a function that involves creating a huge
+        object literal that exceeds the available stack space.
+
+        * http/tests/misc/large-js-program-expected.txt: Added.
+        * http/tests/misc/large-js-program.php: Added.
+
 2015-07-08  Said Abou-Hallawa  <[email protected]>
 
         Crash when appending an SVG <use> element dynamically which has animated SVG <path> element

Added: releases/WebKitGTK/webkit-2.8/LayoutTests/http/tests/misc/large-js-program-expected.txt (0 => 187831)


--- releases/WebKitGTK/webkit-2.8/LayoutTests/http/tests/misc/large-js-program-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/http/tests/misc/large-js-program-expected.txt	2015-08-04 09:40:08 UTC (rev 187831)
@@ -0,0 +1,5 @@
+CONSOLE MESSAGE: line 27: RangeError: Maximum call stack size exceeded.
+This tests verifies that a large program doesn't crash _javascript_.
+
+This test should generate an out of stack exception, but have no other output. 
+

Added: releases/WebKitGTK/webkit-2.8/LayoutTests/http/tests/misc/large-js-program.php (0 => 187831)


--- releases/WebKitGTK/webkit-2.8/LayoutTests/http/tests/misc/large-js-program.php	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/http/tests/misc/large-js-program.php	2015-08-04 09:40:08 UTC (rev 187831)
@@ -0,0 +1,39 @@
+<html>
+<head>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+</head>
+<body>
+<h1>This tests verifies that a large program doesn&#39;t crash _javascript_.</h1>
+<p>This test should generate an out of stack exception, but have no other output.
+<br>
+<pre id="console"></pre>
+<script src=""
+<script>
+function print(m)
+{
+    document.getElementById("console").innerHTML += m + "<br>";
+}
+
+function foo(o)
+{
+    // We should not get to this code, we should throw an out of stack exception calling foo().
+    testFailed("We should never get here!");
+}
+
+
+foo({"x": 1,
+     "a": [
+<?php
+for ($i = 0; $i < 1000000; $i++) {
+    if ($i != 0)
+        echo ",\n";
+    echo "[0, $i]";
+}
+?>
+]});
+</script>
+</body>
+</html>

Modified: releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/ChangeLog (187830 => 187831)


--- releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/ChangeLog	2015-08-04 09:33:08 UTC (rev 187830)
+++ releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/ChangeLog	2015-08-04 09:40:08 UTC (rev 187831)
@@ -1,3 +1,17 @@
+2015-07-09  Michael Saboff  <[email protected]>
+
+        REGRESSION (r180248): Repro Crash: com.apple.WebKit.WebContent at com.apple._javascript_Core: JSC::createRangeError + 20
+        https://bugs.webkit.org/show_bug.cgi?id=146767
+
+        Reviewed by Geoffrey Garen.
+
+        If the stack check fails at the top most frame, we must use that frame to
+        generate the exception.  Reverted the code to always use the current frame to
+        throw an out of stack exception.
+
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+
 2015-05-01  Basile Clement  <[email protected]>
 
         Math.abs() returns negative

Modified: releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/llint/LLIntSlowPaths.cpp (187830 => 187831)


--- releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/llint/LLIntSlowPaths.cpp	2015-08-04 09:33:08 UTC (rev 187830)
+++ releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/llint/LLIntSlowPaths.cpp	2015-08-04 09:40:08 UTC (rev 187831)
@@ -469,14 +469,6 @@
 #endif
 
 #endif
-    // This stack check is done in the prologue for a function call, and the
-    // CallFrame is not completely set up yet. For example, if the frame needs
-    // a lexical environment object, the lexical environment object will only be
-    // set up after we start executing the function. If we need to throw a
-    // StackOverflowError here, then we need to tell the prologue to start the
-    // stack unwinding from the caller frame (which is fully set up) instead.
-    // To do that, we return the caller's CallFrame in the second return value.
-    //
     // If the stack check succeeds and we don't need to throw the error, then
     // we'll return 0 instead. The prologue will check for a non-zero value
     // when determining whether to set the callFrame or not.
@@ -490,7 +482,6 @@
         LLINT_RETURN_TWO(pc, 0);
 #endif
 
-    exec = exec->callerFrame(vm.topVMEntryFrame);
     vm.topCallFrame = exec;
     ErrorHandlingScope errorScope(vm);
     CommonSlowPaths::interpreterThrowInCaller(exec, createStackOverflowError(exec));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to