Open Bug 1227947 Opened 9 years ago Updated 2 years ago

nsInputStreamPump asserts "OnDataAvailable implementation consumed no data" on erroring observers

Categories

(Core :: Networking, defect, P3)

defect

Tracking

()

People

(Reporter: yury, Unassigned)

References

Details

(Whiteboard: [necko-backlog])

While working on bug 121809, the crash test at dom/base/crashtests/1154598.xhtml started failing, which is caused by the NS_BINDING_ABORTED returned at OnDataAvailable's writer callback of a stream listener. nsPipeInputStream::ReadSegments at http://mxr.mozilla.org/mozilla-central/source/xpcom/io/nsPipe3.cpp#1281 ignores any errors from such methods and nsInputStreamPump::OnStateTransfer at http://mxr.mozilla.org/mozilla-central/source/netwerk/base/nsInputStreamPump.cpp#626 assumes that no data were read therefore throws an error.

The mozilla-central code contains lots of places where error code means something that nsInputStreamPump shall not ignore (and nsPipeInputStream can process correctly), e.g. http://mxr.mozilla.org/mozilla-central/source/netwerk/base/nsStreamLoader.cpp#136

It's expected: to have a different error/warning message but at nsInputStreamPump level or properly handle the error state of OnDataAvailable's writer callback. I can implement a workaround to silently ignore any incoming data when it's known that request was canceled, but there still will be a problem, e.g. as in nsStreamLoader case, with handling NS_ERROR_OUT_OF_MEMORY.
> While working on bug 121809,

Correction: bug 1218029
Blocks: 1218029
Whiteboard: [necko-backlog]
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P1
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: P1 → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.