Closed Bug 1401224 Opened 8 years ago Closed 8 years ago

Assertion failure: aLength > 0 (Writing a zero-sized chunk), at image/SourceBuffer.cpp:348

Categories

(Core :: Networking: Cache, defect)

49 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox-esr52 --- wontfix
firefox56 --- wontfix
firefox57 --- wontfix
firefox58 --- fixed

People

(Reporter: bc, Assigned: michal)

References

()

Details

(Keywords: assertion)

Attachments

(3 files)

Attached file Windows Debug Log
1. https://nhiemvu.lienminh.garena.vn/tanthu 2. Assertion failure: aLength > 0 (Writing a zero-sized chunk), at z:/build/build/src/image/SourceBuffer.cpp:348 #01: mozilla::image::SourceBuffer::Append(char const *,unsigned int) [image/SourceBuffer.cpp:347] #02: mozilla::image::AppendToSourceBuffer [image/SourceBuffer.cpp:454] #03: mozilla::net::CacheFileInputStream::ReadSegments(nsresult (*)(nsIInputStream *,void *,char const *,unsigned int,unsigned int,unsigned int *),void *,unsigned int,unsigned int *) [netwerk/cache2/CacheFileInputStream.cpp:186] #04: mozilla::image::SourceBuffer::AppendFromInputStream(nsIInputStream *,unsigned int) [image/SourceBuffer.cpp:469] #05: mozilla::image::RasterImage::OnImageDataAvailable(nsIRequest *,nsISupports *,nsIInputStream *,unsigned __int64,unsigned int) [image/RasterImage.cpp:1045] #06: imgRequest::OnDataAvailable(nsIRequest *,nsISupports *,nsIInputStream *,unsigned __int64,unsigned int) [image/imgRequest.cpp:1191] #07: ProxyListener::OnDataAvailable(nsIRequest *,nsISupports *,nsIInputStream *,unsigned __int64,unsigned int) [image/imgLoader.cpp:2789] #08: mozilla::net::nsHttpChannel::OnDataAvailable(nsIRequest *,nsISupports *,nsIInputStream *,unsigned __int64,unsigned int) [netwerk/protocol/http/nsHttpChannel.cpp:7794] Windows, Linux - Nightly 57. This assertion is not very reproducible though it keeps appearing. I've been able to reproduce occasionally manually especially on Windows. I reproduced on Windows 10 32bit using https://www.charchinet.com/ this morning but was not able to reproduce again after the first time. I am going to file this anyway in the hope that it will be clear as to what the issue is even if it is not easily reproducible.
Attached file urls
This includes most of the urls where this has been reproduced at least once. I've scrubbed some urls which may contain pii.
As far as I can tell the length argument (which we are asserting about) comes from the networking code.
Component: ImageLib → Networking
Patrick, thoughts about comment 2?
Flags: needinfo?(mcmanus)
you've got the cache on the stack so I'll redirect to michal.. but in general, this has been a common enough problem (especially with addons in the past!) that its worth handling it at runtime - so many things get their hooks into stream processing. see nshttpconnection.cpp:1685
Flags: needinfo?(mcmanus) → needinfo?(michal.novotny)
CacheFileInputStream::ReadSegments was called with aCount=0
Flags: needinfo?(michal.novotny)
Other possibility is that we call the writer after aCount bytes were already written because we don't break the loop at http://searchfox.org/mozilla-central/rev/15ce5cb2db0c85abbabe39a962b0e697c9ef098f/netwerk/cache2/CacheFileInputStream.cpp#201.
Assignee: nobody → michal.novotny
Component: Networking → Networking: Cache
Attached patch fixSplinter Review
Attachment #8914519 - Flags: review?(valentin.gosu)
Attachment #8914519 - Flags: review?(valentin.gosu) → review+
Pushed by mnovotny@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/01c08db62e0f Do not call aWriter with no data in CacheFileInputStream::ReadSegments, r=valentin
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Is there a user impact here that justified backport to Beta or can this ride the 58 train?
Blocks: 1279246
Flags: needinfo?(michal.novotny)
Version: 57 Branch → 49 Branch
AFAICS, calling SourceBuffer::Append() with aLength=0 should be no-op if it's not a first call. There should be no problem in release build.
Flags: needinfo?(michal.novotny)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: