Open Bug 287010 Opened 20 years ago Updated 2 years ago

0[344708]: ###!!! ASSERTION: OnDataAvailable implementation consumed no data: 'Error', file r:/mozilla/netwerk/base/src/nsInputStreamPump.cpp, line 459

Categories

(Core :: DOM: HTML Parser, defect, P5)

x86
Windows XP
defect

Tracking

()

People

(Reporter: timeless, Unassigned)

References

Details

(Keywords: assertion)

0[344708]: WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed, file
r:/mozilla/parser/htmlparser/src/nsExpatDriver.cpp, line 632
0[344708]: ###!!! ASSERTION: OnDataAvailable implementation consumed no data:
'Error', file r:/mozilla/netwerk/base/src/nsInputStreamPump.cpp, line 459
0[344708]: ###!!! Break: at file
r:/mozilla/netwerk/base/src/nsInputStreamPump.cpp, line 459
Unhandled exception at 0x7c901230 (ntdll.dll) in mozilla.exe: User breakpoint.

steps involve using p3p's pageinfo overlay and clicking its options button, i
wouldn't wish that on anyone. the page i was infoing is http://cenzic.com/

stack for the ensure true that failed:
>	gkparser.dll!nsExpatDriver::HandleExternalEntityRef(const unsigned short *
openEntityNames=0x00000000, const unsigned short * base=0x08cbe8a8, const
unsigned short * systemId=0x08cbe930, const unsigned short *
publicId=0x08cbe8e4)  Line 632	C++
 	gkparser.dll!Driver_HandleExternalEntityRef(void *
aExternalEntityRefHandler=0x089799e8, const unsigned short *
aOpenEntityNames=0x00000000, const unsigned short * aBase=0x08cbe8a8, const
unsigned short * aSystemId=0x08cbe930, const unsigned short *
aPublicId=0x08cbe8e4)  Line 201	C++
 	gkparser.dll!doProlog(XML_ParserStruct * parser=0x081eecd0, const encoding *
enc=0x027a1910, const char * s=0x08266138, const char * end=0x08266966, int
tok=0x00000011, const char * next=0x0826613a, const char * * nextPtr=0x0012f904)
 Line 3779 + 0x24	C
 	gkparser.dll!prologProcessor(XML_ParserStruct * parser=0x081eecd0, const char
* s=0x08266038, const char * end=0x08266966, const char * * nextPtr=0x0012f904)
 Line 3590 + 0x27	C
 	gkparser.dll!prologInitProcessor(XML_ParserStruct * parser=0x081eecd0, const
char * s=0x08266038, const char * end=0x08266966, const char * *
nextPtr=0x0012f904)  Line 3421 + 0x15	C
 	gkparser.dll!MOZ_XML_Parse(XML_ParserStruct * parser=0x081eecd0, const char *
s=0x08266038, int len=0x0000092e, int isFinal=0x00000000)  Line 1497 + 0x28	C
 	gkparser.dll!nsExpatDriver::ParseBuffer(const char * aBuffer=0x08266038,
unsigned int aLength=0x0000092e, int aIsFinal=0x00000000)  Line 869 + 0x18	C++
 	gkparser.dll!nsExpatDriver::ConsumeToken(nsScanner & aScanner={...}, int &
aFlushTokens=0x00000000)  Line 990 + 0x20	C++
 	gkparser.dll!nsParser::Tokenize(int aIsFinalChunk=0x00000000)  Line 2763 +
0x1a	C++
 	gkparser.dll!nsParser::ResumeParse(int allowIteration=0x00000001, int
aIsFinalChunk=0x00000000, int aCanInterrupt=0x00000001)  Line 1934 + 0x1b	C++
 	gkparser.dll!nsParser::OnDataAvailable(nsIRequest * request=0x0807e780,
nsISupports * aContext=0x00000000, nsIInputStream * pIStream=0x08ac2700,
unsigned int sourceOffset=0x00000000, unsigned int aLength=0x00000497)  Line
2613 + 0x15	C++
 	xmlextras.dll!nsXMLHttpRequest::StreamReaderFunc(nsIInputStream *
in=0x0703a3c0, void * closure=0x08d1d558, const char *
fromRawSegment=0x069f3334, unsigned int toOffset=0x00000000, unsigned int
count=0x00000497, unsigned int * writeCount=0x0012fab4)  Line 1134 + 0x43	C++
 	xpcom_core.dll!nsInputStreamTee::WriteSegmentFun(nsIInputStream *
in=0x0703a3c0, void * closure=0x0844ae78, const char * fromSegment=0x069f3334,
unsigned int offset=0x00000000, unsigned int count=0x00000497, unsigned int *
writeCount=0x0012fab4)  Line 102 + 0x21	C++
 	xpcom_core.dll!nsPipeInputStream::ReadSegments(unsigned int (nsIInputStream *,
void *, const char *, unsigned int, unsigned int, unsigned int *)*
writer=0x00489380, void * closure=0x0844ae78, unsigned int count=0x00000497,
unsigned int * readCount=0x0012fb04)  Line 762 + 0x1d	C++
 	xpcom_core.dll!nsInputStreamTee::ReadSegments(unsigned int (nsIInputStream *,
void *, const char *, unsigned int, unsigned int, unsigned int *)*
writer=0x067483e0, void * closure=0x08d1d558, unsigned int count=0x00000497,
unsigned int * bytesRead=0x0012fb04)  Line 157	C++
 	xmlextras.dll!nsXMLHttpRequest::OnDataAvailable(nsIRequest *
request=0x0807e780, nsISupports * ctxt=0x00000000, nsIInputStream *
inStr=0x0844ae78, unsigned int sourceOffset=0x00000000, unsigned int
count=0x00000497)  Line 1159	C++
 	necko.dll!nsStreamListenerTee::OnDataAvailable(nsIRequest *
request=0x0807e780, nsISupports * context=0x00000000, nsIInputStream *
input=0x0703a3c0, unsigned int offset=0x00000000, unsigned int count=0x00000497)
 Line 97 + 0x33	C++
 	necko.dll!nsHttpChannel::OnDataAvailable(nsIRequest * request=0x08b6d4e8,
nsISupports * ctxt=0x00000000, nsIInputStream * input=0x0703a3c0, unsigned int
offset=0x00000000, unsigned int count=0x00000497)  Line 3920 + 0x44	C++
 	necko.dll!nsInputStreamPump::OnStateTransfer()  Line 437 + 0x46	C++
 	necko.dll!nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream *
stream=0x0703a3c0)  Line 340 + 0xb	C++
 	xpcom_core.dll!nsInputStreamReadyEvent::EventHandler(PLEvent *
plevent=0x07800bc4)  Line 119	C++
 	xpcom_core.dll!PL_HandleEvent(PLEvent * self=0x07800bc4)  Line 698 + 0xa	C
 	xpcom_core.dll!PL_ProcessPendingEvents(PLEventQueue * self=0x00be3478)  Line
633 + 0x9	C
 	xpcom_core.dll!_md_TimerProc(HWND__ * hwnd=0x00070d30, unsigned int
uMsg=0x00000113, unsigned int idEvent=0x00000000, unsigned long
dwTime=0x35b8143a)  Line 1034 + 0x9	C
 	user32.dll!_InternalCallWinProc@20()  + 0x28	
 	user32.dll!_UserCallWinProc@24()  + 0xa1	
 	user32.dll!_DispatchMessageWorker@8()  + 0xcc6	
 	user32.dll!_DispatchMessageW@4()  + 0xf	
 	gkwidget.dll!nsAppShell::Run()  Line 135	C++
 	appcomps.dll!nsAppStartup::Run()  Line 208	C++
 	mozilla.exe!main1(int argc=0x00000001, char * * argv=0x00347930, nsISupports *
nativeApp=0x00c06230)  Line 1325 + 0x20	C++
 	mozilla.exe!main(int argc=0x00000001, char * * argv=0x00347930)  Line 1831 +
0x25	C++
 	mozilla.exe!mainCRTStartup()  Line 398 + 0x11	C
 	kernel32.dll!_BaseProcessStart@4()  + 0x23	

+	absURL	{mStorage=0x0012f728 "" }	nsAutoString
+	base	0x08cbe8a8 "http://cenzic.com/w3c/p3p.xml"	const unsigned short *
+	in	{mRawPtr=0x00000000 }	nsCOMPtr<nsIInputStream>
+	publicId	0x08cbe8e4 "-//W3C//DTD HTML 4.0 Transitional//EN"	const unsigned short *
	rv	0x80004001	unsigned int
+	systemId	0x08cbe930 "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd"
const unsigned short *
+	this	0x089799e8 {mRefCnt={mValue=0x00000002 }
_mOwningThread={mThread=0x00344708 } mExpatParser=0x081eecd0
{m_userData=0x089799e8 m_handlerArg=0x089799e8 m_buffer=0x00000000 <Bad Ptr>
...} ...}	nsExpatDriver * const

eventually, that becomes:
	prologProcessor returned	XML_ERROR_INVALID_TOKEN	XML_Error
	MOZ_XML_Parse returned	XML_STATUS_ERROR	XML_Status
	nsExpatDriver::ParseBuffer returned	0x804e03f7	unsigned int
	nsExpatDriver::ConsumeToken returned	0x804e03f7	unsigned int
	nsParser::Tokenize returned	0x804e03f7	unsigned int
	nsParser::ResumeParse returned	0x00000000	unsigned int
	nsParser::OnDataAvailable returned	0x00000000	unsigned int
	nsXMLHttpRequest::StreamReaderFunc returned	0x00000000	unsigned int
	nsInputStreamTee::TeeSegment returned	0x00000000	unsigned int
	nsInputStreamTee::WriteSegmentFun returned	0x00000000	unsigned int
	nsPipeInputStream::ReadSegments returned	0x00000000	unsigned int
	nsXMLHttpRequest::OnDataAvailable returned	0x00000000	unsigned int
	nsStreamListenerTee::OnDataAvailable returned	0x00000000	unsigned int
	nsHttpChannel::OnDataAvailable returned	0x00000000	unsigned int

the start of unhappy things is:
nsParser::OnDataAvailable(nsIRequest * request=0x0807e780, nsISupports *
aContext=0x00000000, nsIInputStream * pIStream=0x08b71fa8, unsigned int
sourceOffset=0x00000000, unsigned int aLength=0x000005b5)
    rv = NS_ERROR_UNEXPECTED;

which seems ok, until we bubble up to:
nsPipeInputStream::ReadSegments(unsigned int (nsIInputStream *, void *, const
char *, unsigned int, unsigned int, unsigned int *)
            rv = writer(this, closure, segment, *readCount, segmentLen,
&writeCount);

            if (NS_FAILED(rv) || writeCount == 0) {
                count = 0;
                // any errors returned from the writer end here: do not
                // propogate to the caller of ReadSegments.
                rv = NS_OK;
                break;
            }

where things seem to confuse my little mind.

stack at time when the world is about to go bad:
 	gkparser.dll!nsParser::OnDataAvailable(nsIRequest * request=0x0807e780,
nsISupports * aContext=0x00000000, nsIInputStream * pIStream=0x08b71fa8,
unsigned int sourceOffset=0x00000000, unsigned int aLength=0x000005b5)  Line
2617	C++
 	xmlextras.dll!nsXMLHttpRequest::StreamReaderFunc(nsIInputStream *
in=0x0703a3c0, void * closure=0x08d1d558, const char *
fromRawSegment=0x069ef137, unsigned int toOffset=0x00000000, unsigned int
count=0x000005b5, unsigned int * writeCount=0x0012fab4)  Line 1134 + 0x43	C++
 	xpcom_core.dll!nsInputStreamTee::WriteSegmentFun(nsIInputStream *
in=0x0703a3c0, void * closure=0x08aeac68, const char * fromSegment=0x069ef137,
unsigned int offset=0x00000000, unsigned int count=0x000005b5, unsigned int *
writeCount=0x0012fab4)  Line 102 + 0x21	C++
>	xpcom_core.dll!nsPipeInputStream::ReadSegments(unsigned int (nsIInputStream *,
void *, const char *, unsigned int, unsigned int, unsigned int *)*
writer=0x00489380, void * closure=0x08aeac68, unsigned int count=0x0000948e,
unsigned int * readCount=0x0012fb04)  Line 762 + 0x1d	C++
 	xpcom_core.dll!nsInputStreamTee::ReadSegments(unsigned int (nsIInputStream *,
void *, const char *, unsigned int, unsigned int, unsigned int *)*
writer=0x067483e0, void * closure=0x08d1d558, unsigned int count=0x0000948e,
unsigned int * bytesRead=0x0012fb04)  Line 157	C++
 	xmlextras.dll!nsXMLHttpRequest::OnDataAvailable(nsIRequest *
request=0x0807e780, nsISupports * ctxt=0x00000000, nsIInputStream *
inStr=0x08aeac68, unsigned int sourceOffset=0x00000a4b, unsigned int
count=0x0000948e)  Line 1159	C++
 	necko.dll!nsStreamListenerTee::OnDataAvailable(nsIRequest *
request=0x0807e780, nsISupports * context=0x00000000, nsIInputStream *
input=0x0703a3c0, unsigned int offset=0x00000a4b, unsigned int count=0x0000948e)
 Line 97 + 0x33	C++
 	necko.dll!nsHttpChannel::OnDataAvailable(nsIRequest * request=0x087437a0,
nsISupports * ctxt=0x00000000, nsIInputStream * input=0x0703a3c0, unsigned int
offset=0x00000a4b, unsigned int count=0x0000948e)  Line 3920 + 0x44	C++
 	necko.dll!nsInputStreamPump::OnStateTransfer()  Line 437 + 0x46	C++
 	necko.dll!nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream *
stream=0x0703a3c0)  Line 340 + 0xb	C++
 	xpcom_core.dll!nsInputStreamReadyEvent::EventHandler(PLEvent *
plevent=0x077871ac)  Line 119	C++
 	xpcom_core.dll!PL_HandleEvent(PLEvent * self=0x077871ac)  Line 698 + 0xa	C
 	xpcom_core.dll!PL_ProcessPendingEvents(PLEventQueue * self=0x00be3478)  Line
633 + 0x9	C
 	xpcom_core.dll!_md_TimerProc(HWND__ * hwnd=0x00070d30, unsigned int
uMsg=0x00000113, unsigned int idEvent=0x00000000, unsigned long
dwTime=0x35a97cff)  Line 1034 + 0x9	C
 	user32.dll!_InternalCallWinProc@20()  + 0x28	
 	user32.dll!_UserCallWinProc@24()  + 0xa1	
 	user32.dll!_DispatchMessageWorker@8()  + 0xcc6	
 	user32.dll!_DispatchMessageW@4()  + 0xf	
 	gkwidget.dll!nsAppShell::Run()  Line 135	C++
 	appcomps.dll!nsAppStartup::Run()  Line 208	C++
 	mozilla.exe!main1(int argc=0x00000001, char * * argv=0x00347930, nsISupports *
nativeApp=0x00c06230)  Line 1325 + 0x20	C++
 	mozilla.exe!main(int argc=0x00000001, char * * argv=0x00347930)  Line 1831 +
0x25	C++
 	mozilla.exe!mainCRTStartup()  Line 398 + 0x11	C
 	kernel32.dll!_BaseProcessStart@4()  + 0x23	

stack at assertion:
 	xpcom_core.dll!nsDebug::Assertion(const char * aStr=0x00f3df80, const char *
aExpr=0x00f3df78, const char * aFile=0x00f3df44, int aLine=0x000001cb)  Line 109	C++
 	necko.dll!nsInputStreamPump::OnStateTransfer()  Line 459 + 0x1a	C++
 	necko.dll!nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream *
stream=0x0703a3c0)  Line 340 + 0xb	C++
 	xpcom_core.dll!nsInputStreamReadyEvent::EventHandler(PLEvent *
plevent=0x077871ac)  Line 119	C++
 	xpcom_core.dll!PL_HandleEvent(PLEvent * self=0x077871ac)  Line 698 + 0xa	C
 	xpcom_core.dll!PL_ProcessPendingEvents(PLEventQueue * self=0x00be3478)  Line
633 + 0x9	C
 	xpcom_core.dll!_md_TimerProc(HWND__ * hwnd=0x00070d30, unsigned int
uMsg=0x00000113, unsigned int idEvent=0x00000000, unsigned long
dwTime=0x35a97cff)  Line 1034 + 0x9	C
 	user32.dll!_InternalCallWinProc@20()  + 0x28	
 	user32.dll!_UserCallWinProc@24()  + 0xa1	
 	user32.dll!_DispatchMessageWorker@8()  + 0xcc6	
 	user32.dll!_DispatchMessageW@4()  + 0xf	
 	gkwidget.dll!nsAppShell::Run()  Line 135	C++
 	appcomps.dll!nsAppStartup::Run()  Line 208	C++
 	mozilla.exe!main1(int argc=0x00000001, char * * argv=0x00347930, nsISupports *
nativeApp=0x00c06230)  Line 1325 + 0x20	C++
 	mozilla.exe!main(int argc=0x00000001, char * * argv=0x00347930)  Line 1831 +
0x25	C++
 	mozilla.exe!mainCRTStartup()  Line 398 + 0x11	C
 	kernel32.dll!_BaseProcessStart@4()  + 0x23
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P5
I version firefox version 3.1b3 i find if I use a XMLHTTPRequest with POST method and multipart set to true, I get the same error. I am sorry that I can not debug it any more.

###!!! ASSERTION: OnDataAvailable implementation consumed no data: 'Error', file /home/savages/mozilla/mozilla-central/netwerk/base/src/nsInputStreamPump.cpp, line 529
Assignee: parser → nobody
QA Contact: mrbkap → parser
Anyone is working on this?

I see similar problems but I can shed some light on why this could be happening. First of all this is what I get in the logs:

-1604856512[10be00]: ###!!! ASSERTION: cancel with non-failure status code: 'NS_FAILED(status)', file /Users/noone/code/mozilla-1.9.2.10/netwerk/base/src/nsInputStreamPump.cpp, line 212
-1604856512[10be00]: ###!!! ASSERTION: OnDataAvailable implementation consumed no data: 'Error', file /Users/noone/code/mozilla-1.9.2.10/netwerk/base/src/nsInputStreamPump.cpp, line 531

The ASSERTION regarding the cancel of the request is correct. I do try to cancel the request in some situations and I do it as such:

httpChannel.cancel(CR.NS_OK);

The reason I do it like that is because any other CR error will not result into the request being canceled. Perhaps this is a bug, or perhaps it is something else.

Anyway, at this stage the request should be canceled but this is what we get inside nsInputStreamPump.cpp at the beginning of nsInputStreamPump::OnStateTransfer() function:

    // if canceled, go directly to STATE_STOP...
    if (NS_FAILED(mStatus))
        return STATE_STOP;

which makes sense but it doesn't make sense in my situation and perhaps in others too.

In summary the problem is summarized in the following:

1. You cannot cancel a request with something like this: request.cancel(CR.NS_BINDING_ABORTED). It simply wont cancel it.
2. If you do request.cancel(CR.NS_OK) that will cancel the request but will trigger this ASSERTION and perhaps other bad things could happen too.

I welcome any comments.

Thanks for the hard work.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.