Closed Bug 606665 Opened 15 years ago Closed 14 years ago

crash [@ js::Compiler::defineGlobals(JSContext*, js::GlobalScope&, JSScript*) ][@ js::Compiler::defineGlobals ][@ js::Bindings::lastShape()]

Categories

(Core :: JavaScript Engine, defect)

x86
All
defect
Not set
critical

Tracking

()

RESOLVED DUPLICATE of bug 660638
Tracking Status
firefox5 - ---
firefox6 - ---
firefox7 - ---

People

(Reporter: scoobidiver, Assigned: billm)

References

()

Details

(4 keywords)

Crash Data

Attachments

(2 files)

It is a residual crash signature that exists in trunk builds for at least one month. It is #201 top crasher in 4.0b8pre for the last week. Signature js::Compiler::defineGlobals(JSContext*, js::GlobalScope&, JSScript*) UUID d60fbdb0-dd65-416f-89bb-a31f82101022 Time 2010-10-22 21:43:05.550123 Uptime 122 Last Crash 85230 seconds (23.7 hours) before submission Install Age 6076 seconds (1.7 hours) since version was first installed. Product Firefox Version 4.0b8pre Build ID 20101022043027 Branch 2.0 OS Windows NT OS Version 6.1.7600 CPU x86 CPU Info GenuineIntel family 6 model 15 stepping 13 Crash Reason EXCEPTION_ACCESS_VIOLATION_READ Crash Address 0x4 App Notes AdapterVendorID: 10de, AdapterDeviceID: 01d3 Frame Module Signature [Expand] Source 0 mozjs.dll js::Compiler::defineGlobals js/src/jsparse.cpp:1079 1 mozjs.dll js::Compiler::compileScript js/src/jsparse.cpp:995 2 mozjs.dll JS_EvaluateUCScriptForPrincipals js/src/jsapi.cpp:4876 3 mozjs.dll JS_EvaluateUCScriptForPrincipalsVersion js/src/jsapi.cpp:4857 4 xul.dll nsJSContext::EvaluateString dom/base/nsJSEnvironment.cpp:1724 More reports at: http://crash-stats.mozilla.com/report/list?product=Firefox&query_search=signature&query_type=exact&query=&range_value=4&range_unit=weeks&hang_type=any&process_type=any&plugin_field=&plugin_query_type=&plugin_query=&do_query=1&admin=&signature=js%3A%3ACompiler%3A%3AdefineGlobals%28JSContext*%2C%20js%3A%3AGlobalScope%26%2C%20JSScript*%29
1. http://www.takdin.co.il/search/index.aspx?formName=psika#1 2. crash bp-6eb1264d-5061-494c-bae2-ce1072110210 0 XUL js::Compiler::defineGlobals js/src/jsparse.cpp:1216 1 XUL js::Compiler::compileScript js/src/jsparse.cpp:1138 2 XUL EvaluateUCScriptForPrincipalsCommon js/src/jsapi.cpp:4928 3 XUL JS_EvaluateUCScriptForPrincipalsVersion js/src/jsapi.cpp:4950 4 XUL nsJSContext::EvaluateString dom/base/nsJSEnvironment.cpp:1554 5 XUL nsScriptLoader::EvaluateScript content/base/src/nsScriptLoader.cpp:906 crashes opt/debug mac/linux at least.
Attached file testcase
test with array constructor and 65535 arguments. Add one more and it throws constructor has too many arguments.
Adding the other sig so it gets picked up in crash stats.
Summary: crash [@ js::Compiler::defineGlobals(JSContext*, js::GlobalScope&, JSScript*) ] → crash [@ js::Compiler::defineGlobals(JSContext*, js::GlobalScope&, JSScript*) ][@ js::Compiler::defineGlobals ]
Problem seems to manifest itself on the testcase when the number of arguments is greater than 65529. Problematic line seems to be js/src/jsscript.cpp:1434 - if (script->nfixed + cg->maxStackDepth >= JS_BIT(16)) { ReportCompileErrorNumber(....); goto bad; } maxStackDepth seems to be (6+#arguments), and so even if the number of arguments is smaller than 64k, SpiderMonkey crashes. By the way, does anybody know why the stack depth is limited to 64k? performance issues? also, what should be the solution? breaking-up the parsing tree ?
I have only seen this on http://www.takdin.co.il/ in automation but it practically excludes Firefox from the site. If it is a simple fix, can we think about fixing this soon?
We minused this because it's really not a candidate for this group to track. It's really up to the JS team to look at this and prioritize it and submit for approval when a patch is ready. I added dmandelin to the bug.
nightlies have begun to show a slightly different signature for this crash: js::Bindings::lastShape() js::Compiler::compileScript(JSContext*, JSObject*, js::StackFrame*, JSPrincipals*, unsigned int, unsigned short const*, unsigned int, char const*, unsigned int, JSVersion, JSString*, unsigned int) EvaluateUCScriptForPrincipalsCommon(JSContext*, JSObject*, JSPrincipals*, unsigned short const*, unsigned int, char const*, unsigned int, jsval_layout*, JSVersion) JS_EvaluateUCScriptForPrincipalsVersion nsJSContext::EvaluateString(nsAString_internal const&, void*, nsIPrincipal*, char const*, unsigned int, unsigned int, nsAString_internal*, int*)
Summary: crash [@ js::Compiler::defineGlobals(JSContext*, js::GlobalScope&, JSScript*) ][@ js::Compiler::defineGlobals ] → crash [@ js::Compiler::defineGlobals(JSContext*, js::GlobalScope&, JSScript*) ][@ js::Compiler::defineGlobals ][@ js::Bindings::lastShape()]
Attached patch patchSplinter Review
This fixes the crash. NewScriptFromCG was returning NULL after reporting a script too big error. The problem is that compileScript didn't correctly check the return value for NULL (which is sort of weird--I hope I'm not missing something). This could also have been causing us to crash on OOM.
Assignee: general → wmccloskey
Status: NEW → ASSIGNED
Attachment #537825 - Flags: review?(jwalden+bmo)
Bill's patch looks like what I pushed yesterday for bug 660670. Dup?
(In reply to comment #9) > Bill's patch looks like what I pushed yesterday for bug 660670. Dup? Um, bug 660638.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Attachment #537825 - Flags: review?(jwalden+bmo)
Crash Signature: [@ js::Compiler::defineGlobals(JSContext*, js::GlobalScope&, JSScript*) ] [@ js::Compiler::defineGlobals ] [@ js::Bindings::lastShape()]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: