Open Bug 1404381 Opened 7 years ago Updated 2 years ago

StreamFilter.onerror continues to be readable and writable after "Out of memory" error

Categories

(WebExtensions :: Request Handling, defect, P3)

57 Branch
defect

Tracking

(Not tracked)

People

(Reporter: robwu, Unassigned)

References

Details

StreamFilter.onerror is documented as a final event, after which read/write is no longer possible [1]. However, when a buffer cannot be allocated due to OOM, an onerror event is fired. This can happen an arbitrary number of times [2] because the state is not reset. Can the implementation be updated to match the IDL documention (e.g. by closing the stream)? (or if you like the current implementation, edit the IDL documentation to match the current behavior) The fact that data continues to flow in after firing onerror can result in undetected corruption of response bodies due to missing chunks, when the implementation looks like filter.ondata = ({data}) => filter.write(data); It seems that the data chunks have a very reasonable size, so this unexpected situation will probably be rare. [1] https://searchfox.org/mozilla-central/rev/f54c1723befe6bcc7229f005217d5c681128fcad/dom/webidl/StreamFilter.webidl#139-143 [2] https://searchfox.org/mozilla-central/rev/f54c1723befe6bcc7229f005217d5c681128fcad/toolkit/components/extensions/webrequest/StreamFilter.cpp#262-266
Can you give this a priority please Kris.
Flags: needinfo?(kmaglione+bmo)
Guessing at P2, but waiting for comment 2.
Priority: -- → P2
Priority: P2 → P3
Product: Toolkit → WebExtensions
Flags: needinfo?(kmaglione+bmo)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.