Bug 280237
| Summary: | Use UnixFileDescriptor in IPC and ProcessLauncher | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> |
| Component: | WebKitGTK | Assignee: | Diego Pino <dpino> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bugs-noreply, dpino, webkit-bug-importer |
| Priority: | P2 | ||
| Version: | Other | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=280073 | ||
Michael Catanzaro
Using UnixFileDescriptor wherever possible make it harder to accidentally leak file descriptors.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Michael Catanzaro
Pull request: https://github.com/WebKit/WebKit/pull/34133
EWS
Committed 288001@main (0b420fd88a45): <https://commits.webkit.org/288001@main>
Reviewed commits have been landed. Closing PR #34133 and removing active labels.
Diego Pino
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
Re-opening for pull request https://github.com/webkit/webkit/pull/38198
Diego Pino
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
Committed 288083@main (a7d65dca86e3): <https://commits.webkit.org/288083@main>
Reviewed commits have been landed. Closing PR #38198 and removing active labels.