RESOLVED FIXED280237
Use UnixFileDescriptor in IPC and ProcessLauncher
https://bugs.webkit.org/show_bug.cgi?id=280237
Summary Use UnixFileDescriptor in IPC and ProcessLauncher
Michael Catanzaro
Reported 2024-09-23 17:04:56 PDT
Using UnixFileDescriptor wherever possible make it harder to accidentally leak file descriptors.
Attachments
Michael Catanzaro
Comment 1 2024-09-23 17:31:45 PDT
EWS
Comment 2 2024-12-18 04:44:48 PST
Committed 288001@main (0b420fd88a45): <https://commits.webkit.org/288001@main> Reviewed commits have been landed. Closing PR #34133 and removing active labels.
Diego Pino
Comment 3 2024-12-19 01:45:57 PST
I got the following build errror when building WPE using JHBuild: ``` [8099/8175] Building CXX object Source/WebKit/CMakeFiles/WebKit.dir///DerivedSources/WebKit/unified-sources/UnifiedSource-88d1702b-28.cpp.o FAILED: Source/WebKit/CMakeFiles/WebKit.dir///DerivedSources/WebKit/unified-sources/UnifiedSource-88d1702b-28.cpp.o /usr/bin/ccache /usr/bin/clang++-18 -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1 -DBUILDING_WPE__=1 -DBUILDING_WebKit -DDATADIR=\"/usr/local/share\" -DGETTEXT_PACKAGE=\"WPE\" -DHAVE_CONFIG_H=1 -DJSC_GLIB_API_ENABLED -DLIBDIR=\"/usr/local/lib\" -DLOCALEDIR=\"/usr/local/share/l In file included from /home/pwuser/webkit/WebKitBuild/WPE/Release/DerivedSources/WebKit/unified-sources/UnifiedSource-88d1702b-28.cpp:3: /home/pwuser/webkit/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:117:95: error: no viable conversion from 'typename remove_reference<UnixFileDescriptor &>::type' (aka 'WTF::UnixFileDescriptor') to 'int' 117 | m_processID = ProcessProviderLibWPE::singleton().launchProcess(m_launchOptions, argv, WTFMove(webkitSocketPair.client)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/pwuser/webkit/WebKitBuild/WPE/Release/WTF/Headers/wtf/StdLibExtras.h:1189:24: note: expanded from macro 'WTFMove' 1189 | #define WTFMove(value) std::move<WTF::CheckMoveParameter>(value) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/pwuser/webkit/Source/WebKit/UIProcess/Launcher/libwpe/ProcessProviderLibWPE.h:46:85: note: passing argument to parameter 'childProcessSocket' here 46 | ProcessID launchProcess(const ProcessLauncher::LaunchOptions&, char** argv, int childProcessSocket); | ^ In file included from /home/pwuser/webkit/WebKitBuild/WPE/Release/DerivedSources/WebKit/unified-sources/UnifiedSource-88d1702b-28.cpp:3: /home/pwuser/webkit/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:123:52: error: no matching constructor for initialization of 'IPC::Connection::Identifier' 123 | didFinishLaunchingProcess(m_processID, IPC::Connection::Identifier { WTFMove(serverSocket) }); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~ /home/pwuser/webkit/Source/WebKit/Platform/IPC/Connection.h:251:30: note: candidate constructor not viable: no known conversion from 'typename remove_reference<const UnixFileDescriptor &>::type' (aka 'const WTF::UnixFileDescriptor') to 'const Identifier' for 1st argument 251 | WTF_MAKE_NONCOPYABLE(Identifier); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~ /home/pwuser/webkit/WebKitBuild/WPE/Release/WTF/Headers/wtf/Noncopyable.h:24:5: note: expanded from macro 'WTF_MAKE_NONCOPYABLE' 24 | ClassName(const ClassName&) = delete; \ | ^ ~~~~~~~~~~~~~~~~ /home/pwuser/webkit/Source/WebKit/Platform/IPC/Connection.h:254:9: note: candidate constructor not viable: no known conversion from 'typename remove_reference<const UnixFileDescriptor &>::type' (aka 'const WTF::UnixFileDescriptor') to 'Identifier' for 1st argument 254 | Identifier(Identifier&&) = default; | ^ ~~~~~~~~~~~~ /home/pwuser/webkit/Source/WebKit/Platform/IPC/Connection.h:258:18: note: candidate constructor not viable: no known conversion from 'typename remove_reference<const UnixFileDescriptor &>::type' (aka 'const WTF::UnixFileDescriptor') to 'Handle' (aka 'IPC::ConnectionHandle') 258 | explicit Identifier(Handle&& handle) | ^ ~~~~~~~~~~~~~~~ /home/pwuser/webkit/Source/WebKit/Platform/IPC/Connection.h:262:18: note: candidate constructor not viable: 1st argument ('typename remove_reference<const UnixFileDescriptor &>::type' (aka 'const WTF::UnixFileDescriptor')) would lose const qualifier 262 | explicit Identifier(UnixFileDescriptor&& fd) | ^ ~~~~~~~~~~~~~~~~~~~~~~~ /home/pwuser/webkit/Source/WebKit/Platform/IPC/Connection.h:253:9: note: candidate constructor not viable: requires 0 arguments, but 1 was provided 253 | Identifier() = default; | ^ 2 errors generated. ```
Diego Pino
Comment 4 2024-12-19 01:47:50 PST
Diego Pino
Comment 5 2024-12-19 02:20:57 PST
The 'WPE-Linux-64bit-Release-Packaging-Nightly' bot is failing for the same reason. The build error occurs when BUBBLEWRAP_SANDBOX is disabled. The 'WPE-Linux-64bit-Release-Packaging-Nightly' bot builds with `bubblewrap-sandbox` disabled: ``` perl Tools/Scripts/build-webkit --no-fatal-warnings --release --no-bubblewrap-sandbox --wpe ``` https://build.webkit.org/#/builders/1322/builds/68/steps/10/logs/stdio
EWS
Comment 6 2024-12-19 06:04:40 PST
Committed 288083@main (a7d65dca86e3): <https://commits.webkit.org/288083@main> Reviewed commits have been landed. Closing PR #38198 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.