[Webkit-unassigned] [Bug 280073] New: REGRESSION(283414 at main): [WPE][GTK] File descriptor leak if process launch is canceled immediately

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 20 10:41:24 PDT 2024


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

            Bug ID: 280073
           Summary: REGRESSION(283414 at main): [WPE][GTK] File descriptor
                    leak if process launch is canceled immediately
           Product: WebKit
           Version: Other
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKitGTK
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mcatanzaro at redhat.com
                CC: bugs-noreply at webkitgtk.org

Since 283414 at main, if the ProcessLauncher is destroyed before received a reply from its pid socket, the server end of the socket is leaked. The bug is here in ProcessLauncherGLib.cpp's ProcessLauncher::launchProcess:

    m_socketMonitor.start(pidSocket.get(), G_IO_IN, RunLoop::main(), [protectedThis = Ref { *this }, this, pidSocket, serverSocket = WTFMove(webkitSocketPair.server)](GIOCondition condition) -> gboolean {

That code moves ownership of the socket to the lambda function, without resource-acquisition-is-initialization semantics. If the socket monitor is destroyed before executing the callback, the socket is leaked. Using UnixFileDescriptor like we're supposed to would have prevented this, but I was overconfident because the code seemed simple.

See also: bug #280061

-- 
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/20240920/3da96aea/attachment.htm>


More information about the webkit-unassigned mailing list