RESOLVED FIXED 280073
REGRESSION(283414@main): [WPE][GTK] File descriptor leak if process launch is canceled immediately
https://bugs.webkit.org/show_bug.cgi?id=280073
Summary REGRESSION(283414@main): [WPE][GTK] File descriptor leak if process launch is...
Michael Catanzaro
Reported 2024-09-20 10:41:24 PDT
Since 283414@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
Attachments
Michael Catanzaro
Comment 1 2024-09-23 08:30:10 PDT
Michael Catanzaro
Comment 2 2024-09-23 17:05:06 PDT
Follow up: bug #280237
EWS
Comment 3 2024-09-24 08:18:03 PDT
Committed 284159@main (7dd6aeafdd8e): <https://commits.webkit.org/284159@main> Reviewed commits have been landed. Closing PR #34089 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.