Closed Bug 294414 Opened 20 years ago Closed 7 years ago

###!!! ASSERTION: This is not supposed to fail!: 'Error', file r:/mozilla/js/src/xpconnect/src/nsXPConnect.cpp, line 413

Categories

(Core :: XPConnect, defect)

x86
Windows XP
defect
Not set
trivial

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: timeless, Unassigned)

Details

(Keywords: assertion, helpwanted)

Attachments

(1 file)

steps:
JS_RUNTIME_SIZE=15
run winembed
visit http://www.slashdot.org

JavaScript error: chrome://global/content/bindings/scrollbar.xml, line 38:
JavaScript error: chrome://global/content/bindings/scrollbar.xml, line 38:
JavaScript error: chrome://global/content/bindings/scrollbar.xml, line 38:
JavaScript error: chrome://global/content/bindings/scrollbar.xml, line 38:
WARNING: Global is not an nsISupports., file
r:/mozilla/dom/src/base/nsJSEnvironment.cpp, line 1476
JavaScript error: , line 0:
###!!! ASSERTION: This is not supposed to fail!: 'Error', file
r:/mozilla/js/src/xpconnect/src/nsXPConnect.cpp, line 413
Break: at file r:/mozilla/js/src/xpconnect/src/nsXPConnect.cpp, line 413

	rv:	NS_ERROR_FAILURE
    NS_ERROR("This is not supposed to fail!");

 	xpcom_core.dll!nsDebug::Assertion(const char * aStr=0x00ba71d4, const char *
aExpr=0x00ba71f8, const char * aFile=0x00ba7200, int aLine=0x0000019d)  Line 109	C++
>	xpc3250.dll!UnexpectedFailure(unsigned int rv=0x80004005)  Line 413 + 0x1a	C++
 	xpc3250.dll!nsXPConnect::InitClassesWithNewWrappedGlobal(JSContext *
aJSContext=0x0323e200, nsISupports * aCOMObj=0x0323e068, const nsID &
aIID={...}, int aCallJS_InitStandardClasses=0x00000000,
nsIXPConnectJSObjectHolder * * _retval=0x0012d6b4)  Line 499 + 0xa	C++
 	gklayout.dll!nsJSContext::InitContext(nsIScriptGlobalObject *
aGlobalObject=0x0323e068)  Line 1556 + 0x37	C++
 	gklayout.dll!NS_CreateScriptContext(nsIScriptGlobalObject *
aGlobal=0x0323e068, nsIScriptContext * * aContext=0x0012d738)  Line 2218 + 0x1a	C++
 	gklayout.dll!nsDOMScriptObjectFactory::NewScriptContext(nsIScriptGlobalObject
* aGlobal=0x0323e068, nsIScriptContext * * aContext=0x0012d738)  Line 103 + 0xd	C++
 	docshell.dll!nsDocShell::EnsureScriptEnvironment()  Line 7003 + 0x3e	C++
 	docshell.dll!nsDocShell::GetInterface(const nsID & aIID={...}, void * *
aSink=0x0012d824)  Line 383 + 0x46	C++
 	docshell.dll!nsWebShell::GetInterface(const nsID & aIID={...}, void * *
aInstancePtr=0x0012d824)  Line 257	C++
 	xpcom_core.dll!nsGetInterface::operator()(const nsID & aIID={...}, void * *
aInstancePtr=0x0012d824)  Line 53 + 0x1f	C++
 	gklayout.dll!nsCOMPtr<nsPIDOMWindow>::assign_from_helper(const nsCOMPtr_helper
& helper={...}, const nsID & aIID={...})  Line 1292 + 0x12	C++
 	gklayout.dll!nsCOMPtr<nsPIDOMWindow>::nsCOMPtr<nsPIDOMWindow>(const
nsCOMPtr_helper & helper={...})  Line 695	C++
 	gklayout.dll!nsFrameLoader::EnsureDocShell()  Line 370	C++
 	gklayout.dll!nsFrameLoader::LoadFrame()  Line 94 + 0x8	C++
 	gklayout.dll!nsGenericHTMLFrameElement::LoadSrc()  Line 3457 + 0x1a	C++
 	gklayout.dll!nsGenericHTMLFrameElement::BindToTree(nsIDocument *
aDocument=0x017b4548, nsIContent * aParent=0x030e3588, nsIContent *
aBindingParent=0x00000000, int aCompileEventHandlers=0x00000001)  Line 3483	C++
 	gklayout.dll!nsGenericElement::AppendChildTo(nsIContent * aKid=0x030e4708, int
aNotify=0x00000000)  Line 2704 + 0x17	C++
 	gklayout.dll!SinkContext::OpenContainer(const nsIParserNode & aNode={...}) 
