Closed Bug 340019 Opened 16 years ago Closed 16 years ago

[FIX]js assertion "!JS_IsExceptionPending(cx)" when checking feeds

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: Bienvenu, Assigned: bzbarsky)

References

Details

(Keywords: crash, fixed1.8.1)

Attachments

(2 files, 1 obsolete file)

I'm putting this under Thunderbird:RSS though I think whatever we're doing wrong in our js is exposing some underlying problem

For the stack trace, see:
https://bugzilla.mozilla.org/show_bug.cgi?id=339022#c12

The class of the exception object is "Object". In the map, we have the strings "anonymous function does not always return a value" and the chrome path to Feed.js, something like "chrome:/messenger-newsblog/.../Feed.js". I have  javascript.options.strict set to true. The js assertion is probably caused by an  anonymous function that has return e; and falls off the end or has returns.  I'm going to try turning off strict mode, and also fixing whatever methods in feed.js that look like they might be culprits - :parse looks like a likely one
Keywords: crash
Summary: js assertion when checking feeds → js assertion "!JS_IsExceptionPending(cx)" when checking feeds
turning off strict mode fixed the problem - haven't found a fix in the js yet.
Attached patch fix newsblog jsSplinter Review
this cleans up the js so we don't get the warning in strict mode.
Assignee: mscott → bienvenu
Status: NEW → ASSIGNED
Attachment #224130 - Flags: superreview?(sspitzer)
We really want to figure out the underlying problem here, though...  bienvenu, could you set a breakpoint in JS_SetPendingException and try to catch who's actually throwing here?
How do I go about reproducing this?
more than you need, I'm sure - 

