Bug 19956

Summary: Strange relation between script loading and call stack size
Product: WebKit Reporter: Fabian Jakobs <fabian.jakobs>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ddkilzer, ggaren, info, zwarich
Priority: P2 Keywords: HasReduction, InRadar
Version: 525.x (Safari 3.1)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Testcase
none
JavaScript file needed for the test none

Description Fabian Jakobs 2008-07-09 07:20:18 PDT
I have a very strange problem with Safari 3.1.2 and WebKit nightly. We
use a loader script, which inserts script tags dynamically into the
header. Now I observe the strange behavior that doing so seems to limit
the available call stack size. We load many scripts (> 300) in a loop
this way and run into an call stack size exceeded error.

I have reduced the problem to the attached HTML, where you can see the
effect. Still I have problems interpreting the results. Safari 3.1.2
shows me a decrease of the available call stack size, while it does not
really work in the Nightly. What is happening inside of Safari there?
Comment 1 Fabian Jakobs 2008-07-09 07:21:01 PDT
Created attachment 22172 [details]
Testcase
Comment 2 Fabian Jakobs 2008-07-09 07:21:53 PDT
Created attachment 22173 [details]
JavaScript file needed for the test
Comment 3 Sebastian Werner 2008-07-09 10:03:21 PDT
Just tested your example. It starts with 498 here and ends with 308. Goes down with four in each iteration.

MacBook 2Ghz, 2GB
Mac OS X 10.5.4
Safari 3.1.2
Comment 4 Sebastian Werner 2008-07-09 10:11:49 PDT
Webkit rev 35067 dies with a stack overflow after the insertion of the second(!) script.

Firefox 3 reports 2998 on every message. No decreasing detectable.
Comment 5 David Kilzer (:ddkilzer) 2008-07-10 06:25:04 PDT
<rdar://problem/6066033>