Line 1278	C++
 	gklayout.dll!HTMLContentSink::OpenContainer(const nsIParserNode & aNode={...})
 Line 2956 + 0x12	C++
 	gkparser.dll!CNavDTD::OpenContainer(const nsCParserNode * aNode=0x030e2e98,
nsHTMLTag aTag=eHTMLTag_iframe, int aClosedByStartTag=0x00000001, nsEntryStack *
aStyleStack=0x00000000)  Line 3337 + 0x1f	C++
 	gkparser.dll!CNavDTD::HandleDefaultStartToken(CToken * aToken=0x030c6d50,
nsHTMLTag aChildTag=eHTMLTag_iframe, nsCParserNode * aNode=0x030e2e98)  Line
1332 + 0x14	C++
 	gkparser.dll!CNavDTD::HandleStartToken(CToken * aToken=0x030c6d50)  Line
1711 + 0x14	C++
 	gkparser.dll!CNavDTD::HandleToken(CToken * aToken=0x030c6d50, nsIParser *
aParser=0x03052828)  Line 954 + 0xc	C++
 	gkparser.dll!CNavDTD::BuildModel(nsIParser * aParser=0x03052828, nsITokenizer
* aTokenizer=0x030e43a8, nsITokenObserver * anObserver=0x00000000,
nsIContentSink * aSink=0x031290d8)  Line 461 + 0x14	C++
 	gkparser.dll!nsParser::BuildModel()  Line 2075 + 0x22	C++
 	gkparser.dll!nsParser::ResumeParse(int allowIteration=0x00000000, int
aIsFinalChunk=0x00000000, int aCanInterrupt=0x00000000)  Line 1942 + 0xc	C++
 	gkparser.dll!nsParser::Parse(const nsAString & aSourceBuffer={...}, void *
aKey=0x00000001, const nsACString & aMimeType={...}, int
aVerifyEnabled=0x00000000, int aLastCall=0x00000001, nsDTDMode
aMode=eDTDMode_autodetect)  Line 1782 + 0x11	C++
 	gklayout.dll!nsHTMLDocument::WriteCommon(const nsAString & aText={...}, int
aNewlineTerminate=0x00000000)  Line 2199 + 0x8d	C++
 	gklayout.dll!nsHTMLDocument::ScriptWriteCommon(int
aNewlineTerminate=0x00000000)  Line 2283 + 0x16	C++
 	gklayout.dll!nsHTMLDocument::Write()  Line 2312	C++
 	xpcom_core.dll!XPTC_InvokeByIndex(nsISupports * that=0x017b4710, unsigned int
methodIndex=0x00000014, unsigned int paramCount=0x00000000, nsXPTCVariant *
params=0x0012e1f4)  Line 102	C++
 	xpc3250.dll!XPCWrappedNative::CallMethod(XPCCallContext & ccx={...},
XPCWrappedNative::CallMode mode=CALL_METHOD)  Line 2068 + 0x1e	C++
 	xpc3250.dll!XPC_WN_CallMethod(JSContext * cx=0x015ffa68, JSObject *
obj=0x01612830, unsigned int argc=0x00000001, long * argv=0x0323c04c, long *
vp=0x0012e4c8)  Line 1311 + 0xb	C++
 	js3250.dll!js_Invoke(JSContext * cx=0x015ffa68, unsigned int argc=0x00000001,
unsigned int flags=0x00000000)  Line 1320 + 0x20	C
 	js3250.dll!js_Interpret(JSContext * cx=0x015ffa68, unsigned char *
pc=0x030e57ca, long * result=0x0012eedc)  Line 3614 + 0xf	C
 	js3250.dll!js_Execute(JSContext * cx=0x015ffa68, JSObject * chain=0x01611740,
JSScript * script=0x030e5790, JSStackFrame * down=0x00000000, unsigned int
flags=0x00000000, long * result=0x0012efe4)  Line 1550 + 0x13	C
 	js3250.dll!JS_EvaluateUCScriptForPrincipals(JSContext * cx=0x015ffa68,
JSObject * obj=0x01611740, JSPrincipals * principals=0x0312924c, const unsigned
short * chars=0x030e3d10, unsigned int length=0x0000012e, const char *
filename=0x03130a70, unsigned int lineno=0x00000479, long * rval=0x0012efe4) 
Line 3813 + 0x19	C
 	gklayout.dll!nsJSContext::EvaluateString(const nsAString & aScript={...}, void
* aScopeObject=0x01611740, nsIPrincipal * aPrincipal=0x03129248, const char *
aURL=0x03130a70, unsigned int aLineNo=0x00000479, const char *
aVersion=0x00cb5854, nsAString * aRetValue=0x00000000, int *
aIsUndefined=0x0012f0b4)  Line 1038 + 0x43	C++
 	gklayout.dll!nsScriptLoader::EvaluateScript(nsScriptLoadRequest *
aRequest=0x030e3ca8, const nsString & aScript={...})  Line 723	C++
 	gklayout.dll!nsScriptLoader::ProcessRequest(nsScriptLoadRequest *
aRequest=0x030e3ca8)  Line 629 + 0x13	C++
 	gklayout.dll!nsScriptLoader::ProcessScriptElement(nsIScriptElement *
aElement=0x030e372c, nsIScriptLoaderObserver * aObserver=0x030e3728)  Line 575
+ 0x14	C++
 	gklayout.dll!nsHTMLScriptElement::MaybeProcessScript()  Line 657 + 0x76	C++
 	gklayout.dll!nsHTMLScriptElement::BindToTree(nsIDocument *
aDocument=0x017b4548, nsIContent * aParent=0x030e3588, nsIContent *
aBindingParent=0x00000000, int aCompileEventHandlers=0x00000001)  Line 455	C++
 	gklayout.dll!nsGenericElement::AppendChildTo(nsIContent * aKid=0x030e3708, int
aNotify=0x00000000)  Line 2704 + 0x17	C++
 	gklayout.dll!HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode &
aNode={...})  Line 4173	C++
 	gklayout.dll!HTMLContentSink::AddLeaf(const nsIParserNode & aNode={...})  Line
3053 + 0xf	C++
 	gkparser.dll!CNavDTD::AddLeaf(const nsIParserNode * aNode=0x030e2e48)  Line
3647 + 0x19	C++
 	gkparser.dll!CNavDTD::HandleScriptToken(const nsIParserNode *
aNode=0x030e2e48)  Line 2209 + 0xc	C++
 	gkparser.dll!CNavDTD::OpenContainer(const nsCParserNode * aNode=0x030e2e48,
nsHTMLTag aTag=eHTMLTag_script, int aClosedByStartTag=0x00000001, nsEntryStack *
aStyleStack=0x00000000)  Line 3299 + 0xc	C++
 	gkparser.dll!CNavDTD::HandleDefaultStartToken(CToken * aToken=0x030c6de0,
nsHTMLTag aChildTag=eHTMLTag_script, nsCParserNode * aNode=0x030e2e48)  Line
1332 + 0x14	C++
 	gkparser.dll!CNavDTD::HandleStartToken(CToken * aToken=0x030c6de0)  Line
1711 + 0x14	C++
 	gkparser.dll!CNavDTD::HandleToken(CToken * aToken=0x00000000, nsIParser *
aParser=0x03052828)  Line 954 + 0xc	C++
 	gkparser.dll!CNavDTD::BuildModel(nsIParser * aParser=0x03052828, nsITokenizer
* aTokenizer=0x03145cd8, nsITokenObserver * anObserver=0x00000000,
nsIContentSink * aSink=0x031290d8)  Line 461 + 0x14	C++
 	gkparser.dll!nsParser::BuildModel()  Line 2075 + 0x22	C++
 	gkparser.dll!nsParser::ResumeParse(int allowIteration=0x00000001, int
aIsFinalChunk=0x00000000, int aCanInterrupt=0x00000001)  Line 1942 + 0xc	C++
 	gkparser.dll!nsParser::OnDataAvailable(nsIRequest * request=0x0319d5b8,
nsISupports * aContext=0x00000000, nsIInputStream * pIStream=0x03132f10,
unsigned int sourceOffset=0x000005ae, unsigned int aLength=0x00003ca3)  Line
2622 + 0x15	C++
 	docshell.dll!nsDocumentOpenInfo::OnDataAvailable(nsIRequest *
request=0x0319d5b8, nsISupports * aCtxt=0x00000000, nsIInputStream *
inStr=0x03132f10, unsigned int sourceOffset=0x000005ae, unsigned int
count=0x00003ca3)  Line 349 + 0x2e	C++
 	necko.dll!nsHTTPCompressConv::do_OnDataAvailable(nsIRequest *
request=0x0319d5b8, nsISupports * aContext=0x00000000, unsigned int
aSourceOffset=0x000005ae, char * buffer=0x031e5628, unsigned int
aCount=0x00003ca3)  Line 390 + 0x2b	C++
 	necko.dll!nsHTTPCompressConv::OnDataAvailable(nsIRequest * request=0x0319d5b8,
nsISupports * aContext=0x00000000, nsIInputStream * iStr=0x03045388, unsigned
int aSourceOffset=0x000005ae, unsigned int aCount=0x000035ba)  Line 326 + 0x1f	C++
 	necko.dll!nsStreamListenerTee::OnDataAvailable(nsIRequest *
request=0x0319d5b8, nsISupports * context=0x00000000, nsIInputStream *
input=0x03193988, unsigned int offset=0x000005ae, unsigned int count=0x000035ba)
 Line 97 + 0x33	C++
 	necko.dll!nsHttpChannel::OnDataAvailable(nsIRequest * request=0x00b21388,
nsISupports * ctxt=0x00000000, nsIInputStream * input=0x03193988, unsigned int
offset=0x000005ae, unsigned int count=0x000035ba)  Line 3917 + 0x5b	C++
 	necko.dll!nsInputStreamPump::OnStateTransfer()  Line 437 + 0x46	C++
 	necko.dll!nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream *
stream=0x03193988)  Line 340 + 0xb	C++
 	xpcom_core.dll!nsInputStreamReadyEvent::EventHandler(PLEvent *
plevent=0x030c3844)  Line 120	C++
 	xpcom_core.dll!PL_HandleEvent(PLEvent * self=0x030c3844)  Line 698 + 0xa	C
 	xpcom_core.dll!PL_ProcessPendingEvents(PLEventQueue * self=0x00ad8d58)  Line
633 + 0x9	C
 	xpcom_core.dll!_md_EventReceiverProc(HWND__ * hwnd=0x002b00be, unsigned int
uMsg=0x0000c118, unsigned int wParam=0x00000000, long lParam=0x00ad8d58)  Line
1435 + 0x9	C
 	user32.dll!_InternalCallWinProc@20()  + 0x28	
 	user32.dll!_UserCallWinProcCheckWow@32()  + 0xb7	
 	user32.dll!_DispatchMessageWorker@8()  + 0xdc	
 	user32.dll!_DispatchMessageA@4()  + 0xf	
 	winEmbed.exe!AppCallbacks::RunEventLoop(int & aRunCondition=0x00000001) 
Line 1198	C++
 	winEmbed.exe!main(int argc=0x00000001, char * * argv=0x003d7b80)  Line 188 +
0x9	C++
 	winEmbed.exe!mainCRTStartup()  Line 398 + 0x11	C
 	kernel32.dll!_BaseProcessStart@4()  + 0x23	

WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed, file
r:/mozilla/dom/src/base/nsJSEnvironment.cpp, line 1557
WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed, file
r:/mozilla/dom/src/base/nsJSEnvironment.cpp, line 2219
WARNING: NS_ENSURE_TRUE(context) failed, file
r:/mozilla/docshell/base/nsDocShell.cpp, line 7004

note that this call stack is going to repeatedly bubble and drop the real
nsresult (oom) and replace it w/ new instances of NS_ERROR_FAILURE

when it reaches nsDocShell::GetInterface, it starts doing really silly things,
namely, having decided which interface matches, and failing
EnsureScriptEnvironment(), the code continues to try other possible interfaces.

WARNING: NS_ENSURE_TRUE(win_private) failed, file
r:/mozilla/content/base/src/nsFrameLoader.cpp, line 370
WARNING: failed to load URL, file
r:/mozilla/content/html/content/src/nsGenericHTMLElement.cpp, line 3460

nsGenericHTMLFrameElement::BindToTree dropped the rv from LoadSrc which appears
to mean that nsGenericElement::AppendChildTo will now take the wrong code path.

actual results: /.'s ad frame failed to load :>

I can split the later analysis into a new bug, but i figured i'd include the
trace as i filed it...
Attachment #190667 - Flags: superreview?(jst)
Attachment #190667 - Flags: review?(jst)
Comment on attachment 190667 [details] [diff] [review]
Proposed patch for the LoadSrc issue

r+sr=jst
Attachment #190667 - Flags: superreview?(jst)
Attachment #190667 - Flags: superreview+
Attachment #190667 - Flags: review?(jst)
Attachment #190667 - Flags: review+
Comment on attachment 190667 [details] [diff] [review]
Proposed patch for the LoadSrc issue

Requesting 1.8b4 approval.  This is a simple fix to propagate out errors in
this case so we don't end up with a half-dead docshell in the docshell tree.
Attachment #190667 - Flags: approval1.8b4?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 190667 [details] [diff] [review]
Proposed patch for the LoadSrc issue

biesi points out that this is not quite ready yet.
Attachment #190667 - Flags: approval1.8b4?
Attachment #190667 - Flags: superreview-
Attachment #190667 - Flags: superreview+
Attachment #190667 - Flags: review-
Attachment #190667 - Flags: review+
So LoadSrc failing is not actually a problem.  The problem is that
EnsureScriptEnvironment failing seems to leave the docshell in an inconsistent
state....
Keywords: helpwanted
Assignee: dbradley → nobody
QA Contact: pschwartau → xpconnect
We still don't check the result of this LoadSrc() call, but comment 5 says that isn't the problem. I'll just mark this incomplete.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: