Closed Bug 1350435 Opened 7 years ago Closed 7 years ago

getSnapshotIdFromPath() shouldn't assume parent and child process have same TmpD

Categories

(DevTools :: Memory, enhancement)

enhancement
Not set
normal

Tracking

(firefox55 fixed)

RESOLVED FIXED
Firefox 55
Tracking Status
firefox55 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(1 file)

See bug 1349389 for details.

But anyways, what happens is the parent process creates a file in the temp directory, sends the file name to the child process which does this: 

exports.getSnapshotIdFromPath = function (path) {
  return path.slice(OS.Constants.Path.tmpDir.length + 1,
                    path.length - ".fxsnapshot".length);
};

With the new fancy sandboxing work that is going on, the temp dir in the parent and child are not the same. The child process temp dir has some extra "Temp-{UUID}" stuff added on the end. Therefore, getSnapshotIdFromPath will return an empty string if OS.Constants.Path.tmpDir returns the correct value.

This only happens to incidentally work right now due to a bug in OS.Constants.Path snapshotting the value of tmpDir early in startup, when we eagerly load osfile.jsm from telemetry startup. (I'm going to file a separate bug on that.)

I think the right fix is to compute the snapshot ID in the parent, and send it in the message instead of the path.
Assignee: nobody → continuation
I need to remember to get a DOM peer review for the .webidl change once fitzgen reviews this (I added a chrome-only method that is just a variation of another method, so I can't imagine it will need more than a rubber stamp DOM review).
Comment on attachment 8851347 [details]
Bug 1350435 - Compute snapshot ID in the parent process.

https://reviewboard.mozilla.org/r/123662/#review126370

Looks great! Thanks :mccr8 :)
Comment on attachment 8851347 [details]
Bug 1350435 - Compute snapshot ID in the parent process.

https://reviewboard.mozilla.org/r/123662/#review126372
Attachment #8851347 - Flags: review?(nfitzgerald) → review+
Attachment #8851347 - Flags: review?(bugs)
Olli, could you look at the .webidl change? Thanks.
Comment on attachment 8851347 [details]
Bug 1350435 - Compute snapshot ID in the parent process.

https://reviewboard.mozilla.org/r/123662/#review126380

r+ for the .webidl
Attachment #8851347 - Flags: review?(bugs) → review+
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/951e3cdf5b32
Compute snapshot ID in the parent process. r=fitzgen,smaug
https://hg.mozilla.org/mozilla-central/rev/951e3cdf5b32
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: