[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#929346: atril: Segmentation when launche atril on wayland on chromeos



Control: tags -1 patch


Dear Maintainer,
I am just looking at some random bug reports with crashes.

In this case I think atril is or was not prepared to run
in a wayland session.

Attached patch is based on some porting guide to wayland and
with that atril shows its main window. Nothing more was tested.

I tested with a current Buster VM too - there this crash was
not to observe. But, as far as I see, atril got no changes
in ev_application_open_window like in my patch.
Therefore maybe Gtk got a fix to avoid this?

Should this bug marked fixed for atril/1.20.3-1 ?
Or marked as closed as Buster does not show it?

Kind regards,
Bernhard


(gdb) bt
#0  0x0000000000000000 in  ()
#1  0x00007fe7bfec2129 in g_hash_table_lookup_node (hash_return=<synthetic pointer>, key=0x67, hash_table=0x565449548100) at ././glib/ghash.c:375
#2  0x00007fe7bfec2129 in g_hash_table_lookup (hash_table=0x565449548100, key=key@entry=0x67) at ././glib/ghash.c:1147
#3  0x00007fe7c1d4850c in lookup_cached_xatom (atom=0x67, display=0x565449535040 [GdkWaylandDisplay]) at ././gdk/x11/gdkproperty-x11.c:76
#4  0x00007fe7c1d4850c in gdk_x11_atom_to_xatom_for_display (display=0x565449535040 [GdkWaylandDisplay], atom=0x67) at ././gdk/x11/gdkproperty-x11.c:109
#5  0x00007fe7c1d574c9 in gdk_x11_get_server_time (window=window@entry=0x56544953b7e0 [GdkWaylandWindow]) at ././gdk/x11/gdkwindow-x11.c:5534
#6  0x0000565447e18c8b in ev_application_open_window (application=<optimized out>, screen=<optimized out>, timestamp=0) at ev-application.c:718
#7  0x0000565447e148bc in load_files (files=0x0) at main.c:168
#8  0x0000565447e148bc in main (argc=<optimized out>, argv=<optimized out>) at main.c:268
Description: Avoid crash running within wayland

Author: Bernhard Ã?belacker <bernhardu@mailbox.org>
Bug-Debian: https://bugs.debian.org/929346
Forwarded: no
Last-Update: 2019-05-29

--- atril-1.16.1.orig/shell/ev-application.c
+++ atril-1.16.1/shell/ev-application.c
@@ -623,11 +623,14 @@ ev_application_open_uri_in_window (EvApp
 
 	gdk_window = gtk_widget_get_window (GTK_WIDGET (ev_window));
 
-	if (timestamp <= 0)
-		timestamp = gdk_x11_get_server_time (gdk_window);
-	gdk_x11_window_set_user_time (gdk_window, timestamp);
-
-	gtk_window_present (GTK_WINDOW (ev_window));
+#ifdef GDK_WINDOWING_X11
+	if (GDK_IS_X11_WINDOW (gdk_window)) {
+		if (timestamp <= 0)
+			timestamp = gdk_x11_get_server_time (gdk_window);
+		gdk_x11_window_set_user_time (gdk_window, timestamp);
+	} else
+#endif
+		gtk_window_present (GTK_WINDOW (ev_window));
 }
 
 static void
@@ -714,11 +717,14 @@ ev_application_open_window (EvApplicatio
 
 	gdk_window = gtk_widget_get_window (GTK_WIDGET (new_window));
 
-	if (timestamp <= 0)
-		timestamp = gdk_x11_get_server_time (gdk_window);
-	gdk_x11_window_set_user_time (gdk_window, timestamp);
-
-	gtk_window_present (GTK_WINDOW (new_window));
+#ifdef GDK_WINDOWING_X11
+	if (GDK_IS_X11_WINDOW (gdk_window)) {
+		if (timestamp <= 0)
+			timestamp = gdk_x11_get_server_time (gdk_window);
+		gdk_x11_window_set_user_time (gdk_window, timestamp);
+	} else
+#endif
+		gtk_window_present (GTK_WINDOW (new_window));
 }
 
 #ifdef ENABLE_DBUS
# Stretch amd64 qemu VM 2019-05-29


apt update
apt dist-upgrade


apt install systemd-coredump gnome fakeroot mc linux-perf-4.9 gdb valgrind atril atril-dbgsym libgtk-3-0-dbgsym libglib2.0-0-dbg
apt build-dep atril



mkdir /home/benutzer/source/atril/orig -p
cd    /home/benutzer/source/atril/orig
apt source atril
cd


reboot
# login with Gnome with Wayland


atril


#############

benutzer@debian:~$ atril
WaylandCompositor requires eglCreateImage and eglDestroyImage.
Nested Wayland compositor could not initialize EGL
Speicherzugriffsfehler (Speicherabzug geschrieben)



dmesg
[  949.126009] atril[1898]: segfault at 0 ip           (null) sp 00007fff20006c58 error 14 in atril[565447df7000+66000]


journalctl --no-pager
Mai 29 13:31:30 debian kernel: atril[1898]: segfault at 0 ip           (null) sp 00007fff20006c58 error 14 in atril[565447df7000+66000]
Mai 29 13:31:30 debian systemd[1]: Created slice system-systemd\x2dcoredump.slice.
Mai 29 13:31:30 debian systemd[1]: Started Process Core Dump (PID 1926/UID 0).
Mai 29 13:31:30 debian systemd-coredump[1927]: Process 1898 (atril) of user 1000 dumped core.
                                               
                                               Stack trace of thread 1898:
                                               #0  0x0000000000000000 n/a (n/a)


root@debian:~# coredumpctl list
TIME                            PID   UID   GID SIG COREFILE EXE
Wed 2019-05-29 13:31:30 CEST   1898  1000  1000  11 present  /usr/bin/atril


root@debian:~# coredumpctl gdb 1898                        
           PID: 1898 (atril)
           UID: 1000 (benutzer)
           GID: 1000 (benutzer)
        Signal: 11 (SEGV)
     Timestamp: Wed 2019-05-29 13:31:30 CEST (3min 31s ago)
  Command Line: atril
    Executable: /usr/bin/atril
 Control Group: /user.slice/user-1000.slice/user@1000.service/gnome-terminal-server.service
          Unit: user@1000.service
     User Unit: gnome-terminal-server.service
         Slice: user-1000.slice
     Owner UID: 1000 (benutzer)
       Boot ID: ab9b3c50d7f44e0284f60f6ffcd4463e
    Machine ID: 9e5901179cfe4b73bc18669e6a6e0ab9
      Hostname: debian
       Storage: /var/lib/systemd/coredump/core.atril.1000.ab9b3c50d7f44e0284f60f6ffcd4463e.1898.1559129490000000000000.lz4
       Message: Process 1898 (atril) of user 1000 dumped core.
                
                Stack trace of thread 1898:
                #0  0x0000000000000000 n/a (n/a)

GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/atril...(no debugging symbols found)...done.
[New LWP 1898]
[New LWP 1899]
[New LWP 1905]
[New LWP 1909]
[New LWP 1907]
[New LWP 1904]
[New LWP 1903]
[New LWP 1906]
[New LWP 1913]
[New LWP 1902]
[New LWP 1912]
[New LWP 1914]
[New LWP 1910]
[New LWP 1901]
[New LWP 1900]
[New LWP 1911]
[New LWP 1908]
[New LWP 1917]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `atril'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000000000 in ?? ()
[Current thread is 1 (Thread 0x7fe7c7750340 (LWP 1898))]
(gdb) set width 0
(gdb) set pagination off
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007fe7bfec2129 in g_hash_table_lookup () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fe7c1d4850c in gdk_x11_atom_to_xatom_for_display () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#3  0x00007fe7c1d574c9 in gdk_x11_get_server_time () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#4  0x0000565447e18c8b in ?? ()
#5  0x0000565447e148bc in ?? ()
#6  0x00007fe7bf3cf2e1 in __libc_start_main (main=0x565447e144c0, argc=1, argv=0x7fff20006f68, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff20006f58) at ../csu/libc-start.c:291
#7  0x0000565447e14a2a in ?? ()



Core was generated by `atril'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000000000 in ?? ()
[Current thread is 1 (Thread 0x7fe7c7750340 (LWP 1898))]
(gdb) set width 0
(gdb) set pagination off
(gdb) bt
#0  0x0000000000000000 in  ()
#1  0x00007fe7bfec2129 in g_hash_table_lookup_node (hash_return=<synthetic pointer>, key=0x67, hash_table=0x565449548100) at ././glib/ghash.c:375
#2  0x00007fe7bfec2129 in g_hash_table_lookup (hash_table=0x565449548100, key=key@entry=0x67) at ././glib/ghash.c:1147
#3  0x00007fe7c1d4850c in lookup_cached_xatom (atom=0x67, display=0x565449535040 [GdkWaylandDisplay]) at ././gdk/x11/gdkproperty-x11.c:76
#4  0x00007fe7c1d4850c in gdk_x11_atom_to_xatom_for_display (display=0x565449535040 [GdkWaylandDisplay], atom=0x67) at ././gdk/x11/gdkproperty-x11.c:109
#5  0x00007fe7c1d574c9 in gdk_x11_get_server_time (window=window@entry=0x56544953b7e0 [GdkWaylandWindow]) at ././gdk/x11/gdkwindow-x11.c:5534
#6  0x0000565447e18c8b in ev_application_open_window (application=<optimized out>, screen=<optimized out>, timestamp=0) at ev-application.c:718
#7  0x0000565447e148bc in load_files (files=0x0) at main.c:168
#8  0x0000565447e148bc in main (argc=<optimized out>, argv=<optimized out>) at main.c:268





(gdb) bt full
#0  0x0000000000000000 in  ()
#1  0x00007fe7bfec2129 in g_hash_table_lookup_node (hash_return=<synthetic pointer>, key=0x67, hash_table=0x565449548100) at ././glib/ghash.c:375
        node_hash = <optimized out>
        hash_value = <optimized out>
        have_tombstone = 0
        step = 0
        node_index = <optimized out>
        first_tombstone = 0
        node_hash = <optimized out>
        __func__ = "g_hash_table_lookup"
#2  0x00007fe7bfec2129 in g_hash_table_lookup (hash_table=0x565449548100, key=key@entry=0x67) at ././glib/ghash.c:1147
        node_hash = <optimized out>
        __func__ = "g_hash_table_lookup"
#3  0x00007fe7c1d4850c in lookup_cached_xatom (atom=0x67, display=0x565449535040 [GdkWaylandDisplay]) at ././gdk/x11/gdkproperty-x11.c:76
        atom = 0x67
        display = 0x565449535040 [GdkWaylandDisplay]
        display_x11 = 0x565449535040 [GdkWaylandDisplay]
        atom = 0x67
        display = 0x565449535040 [GdkWaylandDisplay]
#4  0x00007fe7c1d4850c in gdk_x11_atom_to_xatom_for_display (display=0x565449535040 [GdkWaylandDisplay], atom=0x67) at ././gdk/x11/gdkproperty-x11.c:109
        atom = 0x67
        display = 0x565449535040 [GdkWaylandDisplay]
#5  0x00007fe7c1d574c9 in gdk_x11_get_server_time (window=window@entry=0x56544953b7e0 [GdkWaylandWindow]) at ././gdk/x11/gdkwindow-x11.c:5534
        xdisplay = 0x56544953b010
        xwindow = 0
        c = 97 'a'
        xevent = {type = 1230865200, xany = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800}, xkey = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800, root = 0, subwindow = 94920008539248, time = 94920007873168, x = 0, y = 0, x_root = -1071957762, y_root = 32743, state = 1230863776, keycode = 22100, same_screen = 89108480}, xbutton = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800, root = 0, subwindow = 94920008539248, time = 94920007873168, x = 0, y = 0, x_root = -1071957762, y_root = 32743, state = 1230863776, button = 22100, same_screen = 89108480}, xmotion = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800, root = 0, subwindow = 94920008539248, time = 94920007873168, x = 0, y = 0, x_root = -1071957762, y_root = 32743, state = 1230863776, is_hint = 84 'T', same_screen = 89108480}, xcrossing = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800, root = 0, subwindow = 94920008539248, time = 94920007873168, x = 0, y = 0, x_root = -1071957762, y_root = 32743, mode = 1230863776, detail = 22100, same_screen = 89108480, focus = 360314000, state = 1231625136}, xfocus = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800, mode = 0, detail = 0}, xexpose = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800, x = 0, y = 0, width = 1231297648, height = 22100, count = 1230631568}, xgraphicsexpose = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, drawable = 94920008106800, x = 0, y = 0, width = 1231297648, height = 22100, count = 1230631568, major_code = 22100, minor_code = 0}, xnoexpose = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, drawable = 94920008106800, major_code = 0, minor_code = 0}, xvisibility = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800, state = 0}, xcreatewindow = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, parent = 94920008106800, window = 0, x = 1231297648, y = 22100, width = 1230631568, height = 22100, border_width = 0, override_redirect = 0}, xdestroywindow = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, event = 94920008106800, window = 0}, xunmap = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, event = 94920008106800, window = 0, from_configure = 1231297648}, xmap = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, event = 94920008106800, window = 0, override_redirect = 1231297648}, xmaprequest = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, parent = 94920008106800, window = 0}, xreparent = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, event = 94920008106800, window = 0, parent = 94920008539248, x = 1230631568, y = 22100, override_redirect = 0}, xconfigure = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, event = 94920008106800, window = 0, x = 1231297648, y = 22100, width = 1230631568, height = 22100, border_width = 0, above = 140633337182462, override_redirect = 1230863776}, xgravity = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, event = 94920008106800, window = 0, x = 1231297648, y = 22100}, xresizerequest = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800, width = 0, height = 0}, xconfigurerequest = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, parent = 94920008106800, window = 0, x = 1231297648, y = 22100, width = 1230631568, height = 22100, border_width = 0, above = 140633337182462, detail = 1230863776, value_mask = 1547536846380052480}, xcirculate = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, event = 94920008106800, window = 0, place = 1231297648}, xcirculaterequest = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, parent = 94920008106800, window = 0, place = 1231297648}, xproperty = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800, atom = 0, time = 94920008539248, state = 1230631568}, xselectionclear = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800, selection = 0, time = 94920008539248}, xselectionrequest = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, owner = 94920008106800, requestor = 0, selection = 94920008539248, target = 94920007873168, property = 0, time = 140633337182462}, xselection = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, requestor = 94920008106800, selection = 0, target = 94920008539248, property = 94920007873168, time = 0}, xcolormap = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800, colormap = 0, new = 1231297648, state = 22100}, xclient = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800, message_type = 0, format = 1231297648, data = {b = "\220\362YITV\000\000\000\000\000\000\000\000\000\000\376\070\033\300", s = {-3440, 18777, 22100, 0, 0, 0, 0, 0, 14590, -16357}, l = {94920007873168, 0, 140633337182462, 94920008105376, 1547536846380052480}}}, xmapping = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800, request = 0, first_keycode = 0, count = 1231297648}, xerror = {type = 1230865200, display = 0x5654495d8340, resourceid = 1, serial = 140633337174855, error_code = 48 '0', request_code = 131 '\203', minor_code = 93 ']'}, xkeymap = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, window = 94920008106800, key_vector = "\000\000\000\000\000\000\000\000p\034dITV\000\000\220\362YITV\000\000\000\000\000\000\000\000\000"}, xgeneric = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, extension = 1230865200, evtype = 22100}, xcookie = {type = 1230865200, serial = 94920008106816, send_event = 1, display = 0x7fe7c01b1b47 <g_object_unref+103>, extension = 1230865200, evtype = 22100, cookie = 0, data = 0x565449641c70}, pad = {94920008106800, 94920008106816, 1, 140633337174855, 94920008106800, 0, 94920008539248, 94920007873168, 0, 140633337182462, 94920008105376, 1547536846380052480, 94920008866736, 94920008866976, 94920008866736, 140633372476444, -8, 94920008866976, 94920007450880, 140633372557899, 0, 140633450234796, 94919983403742, 94920008866976}}
        timestamp_prop_atom = <optimized out>
        __func__ = "gdk_x11_get_server_time"
#6  0x0000565447e18c8b in ev_application_open_window (application=<optimized out>, screen=<optimized out>, timestamp=0) at ev-application.c:718
        new_window = 0x565449691ca0 [EvWindow]
        gdk_window = 0x56544953b7e0 [GdkWaylandWindow]
#7  0x0000565447e148bc in load_files (files=0x0) at main.c:168
        screen = 0x565449538100 [GdkWaylandScreen]
        mode = EV_WINDOW_MODE_NORMAL
        i = <optimized out>
        global_dest = 0x0
        context = 0x5654495235d0
        error = 0x0
#8  0x0000565447e148bc in main (argc=<optimized out>, argv=<optimized out>) at main.c:268
        context = 0x5654495235d0
        error = 0x0













set width 0
set pagination off



##########


https://github.com/mate-desktop/atril/issues
https://github.com/mate-desktop/atril/blob/38624e1440680e9b86a09d556f39dbda02a3c9d6/shell/ev-application.c#L610

https://www.linux-magazin.de/ausgaben/2017/01/wayland-und-gtk/



##########



cd    /home/benutzer/source/atril
cp orig try1 -a
cd try1/atril-1.16.1

mc -e ./shell/ev-application.c:627

dpkg-source --commit

dpkg-buildpackage -b


cd /home/benutzer/source/atril/try1/
dpkg -i atril_1.16.1-2+deb9u1_amd64.deb atril-common_1.16.1-2+deb9u1_all.deb atril-dbgsym_1.16.1-2+deb9u1_amd64.deb libatrildocument3_1.16.1-2+deb9u1_amd64.deb libatrilview3_1.16.1-2+deb9u1_amd64.deb



##########


# Buster amd64 qemu VM 2019-05-29

apt update
apt dist-upgrade

apt install systemd-coredump gnome fakeroot mc gdb valgrind atril atril-dbgsym libgtk-3-0-dbgsym libglib2.0-0-dbgsym

reboot

-> not crashing

Reply to: