Closed
Bug 1122788
Opened 11 years ago
Closed 10 years ago
Incorrect behavior of DOM File access to deleted files on debug builds
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla45
| Tracking | Status | |
|---|---|---|
| firefox45 | --- | fixed |
People
(Reporter: jld, Assigned: baku)
References
Details
Attachments
(2 files)
|
1.50 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
|
2.53 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
If a DOM File is constructed for a file that is later deleted, trying to read it will invoke the reader's onerror handler, except on debug builds. On debug builds, the routine SeekableStreamAtBeginning in xpcom/io/nsMultiplexInputStream.cpp will call the Tell() method on the input stream, which performs its deferred open, but SeekableStreamAtBeginning discards the error from that method.
I ran into this in bug 1068838 while trying to adjust dom/base/test/test_fileapi.html to use the File constructor (in a chrome script) instead of writing to a file input element's |value| property and opening files directly; this may be related to how those two paths use different BlobImpls.
It's possible that this bug belongs in XPCOM instead of DOM; adjust as needed.
| Assignee | ||
Comment 1•10 years ago
|
||
I didn't find any reasonable way to fix this blocker for bug 1198095.
Another approach would be to change the nsTArray of nsIInputStream in some data struct with a boolean and then the first time we use this particular nsIInputStream, we check if the Tell() returns 0, but that will increase the level of complexity, almost for nothing.
Attachment #8695902 -
Flags: review?(bzbarsky)
Comment 2•10 years ago
|
||
Comment on attachment 8695902 [details] [diff] [review]
fix.patch
We could try skipping the tell() for file streams in particular, but we may have a buffered file stream which would have the same problem...
r=me, I guess.
Attachment #8695902 -
Flags: review?(bzbarsky) → review+
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → amarchesini
Comment 4•10 years ago
|
||
| backout bugherder landing | ||
Backed out for being a likely cause of https://treeherder.mozilla.org/logviewer.html#?job_id=18307492&repo=mozilla-inbound
https://hg.mozilla.org/integration/mozilla-inbound/rev/1de4d57e6fa3
Flags: needinfo?(amarchesini)
| Assignee | ||
Comment 5•10 years ago
|
||
For e10s we must propagate the error code from Available. The reason why this is needed, is that, here:
http://mxr.mozilla.org/mozilla-central/source/dom/ipc/Blob.cpp#1626
we use Available() to force the stream open, but if this fails, in:
http://mxr.mozilla.org/mozilla-central/source/xpcom/io/nsMultiplexInputStream.cpp#725
we don't propagate such error value to the child process.
Probably would be a good idea to update mStatus for each public nsMultiplexInputStream method.
Flags: needinfo?(amarchesini)
Attachment #8696155 -
Flags: review?(bzbarsky)
Comment 6•10 years ago
|
||
Comment on attachment 8696155 [details] [diff] [review]
e10s
r=me
Attachment #8696155 -
Flags: review?(bzbarsky) → review+
Comment 8•10 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•