Summary: | [GTK] gobject-introspection on package build with webkit2gtk fails without active X session | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alberto Garcia <berto> | ||||||
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Minor | CC: | bitlord0xff, bugs-noreply, cgarcia, mcatanzaro | ||||||
Priority: | P2 | ||||||||
Version: | Other | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Alberto Garcia
2016-10-07 03:41:17 PDT
Disabling AC mode sounds like the easiest solution in the short term (until this options disappears if we ever remove the non Ac support). In the long term we might have support for headless environments, or better handle the case where there's no display. I told the Liferea maintainer to set WEBKIT_DISABLE_COMPOSITING_MODE=1 while building the package, and that's what they're doing now. That's nuts though. So g-ir-scanner actually dlopens WebKit and calls functions, that's why this crash is happening? (In reply to comment #3) > That's nuts though. > > So g-ir-scanner actually dlopens WebKit and calls functions, that's why this > crash is happening? IIRC g-ir-scanner calls liferea (I don't remember the command-line options), which is already linked against WebKit, and it's the webkit_settings_new() call in Liferea that calls XCompositeQueryExtension(), which crashes the process. This is the actual command called by g-ir-scanner: ./liferea --introspect-dump=/tmp/tmp-introspectw0lgbi6d/functions.txt,/tmp/tmp-introspectw0lgbi6d/dump.xml And this is the backtrace: Thread 1 "liferea" received signal SIGSEGV, Segmentation fault. 0xf0deceee in XQueryExtension () from /usr/lib/i386-linux-gnu/libX11.so.6 (gdb) bt #0 0xf0deceee in XQueryExtension () from /usr/lib/i386-linux-gnu/libX11.so.6 #1 0xf0de0c6c in XInitExtension () from /usr/lib/i386-linux-gnu/libX11.so.6 #2 0xf0db9cc8 in XCompositeFindDisplay () from /usr/lib/i386-linux-gnu/libXcomposite.so.1 #3 0xf0db9e3b in XCompositeQueryExtension () from /usr/lib/i386-linux-gnu/libXcomposite.so.1 #4 0xf678ed15 in WebCore::PlatformDisplayX11::supportsXComposite () at ./Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp:80 #5 0xf58518f5 in WebKit::WebPreferences::platformInitializeStore () at ./Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp:63 #6 0xf56198ff in WebKit::WebPreferences::WebPreferences () at ./Source/WebKit2/UIProcess/WebPreferences.cpp:63 #7 0xf5619940 in WebKit::WebPreferences::create () at ./Source/WebKit2/UIProcess/WebPreferences.cpp:43 #8 0xf5807493 in _WebKitSettingsPrivate::_WebKitSettingsPrivate () at ./Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp:51 #9 webkit_settings_init () at ./Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp:94 #10 0xf46714b0 in g_type_create_instance () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 #11 0xf4652bc7 in ?? () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 #12 0xf465462c in g_object_newv () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 #13 0xf4654cbd in g_object_new () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 #14 0xf5807b9f in webkit_settings_new () at ./Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp:1294 #15 0x565a8d9e in liferea_webkit_impl_init (self=0x566115b0) at webkit.c:345 #16 0xf46714b0 in g_type_create_instance () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 #17 0xf4652bc7 in ?? () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 #18 0xf465462c in g_object_newv () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 #19 0xf4654cbd in g_object_new () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 #20 0x565a9890 in liferea_webkit_impl_new () at webkit.c:107 #21 liferea_webkit_init () at webkit.c:421 #22 0x56598e8e in liferea_htmlview_class_init (klass=0x56618000) at liferea_htmlview.c:203 #23 liferea_htmlview_class_intern_init (klass=0x56618000) at liferea_htmlview.c:144 #24 0xf466e337 in g_type_class_ref () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 #25 0xf46a3da5 in dump_properties (type=type@entry=1449215696, out=out@entry=0x56614c38) at girepository/gdump.c:132 #26 0xf46a49ff in dump_object_type (out=0x56614c38, symbol=<optimized out>, type=<optimized out>) at girepository/gdump.c:255 #27 dump_type (out=0x56614c38, symbol=<optimized out>, type=<optimized out>) at girepository/gdump.c:397 #28 g_irepository_dump (arg=0x566183b8 "/tmp/tmp-introspectw0lgbi6d/functions.txt,/tmp/tmp-introspectw0lgbi6d/dump.xml", error=0xffffca38) at girepository/gdump.c:542 #29 0xf46aaef1 in g_irepository_introspect_cb (option_name=0x56610288 "--introspect-dump", value=0x566183b8 "/tmp/tmp-introspectw0lgbi6d/functions.txt,/tmp/tmp-introspectw0lgbi6d/dump.xml", data=0x0, error=0xffffcbc0) at girepository/girepository.c:1593 #30 0xf4565c2d in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0 #31 0xf4566074 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0 #32 0xf4567973 in g_option_context_parse () from /lib/i386-linux-gnu/libglib-2.0.so.0 #33 0x5656991d in main (argc=<optimized out>, argv=<optimized out>) at main.c:209 Created attachment 291797 [details]
Patch
Ok, I actually think this is our bug. If we know that the display is not set we should simply return false instead of calling a function that we know is going to crash.
Comment on attachment 291797 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=291797&action=review > Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp:78 > - if (!m_supportsXComposite) { > + if (!m_supportsXComposite && m_display) { I agree but this will crash in debug builds. m_supportsXComposite is Optional<bool>, if we don't initialize it the .value() below will assert in debug because the value is not engaged. So, simply add an early return before this if so that when m_display is nullptr, the optional value is not even used. > Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp:87 > - if (!m_supportsXDamage) { > + if (!m_supportsXDamage && m_display) { And same here Created attachment 291800 [details]
Patch #2
How about this one?
This also removes the need to have the #else (GTK) in supportsXDamage()
Comment on attachment 291800 [details]
Patch #2
Ok.
Committed r207403: <http://trac.webkit.org/changeset/207403> |