Bug 280605

Summary: REGRESSION(284171@main): [GTK] build link error, startup crash
Product: WebKit Reporter: Jim Mason <jmason>
Component: WebKitGTKAssignee: Carlos Garcia Campos <cgarcia>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, cgarcia, mcatanzaro, pgriffis
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
regression-284171-fix.patch none

Jim Mason
Reported 2024-09-30 03:12:38 PDT
GTK3 X11 USE_SKIA=OFF There are two issues. I am combining, as both relate to commit 284171@main. First, the commit maintains declaration of the destructor ScrollbarThemeGtk::~ScrollbarThemeGtk but removes its implementation. As a result, the build fails with an unresolved symbol link error. Restoring the (trivial) dtor implementation that was removed by the commit clears the issue and the build finishes. That this is not picked up by continuous integration or by other devs suggests I am using code paths that are not commonly traversed. This leads us to the second issue: After the build has completed successfully, upon startup, webkit throws a SIGSEGV. Below are backtraces from Minibrowser and Epiphany. Minibrowser: Thread 2 received signal SIGSEGV, Segmentation fault. #0 0x00007ff6b34292d8 in WTF::Detail::CallableWrapper<webkitWebViewBaseCreateWebPage(_WebKitWebViewBase*, WTF::Ref<API::PageConfiguration, WTF::RawPtrTraits<API::PageConfiguration>, WTF::DefaultRefDerefTraits<API::PageConfiguration> >&&)::$_0, void, WebCore::SystemSettingsState const&>::call(WebCore::SystemSettingsState const&) () at /build/rtutils/components/desktop/webkitgtk4-dev/build/prototype/i386/usr/lib/amd64/libwebkit2gtk-4.0.so.37 #1 0x00007ff6b53ba636 in WebCore::SystemSettings::updateSettings(WebCore::SystemSettingsState&&) () at /build/rtutils/components/desktop/webkitgtk4-dev/build/prototype/i386/usr/lib/amd64/libwebkit2gtk-4.0.so.37 #2 0x00007ff6b34c0d2d in WebKit::SystemSettingsManager::settingsDidChange() () at /build/rtutils/components/desktop/webkitgtk4-dev/build/prototype/i386/usr/lib/amd64/libwebkit2gtk-4.0.so.37 #3 0x00007ff6b34c077d in WebKit::SystemSettingsManager::initialize() () at /build/rtutils/components/desktop/webkitgtk4-dev/build/prototype/i386/usr/lib/amd64/libwebkit2gtk-4.0.so.37 #4 0x00007ff6b34c6beb in WebKit::Display::Display() () at /build/rtutils/components/desktop/webkitgtk4-dev/build/prototype/i386/usr/lib/amd64/libwebkit2gtk-4.0.so.37 Epiphany: Thread 2 received signal SIGSEGV, Segmentation fault. #0 0x00007ffbfa2dca24 in WebKit::WebPageProxy::pageZoomFactor() const () at /usr/lib/64/libwebkit2gtk-4.0.so.37 #1 0x00007ffbfa42930b in WTF::Detail::CallableWrapper<webkitWebViewBaseCreateWebPage(_WebKitWebViewBase*, WTF::Ref<API::PageConfiguration, WTF::RawPtrTraits<API::PageConfiguration>, WTF::DefaultRefDerefTraits<API::PageConfiguration> >&&)::$_0, void, WebCore::SystemSettingsState const&>::call(WebCore::SystemSettingsState const&) () at /usr/lib/64/libwebkit2gtk-4.0.so.37 #2 0x00007ffbfc3ba636 in WebCore::SystemSettings::updateSettings(WebCore::SystemSettingsState&&) () at /usr/lib/64/libwebkit2gtk-4.0.so.37 #3 0x00007ffbfa4c0d2d in WebKit::SystemSettingsManager::settingsDidChange() () at /usr/lib/64/libwebkit2gtk-4.0.so.37 #4 0x00007ffbfa4c077d in WebKit::SystemSettingsManager::initialize() () at /usr/lib/64/libwebkit2gtk-4.0.so.37
Attachments
regression-284171-fix.patch (1.21 KB, text/plain)
2024-09-30 15:53 PDT, Jim Mason
no flags
Carlos Garcia Campos
Comment 1 2024-09-30 03:19:19 PDT
Why do you build with cairo?
Jim Mason
Comment 2 2024-09-30 04:56:26 PDT
(In reply to Carlos Garcia Campos from comment #1) > Why do you build with cairo? There were font irregularities on some websites with skia. I spent some time tring to map out the situation, but reverted to cairo for now.
Carlos Garcia Campos
Comment 3 2024-09-30 06:00:36 PDT
We plan to remove Cairo at some point.
Jim Mason
Comment 4 2024-09-30 08:47:24 PDT
I am still getting the crash with USE_SKIA=ON.
Michael Catanzaro
Comment 5 2024-09-30 08:58:58 PDT
The stack traces don't have enough detail to guess what's wrong.
Jim Mason
Comment 6 2024-09-30 15:53:34 PDT
Created attachment 472745 [details] regression-284171-fix.patch (In reply to Michael Catanzaro from comment #5) > The stack traces don't have enough detail to guess what's wrong. You are becoming cynical in your dotage ;-) We see at the top of the backtrace a lambda function called by `WebCore::SystemSettings::updateSettings`. The lambda was installed by `webkitWebViewBaseCreateWebPage`. The problem is, in the lambda, capture of the variable `webkitWebViewBase` is by reference. This seems to be the source of the crash. The variable will have gone out of scope when the lambda runs. The variable is a pointer; we really want to capture the pointer, not the temporal location that holds the pointer. If I change the capture to be by-value (hence, the pointer), the crash disappears. I have attached the patch I used to clear both problems. However, there could well be other similar issues lurking in 284171@main; I suggest a review of the full commit just to be certain.
Michael Catanzaro
Comment 7 2024-09-30 19:11:23 PDT
Good job!
Carlos Garcia Campos
Comment 8 2024-10-01 00:35:15 PDT
(In reply to Jim Mason from comment #4) > I am still getting the crash with USE_SKIA=ON. Sure, I didn't mean the problem was cairo, I was just curious, and wanted to warn you that cairo will be removed eventually.
Carlos Garcia Campos
Comment 9 2024-10-16 04:59:23 PDT
Carlos Garcia Campos
Comment 10 2024-10-16 05:00:50 PDT
Oh, I missed the patch here, I'll update the pr, sorry
EWS
Comment 11 2024-10-16 06:35:28 PDT
Committed 285258@main (6e84933e63db): <https://commits.webkit.org/285258@main> Reviewed commits have been landed. Closing PR #35276 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.