Closed Bug 349023 Opened 20 years ago Closed 20 years ago

Bogus JSCLASS_IS_EXTENDED in the generator class

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla1.8.1beta2

People

(Reporter: JasnaPaka, Assigned: igor)

References

()

Details

(Keywords: crash, verified1.8.1)

Attachments

(3 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060817 BonEcho/2.0b1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060817 BonEcho/2.0b1 1. Visit URL (see above). 2. Firefox crashes. TB22194801G Reproducible: Always Same problem with latest Firefox Trunk.
Source: <script type="text/javascript" language="JavaScript"> function test() { var i = 0; yield i; } var g = test(); for (var i = 0; i < 10; i++) { document.write(g.next() + "<BR>\n"); } </script>
Flags: blocking1.8.1?
Keywords: crash
Incident ID: 22194801 Stack Signature iterator_self 2930a74a Product ID Firefox2 Build ID 2006081703 Trigger Time 2006-08-17 09:21:46.0 Platform Win32 Operating System Windows NT 5.1 build 2600 Module js3250.dll + (0002aaeb) URL visited User Comments Since Last Crash 11738 sec Total Uptime 11738 sec Trigger Reason Access violation Source File, Line No. .../mozilla/js/src/jsiter.c, line 278 Stack Trace iterator_self [.../mozilla/js/src/jsiter.c, line 278] nsXPConnect::GetWrappedNativeOfJSObject [.../mozilla/js/src/xpconnect/src/nsXPConnect.cpp, line 677] nsWindowSH::GetProperty [.../mozilla/dom/src/base/nsDOMClassInfo.cpp, line 4194] XPC_WN_Helper_GetProperty [.../mozilla/js/src/xpconnect/src/xpcwrappednativejsops.cpp, line 947] js_Interpret [.../mozilla/js/src/jsinterp.c, line 4178] js_Execute [.../mozilla/js/src/jsinterp.c, line 1600] JS_EvaluateUCScriptForPrincipals [.../mozilla/js/src/jsapi.c, line 4365] nsJSContext::EvaluateString [.../mozilla/dom/src/base/nsJSEnvironment.cpp, line 1098] nsScriptLoader::EvaluateScript [.../mozilla/content/base/src/nsScriptLoader.cpp, line 775] nsScriptLoader::ProcessRequest [.../mozilla/content/base/src/nsScriptLoader.cpp, line 673] nsScriptLoader::DoProcessScriptElement [.../mozilla/content/base/src/nsScriptLoader.cpp, line 606] nsScriptLoader::ProcessScriptElement [.../mozilla/content/base/src/nsScriptLoader.cpp, line 358] nsHTMLScriptElement::MaybeProcessScript [.../mozilla/content/html/content/src/nsHTMLScriptElement.cpp, line 663] nsHTMLScriptElement::BindToTree [.../mozilla/content/html/content/src/nsHTMLScriptElement.cpp, line 456] nsGenericElement::AppendChildTo [.../mozilla/content/base/src/nsGenericElement.cpp, line 2868] HTMLContentSink::ProcessSCRIPTTag [.../mozilla/content/html/document/src/nsHTMLContentSink.cpp, line 4174] HTMLContentSink::AddLeaf [.../mozilla/content/html/document/src/nsHTMLContentSink.cpp, line 3040] HTMLContentSink::AddHeadContent [.../mozilla/content/html/document/src/nsHTMLContentSink.cpp, line 2991] CNavDTD::AddHeadLeaf [.../mozilla/parser/htmlparser/src/CNavDTD.cpp, line 3613] CNavDTD::HandleToken [.../mozilla/parser/htmlparser/src/CNavDTD.cpp, line 955] CNavDTD::BuildModel [.../mozilla/parser/htmlparser/src/CNavDTD.cpp, line 458] nsParser::BuildModel [.../mozilla/parser/htmlparser/src/nsParser.cpp, line 2145]
Severity: normal → critical
The stack makes no sense: iterator_self [.../mozilla/js/src/jsiter.c, line 278] nsXPConnect::GetWrappedNativeOfJSObject There's no direct or indirect call that can connect those two frames. Even if intervening frames were optimized away. Anyway, the test URL works for me on trunk now, and the 1.8 branch files to-do with iterators and generators are in sync. If someone can find the bug that fixed this, mark it a dup. I'm marking WFM. /be
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → WORKSFORME
Whiteboard: DUPEME
clearing blocking flag
Flags: blocking1.8.1?
(In reply to comment #3) > The stack makes no sense: > > iterator_self [.../mozilla/js/src/jsiter.c, line 278] > nsXPConnect::GetWrappedNativeOfJSObject The calling line in nsXPConnect::GetWrappedNativeOfJSObject is NS_ADDREF(wrapper), a virtual call, so if wrapper is a deleted object, then this does make sense. I think that this might be worth keeping open to investigate how nsXPConnect::GetWrappedNativeOfJSObject can return a dead wrapper.
Status: RESOLVED → UNCONFIRMED
Component: JavaScript Engine → XPConnect
Resolution: WORKSFORME → ---
Assignee: general → dbradley
QA Contact: general → xpconnect
Attached file TB22207950G —
I actually crash in JS_GetClass using trunk SeaMonkey 2006-08-17-08; oddly enough, I don't crash in today's trunk Minefield build, it just displays a "0."
With today FF Branch: TB22233844M
*** Bug 349281 has been marked as a duplicate of this bug. ***
Attached file Jesse's testcase —
Stack trace with a few-days-old build: http://pastebin.mozilla.org/82 Stack trace with a few-minutes-old build: http://pastebin.mozilla.org/83
Here is a trivial example for JS shell that crashes immediately: gen = (function() { yield 3; })(); var x = (gen ==gen); When changing generators back to use JSClass in bug 346450 I forgot to remove JSCLASS_IS_EXTENDED :(
Assignee: dbradley → igor.bukanov
Status: UNCONFIRMED → NEW
Component: XPConnect → JavaScript Engine
Ever confirmed: true
QA Contact: xpconnect → general
Attached patch Fix — — Splinter Review
Attachment #234560 - Flags: review?(brendan)
Attachment #234560 - Flags: approval1.8.1?
This could go in for beta 2. /be
Flags: blocking1.8.1?
Whiteboard: DUPEME
Comment on attachment 234560 [details] [diff] [review] Fix How'd I miss that? Sigh. /be
Attachment #234560 - Flags: review?(brendan) → review+
I committed the patch from comment 12.
Status: NEW → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → FIXED
Summary: Firefox crashes if I use Js 1.7 iterator [@ iterator_self] → Bogus JSCLASS_IS_EXTENDED in the generator class
*** Bug 349346 has been marked as a duplicate of this bug. ***
Flags: blocking1.8.1? → blocking1.8.1+
Target Milestone: --- → mozilla1.8.1beta2
Comment on attachment 234560 [details] [diff] [review] Fix a=beltzner on behalf of drivers, mrbkap to land through the haze of some jager ...
Attachment #234560 - Flags: approval1.8.1? → approval1.8.1+
I've just landed the fix to the 1.8 branch
Keywords: fixed1.8.1
RCS file: /cvsroot/mozilla/js/tests/js1_7/geniter/regress-349023-01.js,v done Checking in regress-349023-01.js; /cvsroot/mozilla/js/tests/js1_7/geniter/regress-349023-01.js,v <-- regress-349023-01.js initial revision: 1.1 done RCS file: /cvsroot/mozilla/js/tests/js1_7/geniter/regress-349023-02.js,v done Checking in regress-349023-02.js; /cvsroot/mozilla/js/tests/js1_7/geniter/regress-349023-02.js,v <-- regress-349023-02.js initial revision: 1.1 done RCS file: /cvsroot/mozilla/js/tests/js1_7/geniter/regress-349023-03.js,v done Checking in regress-349023-03.js; /cvsroot/mozilla/js/tests/js1_7/geniter/regress-349023-03.js,v <-- regress-349023-03.js initial revision: 1.1 done
Flags: in-testsuite+
verified fixed 1.8, 1.9 20060821 windows/mac*/linux
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: