###!!! ASSERTION: buffer truncation inadequate: 'mStreamEnd < (16 * 1024)', file r:/mozilla/netwerk/cache/src/nsDiskCacheStreams.cpp, line 884

RESOLVED FIXED

Status

()

Core
Networking: Cache
P5
normal
RESOLVED FIXED
13 years ago
12 years ago

People

(Reporter: timeless, Assigned: Darin Fisher)

Tracking

({assertion})

Trunk
x86
Windows XP
assertion
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
WARNING: Using nsIGlobalHistory->nsIGlobalHistory2 adapter., file
r:/mozilla/docshell/base/nsGlobalHistory2Adapter.cpp, line 137
###!!! ASSERTION: buffer truncation inadequate: 'mStreamEnd < (16 * 1024)', file
r:/mozilla/netwerk/cache/src/nsDiskCacheStreams.cpp, line 884
Break: at file r:/mozilla/netwerk/cache/src/nsDiskCacheStreams.cpp, line 884

+
((*(nsACString*)(&(*(nsCSubstring*)(&*((*((*((*this).mBinding)).mCacheEntry)).mKey)))))).mData
0x0427ad18 "HTTP:http://www.greatbigsea.com/themusic/audio/sb1.mp3"	char *
+
{,,necko.dll}((*(nsACString*)(&(*(nsCSubstring*)(&(*(nsStandardURL*)(((*(nsHttpChannel*){*}request).mURI).mRawPtr)).mSpec))))).mData
0x0524ed10 "http://www.greatbigsea.com/themusic/audio/sb1.mp3"	char *
+
{,,necko.dll}((*(nsACString*)(&(*(nsCSubstring*)(&(*(nsStandardURL*)(((*(nsHttpChannel*){*}request).mReferrer).mRawPtr)).mSpec))))).mData
0x043843f0 "http://www.greatbigsea.com/"	char *
	mStreamEnd	0x00004000	unsigned int
	mStreamEnd == (16 * 1024)	true	bool
        NS_ASSERTION(mStreamEnd < (16 * 1024), "buffer truncation inadequate");

 	xpcom_core.dll!nsDebug::Assertion(const char * aStr=0x00edab60, const char *
aExpr=0x00edab44, const char * aFile=0x00edab10, int aLine=0x00000374)  Line 109	C++
>	necko.dll!nsDiskCacheStreamIO::SetEOF()  Line 884 + 0x26	C++
 	necko.dll!nsDiskCacheStreamIO::GetOutputStream(unsigned int offset=0x00004000,
nsIOutputStream * * outputStream=0x03713b18)  Line 424 + 0x8	C++
 	necko.dll!nsDiskCacheDevice::OpenOutputStreamForEntry(nsCacheEntry *
entry=0x0427ad98, int mode=0x00000003, unsigned int offset=0x00004000,
nsIOutputStream * * result=0x03713b18)  Line 633	C++
 	necko.dll!nsCacheService::OpenOutputStreamForEntry(nsCacheEntry *
entry=0x0427ad98, int mode=0x00000003, unsigned int offset=0x00004000,
nsIOutputStream * * result=0x03713b18)  Line 1431	C++
 	necko.dll!nsCacheEntryDescriptor::nsOutputStreamWrapper::LazyInit()  Line
569 + 0x2f	C++
 	necko.dll!nsCacheEntryDescriptor::nsOutputStreamWrapper::EnsureInit()  Line
146 + 0x23	C++
 	necko.dll!nsCacheEntryDescriptor::nsOutputStreamWrapper::Write(const char *
buf=0x06d206f4, unsigned int count=0x00001fff, unsigned int * result=0x0012fae8)
 Line 616 + 0x8	C++
 	xpcom_core.dll!nsInputStreamTee::TeeSegment(const char * buf=0x06d206f4,
unsigned int count=0x00001fff)  Line 80 + 0x29	C++
 	xpcom_core.dll!nsInputStreamTee::Read(char * buf=0x06d206f4, unsigned int
count=0x00001fff, unsigned int * bytesRead=0x0012fbd8)  Line 143	C++
 	docshell.dll!nsExternalAppHandler::OnDataAvailable(nsIRequest *
request=0x033b3c50, nsISupports * aCtxt=0x00000000, nsIInputStream *
inStr=0x040576a8, unsigned int sourceOffset=0x00004000, unsigned int
count=0x00010000)  Line 1894 + 0x3c	C++
 	docshell.dll!nsDocumentOpenInfo::OnDataAvailable(nsIRequest *
request=0x033b3c50, nsISupports * aCtxt=0x00000000, nsIInputStream *
inStr=0x040576a8, unsigned int sourceOffset=0x00004000, unsigned int
count=0x00010000)  Line 349 + 0x2e	C++
 	necko.dll!nsStreamListenerTee::OnDataAvailable(nsIRequest *
request=0x033b3c50, nsISupports * context=0x00000000, nsIInputStream *
input=0x0461a968, unsigned int offset=0x00004000, unsigned int count=0x00010000)
 Line 97 + 0x33	C++
 	necko.dll!nsHttpChannel::OnDataAvailable(nsIRequest * request=0x042b90b8,
nsISupports * ctxt=0x00000000, nsIInputStream * input=0x0461a968, unsigned int
offset=0x00000000, unsigned int count=0x00010000)  Line 3905 + 0x44	C++
 	necko.dll!nsInputStreamPump::OnStateTransfer()  Line 437 + 0x46	C++
 	necko.dll!nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream *
stream=0x0461a968)  Line 340 + 0xb	C++
 	xpcom_core.dll!nsInputStreamReadyEvent::EventHandler(PLEvent *
plevent=0x03713ba4)  Line 119	C++
 	xpcom_core.dll!PL_HandleEvent(PLEvent * self=0x03713ba4)  Line 698 + 0xa	C
 	xpcom_core.dll!PL_ProcessPendingEvents(PLEventQueue * self=0x00b37770)  Line
633 + 0x9	C
 	xpcom_core.dll!_md_EventReceiverProc(HWND__ * hwnd=0x0014068a, unsigned int
uMsg=0x0000c1d6, unsigned int wParam=0x00000000, long lParam=0x00b37770)  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=0x003d81b0)  Line 188 +
0x9	C++
 	winEmbed.exe!mainCRTStartup()  Line 398 + 0x11	C
 	kernel32.dll!_BaseProcessStart@4()  + 0x23
(Reporter)

Updated

12 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P5

Comment 1

12 years ago
Created attachment 220042 [details] [diff] [review]
Very simple patch to correct faulty assertion

The assertion is testing if the buffer is not bigger than the max:
NS_ASSERTION(mStreamEnd < (16 * 1024), "buffer truncation inadequate");

But the test seems to be wrong, when mStreamEnd is exactly 16*1024 which is valid, the assertion will fail.

So, the following whould be better:
NS_ASSERTION(mStreamEnd <= kMaxBufferSize, "buffer truncation inadequate");
Attachment #220042 - Flags: review?(darin)
(Assignee)

Comment 2

12 years ago
Comment on attachment 220042 [details] [diff] [review]
Very simple patch to correct faulty assertion

r+a=darin
Attachment #220042 - Flags: review?(darin)
Attachment #220042 - Flags: review+
Attachment #220042 - Flags: approval-branch-1.8.1+
(Assignee)

Comment 3

12 years ago
fixed-on-trunk
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.