[Webkit-unassigned] [Bug 245784] New: REGRESSION(254232 at main): Causes process launching to use fork + exec instead of posix_spawn

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 28 08:19:57 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=245784

            Bug ID: 245784
           Summary: REGRESSION(254232 at main): Causes process launching to
                    use fork + exec instead of posix_spawn
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKitGTK
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mcatanzaro at gnome.org
                CC: bugs-noreply at webkitgtk.org

254232 at main removed use of G_SUBPROCESS_FLAGS_INHERIT_FDS since we actually do not ever want to inherit fds into our child processes, except for those that we explicitly pass along using g_subprocess_launcher_take_fd(). This was a good change since it makes WebKit more robust to file descriptor leaks, but there is an unfortunate side effect: it prevents gspawn from using posix_spawn() to launch subprocesses, so we wind up falling back to fork() and exec() instead. I had left an insufficient warning comment about this:

     // Warning: do not set a child setup function, because we want GIO to be able to spawn with
     // posix_spawn() rather than fork()/exec(), in order to better accommodate applications that use
     // a huge amount of memory or address space in the UI process, like Eclipse.
     GRefPtr<GSubprocessLauncher> launcher = adoptGRef(g_subprocess_launcher_new(G_SUBPROCESS_FLAGS_INHERIT_FDS));

but I only mentioned one of the many things that could cause us to fall back to posix_spawn(), and didn't mention that G_SUBPROCESS_FLAGS_INHERIT_FDS was important.

How unfortunate. :(

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220928/fce18128/attachment-0001.htm>


More information about the webkit-unassigned mailing list