[Webkit-unassigned] [Bug 245784] 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
Fri Sep 30 07:40:30 PDT 2022


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

--- Comment #1 from Michael Catanzaro <mcatanzaro at gnome.org> ---
So I've been thinking about this... it really needs to be more robust, less fragile. We could add a new flag in both GSpawnFlags and GSubprocessFlags to cause process launching to fail if fork()/exec() is required. The flags would do nothing on Windows. That way, we can't mess up anymore.

Sadly I can't think of any way to keep the nice behavior of closing all leaked file descriptors. Carlos, are you OK with reverting this commit and allowing leaked descriptors to actually leak again? It is unfortunate, but seems we have to choose between this or posix_spawn(), because there is no race-free way to close descriptors with posix_spawn() except to ensure they all have CLOEXEC flags set. It's possible to do with fork() only because no secondary threads exist after fork() is called. Anyway, I think this is OK because CLOEXEC is really the proper solution to fd leaks anyway: it's nice that gspawn can close anything we miss, but not mandatory IMO. Do you agree?

-- 
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/20220930/a351427d/attachment.htm>


More information about the webkit-unassigned mailing list