Bug 1518674

Summary: [Wayland] Crash under wayland_drm_init()
Product: [Fedora] Fedora Reporter: Milan Crha <mcrha>
Component: webkit2gtk3Assignee: Tomas Popela <tpopela>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: ajax, alexl, awilliam, bskeggs, caillon+fedoraproject, fschwarz, ignatenko, jan.public, jglisse, john.j5live, mcatanzaro+wrong-account-do-not-cc, rahbcca, rclark, rhughes, rstrode, thatslyude, tpopela
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-10 00:28:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Milan Crha 2017-11-29 12:51:49 UTC
I didn't find anything related to the wayland_drm_init(), thus filling it here. This is a rawhide in a virtual machine using QXL video and running GNOME under Wayland, also having installed:
   mesa-libEGL-17.3.0-0.4.rc3.fc28.x86_64
   webkitgtk4-2.19.2-1.fc28.x86_64

Trying to run
   /usr/libexec/webkit2gtk-4.0/MiniBrowser
leads to a crash with the below backtrace and some printed data from gdb. I know there had been something about "proper video in virtual machines", but I do not recall any details, though I've a feeling it didn't mention QXL. I can be wrong. The thing is that GNOME as such runs, it doesn't crash.

The gdb output:

Thread 1 "MiniBrowser" received signal SIGSEGV, Segmentation fault.
0x00007f4998425831 in __strlen_avx2 () from /lib64/libc.so.6
Missing separate debuginfos, use: dnf debuginfo-install webkitgtk4-2.19.2-1.fc28.x86_64 webkitgtk4-devel-2.19.2-1.fc28.x86_64
(gdb) bt
#0  0x00007f4998425831 in __strlen_avx2 () at /lib64/libc.so.6
#1  0x00007f49983534be in strdup () at /lib64/libc.so.6
#2  0x00007f493bbe7dca in wayland_drm_init (display=0x5555555dcf70, device_name=0x0, callbacks=
    0x7fffffffd570, user_data=0x5555555df660, flags=0) at wayland-drm.c:272
#3  0x00007f493bbdb441 in dri2_bind_wayland_display_wl (drv=<optimized out>, disp=0x5555555df660, wl_dpy=0x5555555dcf70) at drivers/dri2/egl_dri2.c:2817
#4  0x00007f493bbd1a68 in eglBindWaylandDisplayWL (dpy=0x5555555df660, display=0x5555555dcf70)
    at main/eglapi.c:2176
#5  0x00007f49a546976a in WebKit::WaylandCompositor::WaylandCompositor() () at /lib64/libwebkit2gtk-4.0.so.37
#6  0x00007f49a5469a18 in WebKit::WaylandCompositor::singleton() () at /lib64/libwebkit2gtk-4.0.so.37
#7  0x00007f49a54655df in WebKit::HardwareAccelerationManager::HardwareAccelerationManager() ()
    at /lib64/libwebkit2gtk-4.0.so.37
#8  0x00007f49a5465628 in WebKit::HardwareAccelerationManager::singleton() () at /lib64/libwebkit2gtk-4.0.so.37
#9  0x00007f49a546f82d in WebKit::WebPreferences::platformInitializeStore() ()
    at /lib64/libwebkit2gtk-4.0.so.37
#10 0x00007f49a5250cc2 in WebKit::WebPreferences::create(WTF::String const&, WTF::String const&, WTF::String const&) () at /lib64/libwebkit2gtk-4.0.so.37
#11 0x00007f49a541da56 in webkit_settings_init(_WebKitSettings*) () at /lib64/libwebkit2gtk-4.0.so.37
#12 0x00007f49a2c21f2d in g_type_create_instance () at /lib64/libgobject-2.0.so.0
#13 0x00007f49a2c02db8 in g_object_new_internal () at /lib64/libgobject-2.0.so.0
#14 0x00007f49a2c04555 in g_object_new_with_properties () at /lib64/libgobject-2.0.so.0
#15 0x00007f49a2c04fd1 in g_object_new () at /lib64/libgobject-2.0.so.0
#16 0x00007f49a541e1da in webkit_settings_new () at /lib64/libwebkit2gtk-4.0.so.37
#17 0x0000555555560b6d in main ()
(gdb) f 2
#2  0x00007f493bbe7dca in wayland_drm_init (display=0x5555555dcf70, device_name=0x0, callbacks=0x7fffffffd570, 
    user_data=0x5555555df660, flags=0) at wayland-drm.c:272
272		drm->device_name = strdup(device_name);
(gdb) f 3
#3  0x00007f493bbdb441 in dri2_bind_wayland_display_wl (drv=<optimized out>, disp=0x5555555df660, 
    wl_dpy=0x5555555dcf70) at drivers/dri2/egl_dri2.c:2817
2817	           wayland_drm_init(wl_dpy, dri2_dpy->device_name,
(gdb) p dri2_dpy
$1 = (struct dri2_egl_display *) 0x5555555dffd0
(gdb) p *dri2_dpy
$2 = {vtbl = 0x7f493bdfc0c0 <dri2_wl_swrast_display_vtbl>, dri2_major = 0, dri2_minor = 0, 
  dri_screen = 0x5555555e1ce0, own_dri_screen = true, driver_configs = 0x55555563e280, 
  driver = 0x5555556508a0, core = 0x7f493a750620, image_driver = 0x0, dri2 = 0x0, swrast = 0x7f493a72b860, 
  flush = 0x0, tex_buffer = 0x7f493a72b980, image = 0x7f493a757900, robustness = 0x0, 
  no_error = 0x7f493a72b7a0, config = 0x7f493a72b820, fence = 0x7f493a72b9c0, rendererQuery = 0x7f493a72ba20, 
  interop = 0x0, fd = -1, ref_count = 2, own_device = false, invalidate_available = false, 
  min_swap_interval = 0, max_swap_interval = 1, default_swap_interval = 1, gbm_dri = 0x0, 
  driver_name = 0x5555555ddd10 "swrast", loader_extensions = 0x7f493bdfd1c0 <swrast_loader_extensions>, 
  driver_extensions = 0x7f493a757880, conn = 0x0, screen = 0x0, swap_available = false, loader_dri3_ext = {
    core = 0x0, image_driver = 0x0, flush = 0x0, config = 0x0, tex_buffer = 0x0, image = 0x0}, 
  wl_dpy = 0x55555559e030, wl_dpy_wrapper = 0x5555555d7620, wl_registry = 0x5555555e95f0, wl_server_drm = 0x0, 
  wl_drm = 0x0, wl_shm = 0x5555555e9800, wl_queue = 0x5555555def00, wl_dmabuf = 0x0, wl_modifiers = {
    xrgb8888 = {head = 0, tail = 0, element_size = 0, size = 0, data = 0x0}, argb8888 = {head = 0, tail = 0, 
      element_size = 0, size = 0, data = 0x0}, rgb565 = {head = 0, tail = 0, element_size = 0, size = 0, 
      data = 0x0}}, authenticated = false, formats = 3, capabilities = 0, device_name = 0x0, 
  is_render_node = false, is_different_gpu = false}
(gdb) q

Comment 1 Adam Williamson 2018-01-24 16:12:27 UTC
I reported a bug upstream to yelp which the devs decided is the same as this:

https://bugzilla.gnome.org/show_bug.cgi?id=790811

yelp crashes in the same way, in the same circumstance (in a VM), which is obviously important.

Comment 2 Fedora End Of Life 2018-02-20 15:39:08 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 28 development cycle.
Changing version to '28'.

Comment 3 Adam Williamson 2018-03-02 18:20:01 UTC
Per Frederic Crozat, this turned out to be a webkit2gtk3 bug:

https://bugs.webkit.org/show_bug.cgi?id=182490

and should be fixed as of 2.19.91:

https://trac.webkit.org/changeset/228272/webkit

Will confirm.

Comment 4 Adam Williamson 2018-03-10 00:28:01 UTC
Fix confirmed with a recent 28 Workstation live.

Comment 5 Milan Crha 2018-03-12 12:38:49 UTC
Thanks, I can confirm it's working with current rawhide as well.

Comment 6 Milan Crha 2018-03-13 09:39:11 UTC
(In reply to Milan Crha from comment #5)
> Thanks, I can confirm it's working with current rawhide as well.

So I've just updated my Fedora 27 like 20 minutes ago, then I ran evolution and epiphany under GNOME Wayland and it crashed there the same way as in comment #0. That's kind of regression in Fedora 27. That's with
   webkitgtk4-2.18.6-1.fc27.x86_64
   mesa-dri-drivers-17.3.6-1.fc27.x86_64
The update did the mesa-dri-drivers, thus I downgraded it to
   mesa-dri-drivers-17.2.2-4.fc27.x86_64
and I can run epiphany and evolution with no issue now.

If this is really in webkitgtk4, then it should be updated to contain the upstream fix in the Fedora 27 as well.

Comment 7 Tomas Popela 2018-03-13 10:01:40 UTC
(In reply to Milan Crha from comment #6)
> If this is really in webkitgtk4, then it should be updated to contain the
> upstream fix in the Fedora 27 as well.

You can try the new WebKitGTK+ 2.20 that will go that F27 - https://bodhi.fedoraproject.org/updates/FEDORA-2018-c923533479

Comment 8 Milan Crha 2018-03-13 10:09:42 UTC
Thanks for the hint, using
   webkitgtk4-2.20.0-1.fc26.x86_64
with up to date mesa-dri-drivers makes it work again.

Comment 9 Michael Catanzaro 2018-03-28 16:29:12 UTC
*** Bug 1553894 has been marked as a duplicate of this bug. ***