Closed
Bug 1400051
Opened 7 years ago
Closed 6 years ago
Remove use of base::SetAllFDsToCloseOnExec from process_util_bsd.cc
Categories
(Core :: IPC, enhancement, P3)
Core
IPC
Tracking
()
RESOLVED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: jld, Assigned: jld)
References
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
jld
:
review+
|
Details | Diff | Splinter Review |
This is one half of bug 1400042: process_util_bsd.cc is using base::SetAllFDsToCloseOnExec and potentially leaking concurrently created fds into child processes because it's using posix_spawn, which can't atomically close unwanted fds. (Apple has a nonstandard extension, the flag POSIX_SPAWN_CLOEXEC_DEFAULT, which does this, but it doesn't seem to be present on other imeplementations.)
As far as I'm aware, *BSD could just use fork/exec the same way as on Linux. In particular, once I've removed the leftover B2G ChildPrivileges stuff in bug 1316153, process_util_linux.cc could be copied more or less verbatim.
Assignee | ||
Updated•7 years ago
|
Updated•7 years ago
|
Priority: -- → P3
Assignee | ||
Comment 2•6 years ago
|
||
I've been delaying this because I want to fix the known bug in the “Linux” implementation before saying that it's a good idea to switch the BSDs to it.
(On the other hand, the current BSD implementation is also incorrect in edge cases — see bug 1456919.)
Depends on: 1456911
Comment hidden (mozreview-request) |
Assignee | ||
Comment 4•6 years ago
|
||
Comment on attachment 8992055 [details]
Bug 1400051 - IPC: use process_util_linux on BSD and remove process_util_bsd.
r?glandium because this is almost entirely a build change.
f? what I hope is a reasonable set of BSD representatives because I don't want to just barge in and change their stuff without warning.
I've tested locally on FreeBSD 11, and ktraced to make sure that CloseSuperfluousFds is doing something reasonable.
Attachment #8992055 -
Flags: feedback?(martin)
Attachment #8992055 -
Flags: feedback?(landry)
Attachment #8992055 -
Flags: feedback?(jbeich)
Comment 5•6 years ago
|
||
mozreview-review |
Comment on attachment 8992055 [details]
Bug 1400051 - IPC: use process_util_linux on BSD and remove process_util_bsd.
https://reviewboard.mozilla.org/r/256976/#review264298
Attachment #8992055 -
Flags: review?(mh+mozilla) → review+
Comment 6•6 years ago
|
||
Comment on attachment 8992055 [details]
Bug 1400051 - IPC: use process_util_linux on BSD and remove process_util_bsd.
m-c builds fine with this diff, and nightly starts with 3 content processes. I've been able to browse a bit with it so i guess e10s works fine, but i dunno what codepaths are precisely affected by the change.
Attachment #8992055 -
Flags: feedback?(landry) → feedback+
Comment on attachment 8992055 [details]
Bug 1400051 - IPC: use process_util_linux on BSD and remove process_util_bsd.
Tested (mozilla-central changeset b5152aa87782 snapshot) on FreeBSD 10.4 i386 and 11.1 amd64. Both plugin (Adobe Flash) and content processes appear to work fine.
Not possible to test on DragonFly as mozilla-central requires Rust 1.27.0 but only 1.25.0 is packaged at the moment.
https://github.com/DragonFlyBSD/DeltaPorts/tree/master/ports/lang/rust/
http://muscles.dragonflybsd.org/synth/logs/lang___rust.log
Attachment #8992055 -
Flags: feedback?(jbeich) → feedback+
Comment on attachment 8992055 [details]
Bug 1400051 - IPC: use process_util_linux on BSD and remove process_util_bsd.
Also tested on FreeBSD 12.0 amd64 both default and --enable-debug build. Content processes work fine. I didn't try Flash plugin this time.
Assignee | ||
Comment 9•6 years ago
|
||
Rebased to deal with added comment in process_util_linux; carrying over r+.
Two BSDs confirming this works is probably enough; I'll land it now.
Attachment #8992055 -
Attachment is obsolete: true
Attachment #8992055 -
Flags: feedback?(martin)
Attachment #9010825 -
Flags: review+
Comment 10•6 years ago
|
||
Pushed by jedavis@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3d337c5ca457
IPC: use process_util_linux on BSD and remove process_util_bsd. r=glandium
Comment 11•6 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Updated•6 years ago
|
status-firefox57:
affected → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•