>	js3250.dll!JS_SetPendingException(JSContext * cx=0x02111d58, long v=0x03ba5cd8)  Line 4809	C
 	xpc3250.dll!ExceptionalErrorReporter(JSContext * cx=0x02111d58, const char * message=0x04c5b2e8, JSErrorReport * report=0x00129a3c)  Line 116 + 0xe bytes	C++
 	js3250.dll!ReportCompileErrorNumber(JSContext * cx=0x02111d58, void * handle=0x04ce6868, unsigned int flags=0x00000005, unsigned int errorNumber=0x0000009d, JSErrorReport * report=0x00129a3c, int charArgs=0x00000001, char * ap=0x00129a7c)  Line 671 + 0xf bytes	C
 	js3250.dll!js_ReportCompileErrorNumber(JSContext * cx=0x02111d58, void * handle=0x04ce6868, unsigned int flags=0x00000005, unsigned int errorNumber=0x0000009d, ...)  Line 702 + 0x1f bytes	C
 	js3250.dll!ReportBadReturn(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, unsigned int flags=0x00000005, unsigned int errnum=0x0000009d, unsigned int anonerrnum=0x0000009d)  Line 673 + 0x19 bytes	C
 	js3250.dll!Statement(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x00129d4c)  Line 2115 + 0x31 bytes	C
 	js3250.dll!Statements(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x00129d4c)  Line 1105 + 0x11 bytes	C
 	js3250.dll!Statement(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x00129d4c)  Line 2122 + 0x11 bytes	C
 	js3250.dll!Statement(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x00129d4c)  Line 1437 + 0x11 bytes	C
 	js3250.dll!Statements(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x00129d4c)  Line 1105 + 0x11 bytes	C
 	js3250.dll!FunctionBody(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSFunction * fun=0x03b760b8, JSTreeContext * tc=0x00129d4c)  Line 709 + 0x11 bytes	C
 	js3250.dll!FunctionDef(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0, int lambda=0x00000001)  Line 1001 + 0x15 bytes	C
 	js3250.dll!FunctionExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 1081 + 0x13 bytes	C
 	js3250.dll!PrimaryExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0, JSTokenType tt=TOK_FUNCTION, int afterDot=0x00000000)  Line 3875 + 0x11 bytes	C
 	js3250.dll!MemberExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0, int allowCallSyntax=0x00000001)  Line 2989 + 0x17 bytes	C
 	js3250.dll!UnaryExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2907 + 0x13 bytes	C
 	js3250.dll!MulExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2756 + 0x11 bytes	C
 	js3250.dll!AddExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2738 + 0x11 bytes	C
 	js3250.dll!ShiftExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2723 + 0x11 bytes	C
 	js3250.dll!RelExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2698 + 0x11 bytes	C
 	js3250.dll!EqExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2676 + 0x11 bytes	C
 	js3250.dll!BitAndExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2664 + 0x11 bytes	C
 	js3250.dll!BitXorExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2651 + 0x11 bytes	C
 	js3250.dll!BitOrExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2638 + 0x11 bytes	C
 	js3250.dll!AndExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2627 + 0x11 bytes	C
 	js3250.dll!OrExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2616 + 0x11 bytes	C
 	js3250.dll!CondExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2580 + 0x11 bytes	C
 	js3250.dll!AssignExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2518 + 0x11 bytes	C
 	js3250.dll!PrimaryExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0, JSTokenType tt=TOK_COLON, int afterDot=0x00000000)  Line 4227 + 0x15 bytes	C
 	js3250.dll!MemberExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0, int allowCallSyntax=0x00000001)  Line 2989 + 0x17 bytes	C
 	js3250.dll!UnaryExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2907 + 0x13 bytes	C
 	js3250.dll!MulExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2756 + 0x11 bytes	C
 	js3250.dll!AddExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2738 + 0x11 bytes	C
 	js3250.dll!ShiftExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2723 + 0x11 bytes	C
 	js3250.dll!RelExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2698 + 0x11 bytes	C
 	js3250.dll!EqExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2676 + 0x11 bytes	C
 	js3250.dll!BitAndExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2664 + 0x11 bytes	C
 	js3250.dll!BitXorExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2651 + 0x11 bytes	C
 	js3250.dll!BitOrExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2638 + 0x11 bytes	C
 	js3250.dll!AndExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2627 + 0x11 bytes	C
 	js3250.dll!OrExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2616 + 0x11 bytes	C
 	js3250.dll!CondExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2580 + 0x11 bytes	C
 	js3250.dll!AssignExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2518 + 0x11 bytes	C
 	js3250.dll!AssignExpr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2570 + 0x15 bytes	C
 	js3250.dll!Expr(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2490 + 0x11 bytes	C
 	js3250.dll!Statement(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 2182 + 0x11 bytes	C
 	js3250.dll!Statements(JSContext * cx=0x02111d58, JSTokenStream * ts=0x04ce6868, JSTreeContext * tc=0x0012a4c0)  Line 1105 + 0x11 bytes	C
 	js3250.dll!js_CompileTokenStream(JSContext * cx=0x02111d58, JSObject * chain=0x01a6be18, JSTokenStream * ts=0x04ce6868, JSCodeGenerator * cg=0x0012a4c0)  Line 497 + 0x11 bytes	C
 	js3250.dll!CompileTokenStream(JSContext * cx=0x02111d58, JSObject * obj=0x01a6be18, JSTokenStream * ts=0x04ce6868, void * tempMark=0x02111da0, int * eofp=0x00000000)  Line 3759 + 0x18 bytes	C
 	js3250.dll!JS_CompileUCScriptForPrincipals(JSContext * cx=0x02111d58, JSObject * obj=0x01a6be18, JSPrincipals * principals=0x00c6e02c, const unsigned short * chars=0x04e8fff0, unsigned int length=0x00003975, const char * filename=0x04cdc4d0, unsigned int lineno=0x00000001)  Line 3854 + 0x17 bytes	C
 	js3250.dll!JS_EvaluateUCScriptForPrincipals(JSContext * cx=0x02111d58, JSObject * obj=0x01a6be18, JSPrincipals * principals=0x00c6e02c, const unsigned short * chars=0x04e8fff0, unsigned int length=0x00003975, const char * filename=0x04cdc4d0, unsigned int lineno=0x00000001, long * rval=0x0012aba8)  Line 4277 + 0x21 bytes	C
 	js3250.dll!JS_EvaluateScriptForPrincipals(JSContext * cx=0x02111d58, JSObject * obj=0x01a6be18, JSPrincipals * principals=0x00c6e02c, const char * bytes=0x04e26038, unsigned int nbytes=0x00003975, const char * filename=0x04cdc4d0, unsigned int lineno=0x00000001, long * rval=0x0012aba8)  Line 4246 + 0x25 bytes	C
 	xpc3250.dll!mozJSSubScriptLoader::LoadSubScript(const unsigned short * __formal=0x019e5728)  Line 339 + 0x24 bytes	C++
 	xpcom_core.dll!XPTC_InvokeByIndex(nsISupports * that=0x00000003, unsigned int methodIndex=0x00000001, unsigned int paramCount=0x0012a8dc, nsXPTCVariant * params=0x01a6c30c)  Line 102	C++
 	xpc3250.dll!XPCWrappedNative::CallMethod(XPCCallContext & ccx={...}, XPCWrappedNative::CallMode mode=0x00000003)  Line 2146 + 0x1e bytes	C++
 	xpc3250.dll!XPCWrappedNative::CallMethod(XPCCallContext & ccx={...}, XPCWrappedNative::CallMode mode=CALL_METHOD)  Line 2146 + 0x1e bytes	C++
 	xpc3250.dll!XPC_WN_CallMethod(JSContext * cx=0x02111d58, JSObject * obj=0x03ba5e48, unsigned int argc=0x00000001, long * argv=0x04cbf8d0, long * vp=0x0012aba8)  Line 1445 + 0xe bytes	C++
 	js3250.dll!js_Invoke(JSContext * cx=0x02111d58, unsigned int argc=0x00000001, unsigned int flags=0x00000000)  Line 1328 + 0x20 bytes	C
 	js3250.dll!js_Interpret(JSContext * cx=0x02111d58, unsigned char * pc=0x018ee85d, long * result=0x0012b70c)  Line 3982 + 0xf bytes	C
 	js3250.dll!js_Invoke(JSContext * cx=0x02111d58, unsigned int argc=0x00000006, unsigned int flags=0x00000002)  Line 1347 + 0x13 bytes	C
 	xpc3250.dll!nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS * wrapper=0x04cb3e80, unsigned short methodIndex=0x0003, const nsXPTMethodInfo * info=0x04ebab68, nsXPTCMiniVariant * nativeParams=0x0012ba70)  Line 1380 + 0x14 bytes	C++
 	xpc3250.dll!nsXPCWrappedJS::CallMethod(unsigned short methodIndex=0x0003, const nsXPTMethodInfo * info=0x04ebab68, nsXPTCMiniVariant * params=0x0012ba70)  Line 466	C++
 	xpcom_core.dll!PrepareAndDispatch(nsXPTCStubBase * self=0x04cb3e80, unsigned int methodIndex=0x00000003, unsigned int * args=0x0012bb38, unsigned int * stackBytesToPop=0x0012bb28)  Line 117 + 0x1e bytes	C++
 	xpcom_core.dll!SharedStub()  Line 147	C++
 	mail.dll!nsRssIncomingServer::GetNewMail(nsIMsgWindow * aMsgWindow=0x045ae0b0, nsIUrlListener * aUrlListener=0x03e92b80, nsIMsgFolder * aFolder=0x00000000, nsIURI * * _retval=0x03bcc960)  Line 220 + 0x39 bytes	C++
 	mail.dll!nsRssIncomingServer::GetNewMail(nsIMsgWindow * aMsgWindow=0x03d13300, nsIUrlListener * aUrlListener=0x03e92b88, nsIMsgFolder * aFolder=0x03e92b80, nsIURI * * _retval=0x00000000)  Line 220 + 0x39 bytes	C++
 	mail.dll!nsRssIncomingServer::PerformBiff(nsIMsgWindow * aMsgWindow=0x03d13300)  Line 182	C++
 	mail.dll!nsRssIncomingServer::GetNewMail(nsIMsgWindow * aMsgWindow=0x03d13300, nsIUrlListener * aUrlListener=0x00000000, nsIMsgFolder * aFolder=0x021d6a08, nsIURI * * _retval=0x00000000)  Line 196 + 0x1f bytes	C++
 	mail.dll!nsMsgLocalMailFolder::GetNewMessages(nsIMsgWindow * aWindow=0x03d13300, nsIUrlListener * aListener=0x00000000)  Line 2256 + 0x3e bytes	C++
 	mail.dll!nsMsgIncomingServer::GetNewMessages(nsIMsgFolder * aFolder=0x021d6a08, nsIMsgWindow * aMsgWindow=0x03d13300, nsIUrlListener * aUrlListener=0x00000000)  Line 195	C++
 	mail.dll!nsMsgFolderDataSource::DoCommand(nsISupportsArray * aSources=0x04c7a9f0, nsIRDFResource * aCommand=0x03993a08, nsISupportsArray * aArguments=0x04e1d7d0)  Line 852 + 0x39 bytes	C++
 	rdf.dll!CompositeDataSourceImpl::DoCommand(nsISupportsArray * aSources=0x04c7a9f0, nsIRDFResource * aCommand=0x03993a08, nsISupportsArray * aArguments=0x04e1d7d0)  Line 1336 + 0x2c bytes	C++
Insanity -- I never knew of ExceptionalErrorReporter.  It should report warnings promptly, not turn them into Objects with message, filename, and lineNumber props. But why is it needed at all?

/be
So it is a bug to set a pending exception but return true or otherwise return success.  That's exactly what ExceptionalErrorReporter does when given a warning report.  That's the underlying bug to fix here.  But even better would be to get rid of this fake Object-creating exception throwing error reporter altogether. An error reporter should report, period, not (re-)throw.

/be
Assignee: bienvenu → dbradley
Status: ASSIGNED → NEW
Component: RSS → XPConnect
OS: Windows XP → All
Product: Thunderbird → Core
QA Contact: rss → xpconnect
Hardware: PC → All
This bogus error reporter goes back to bug 48974 -- too long ago for me to remember reviewing the code (the checkin comment says i did, but the bug doesn't ;-). Oh well, best to just fix it unless Rob can think of some need for duplicate error-as-exception code.

We need at least the warning fix, but if we can use the JS component loader's reporter for the subscript loader as bz proposed, we should just do that.

/be
Attached patch Does this fix things? (obsolete) — Splinter Review
looks good, and the warnings are showing up on the console correctly
Attachment #224138 - Flags: superreview?(brendan)
Attachment #224138 - Flags: review?(shaver)
Comment on attachment 224138 [details] [diff] [review]
Does this fix things?

Mangle that Reporter name (suggest mozJSLoaderErrorReporter, unless someone has a better idea) now that it's potentially a link-time global.

sr=me with that.

/be
Attachment #224138 - Flags: superreview?(brendan) → superreview+
Assignee: dbradley → bzbarsky
Summary: js assertion "!JS_IsExceptionPending(cx)" when checking feeds → [FIX]js assertion "!JS_IsExceptionPending(cx)" when checking feeds
Comment on attachment 224130 [details] [diff] [review]
fix newsblog js

sr=sspitzer, acting as sr while mscott is away.
Attachment #224130 - Flags: superreview?(sspitzer) → superreview+
warning fix checked in.
For your information: 
The second patch attached by Boris Zbarsky fixes Bug 340881 too.
Blocks: 340881
*** Bug 340881 has been marked as a duplicate of this bug. ***
Comment on attachment 224138 [details] [diff] [review]
Does this fix things?

I agree with brendan on the renaming.

r=mrbkap
Attachment #224138 - Flags: review?(shaver) → review+
Attachment #224138 - Attachment is obsolete: true
Checked in.

I assume we don't need this on branches, right?
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9alpha
We will when the generator stuff lands. If you want to land it now, it'll probably ease jminta and my merging pain when we backport it.
Blocks: js1.7
Probably good to get it on the branch (just 1.8, I assume, not branches as far as I can tell) for more thorough error reporting as well -- that's an important platform issue.
Attachment #225102 - Flags: approval-branch-1.8.1?(brendan)
Attachment #225102 - Flags: approval-branch-1.8.1?(brendan) → approval1.8.1?
Comment on attachment 225102 [details] [diff] [review]
Updated to comments

a=darin on behalf of drivers (please land this on the MOZILLA_1_8_BRANCH and add the fixed1.8.1 keyword to this bug)
Attachment #225102 - Flags: approval1.8.1? → approval1.8.1+
Fixed on 1.8 branch.
Keywords: fixed1.8.1
*** Bug 340893 has been marked as a duplicate of this bug. ***
No longer blocks: 340893
You need to log in before you can comment on or make changes to this bug.