Bug 24824 – std.process.browse returns on failure in forked child

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2024-10-22T02:10:10Z
Last change time
2024-11-17T01:03:59Z
Keywords
pull
Assigned to
No Owner
Creator
Steven Schveighoffer
See also
https://issues.dlang.org/show_bug.cgi?id=6496

Comments

Comment #0 by schveiguy — 2024-10-22T02:10:10Z
On posix platforms besides OSX, std.process.browse uses a fork/exec to open a browser window. When this fails, it's the exec that fails. However, the function returns instead of exits. This means it keeps executing whatever it was doing in the parent process when `browse` was called! And with only one thread, with everything else in the process still allocated/opened. This is disastrous. The process should exit right away. Technically this should be redone to use std.process utilities directly, but I just want to make sure this bug is fixed, so I'm making a separate bug. I'll open a separate issue on the enhancement to replace browse internals with std.process regular functions. That originally was captured in issue 6496, but that was closed incorrectly.
Comment #1 by dlang-bot — 2024-10-22T02:25:22Z
@schveiguy updated dlang/phobos pull request #9065 "Fix issue 24824 - ensure we exit a child that does not succeed in exec." fixing this issue: - Fix Bugzilla Issue 24824 - ensure we exit a child that does not succeed in exec. https://github.com/dlang/phobos/pull/9065
Comment #2 by schveiguy — 2024-10-22T04:12:57Z
Note, I guess OSX is included here, but `open` always exists, so you wouldn't ever see this issue.
Comment #3 by dlang-bot — 2024-10-22T07:10:31Z
dlang/phobos pull request #9065 "Fix issue 24824 - ensure we exit a child that does not succeed in exec." was merged into stable: - 3c9ba2b6a4333ad171a617e265dd577dec2f015f by Steven Schveighoffer: Fix Bugzilla Issue 24824 - ensure we exit a child that does not succeed in exec. https://github.com/dlang/phobos/pull/9065
Comment #4 by dlang-bot — 2024-11-17T01:03:59Z
dlang/phobos pull request #9086 "Merge stable" was merged into master: - 10076badd83324c84931cf599a14059f3a298694 by Steven Schveighoffer: Fix Bugzilla Issue 24824 - ensure we exit a child that does not succeed in exec. (#9065) https://github.com/dlang/phobos/pull/9086