October 22, 2024
https://issues.dlang.org/show_bug.cgi?id=24824

          Issue ID: 24824
           Summary: std.process.browse returns on failure in forked child
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: phobos
          Assignee: nobody@puremagic.com
          Reporter: schveiguy@gmail.com

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.

--