Closed Bug 1424981 Opened 2 years ago Closed 2 years ago

MutableBlobStorage must keep the file locked during the IPC communication

Categories

(Core :: DOM: File, enhancement)

58 Branch
enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: baku, Assigned: baku)

Details

Attachments

(1 file)

bkelly showed me this crash: https://treeherder.mozilla.org/logviewer.html#?job_id=151371386&repo=try&lineNumber=10724

Here we have I/O errors during the creation of a TemporaryIPCBlobInputStream object by the parent actor. This can happen only if the temporary file has been deleted during the operation and this could happen because the File Handle is closed by the child actor, before asking for the IPCBlob. Between that time, and when the parent actor does the operation, nsAnonTempFileRemover is able to delete the temporary file.
Attached patch patchSplinter Review
Attachment #8936563 - Flags: review?(bugs)
Comment on attachment 8936563 [details] [diff] [review]
patch

I tried and failed to understand this.

We may call CloseFD() also elsewhere in failure cases. Why we don't need to change those?
Please fix or explain.
Attachment #8936563 - Flags: review?(bugs)
> We may call CloseFD() also elsewhere in failure cases. Why we don't need to
> change those?

If we fail, we want to release the temporary file. We don't create the blob if we fail. In general, we call SendOperationFailed() in these scenarios:

1.  MutableBlobStorage::TemporaryFileCreated but the storage has been already closed. In this case we dispatch a CloseFileRunnable.

2. ErrorPropagated(). In this case, before dispatching ErrorPropagationRunnable() we call CloseFD().
Flags: needinfo?(bugs)
Comment on attachment 8936563 [details] [diff] [review]
patch

I think I may understand this.
Flags: needinfo?(bugs)
Attachment #8936563 - Flags: review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9ffdabd433a0
MutableBlobStorage must keep the file locked during the IPC communication, r=smaug
https://hg.mozilla.org/mozilla-central/rev/9ffdabd433a0
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.