babluboy / bookworm

A simple ebook reader for Elementary OS
GNU General Public License v3.0
1.33k stars 101 forks source link

Core dumps on gnome 3.22 with wayland support #117

Open Dr-Terrible opened 7 years ago

Dr-Terrible commented 7 years ago

Bookworm generates a lot of segmentation faults when it's executed in a gnome/gtk+ 3.22+ session with wayland support compiled in at runtime. It doesn't matter what I do, whenever I click on a button or a menu, the app segments.

$ bookworm --debug
** (process:22906): DEBUG: main.vala:24: Bookworm Application running in debug mode - all debug messages will be displayed
[_LOG_LEVEL_INFO 12:41:52.769542] Application.vala:153: Bookworm version: 0.9.1
[_LOG_LEVEL_INFO 12:41:52.769602] Application.vala:155: Kernel version: 4.12.5-gentoo
(bookworm:22906): Gtk-DEBUG: Connecting to session manager
(bookworm:22906): Gtk-DEBUG: Failed to get the GNOME session proxy: The name org.gnome.SessionManager is not owned
(bookworm:22906): Gtk-DEBUG: Failed to get the Xfce session proxy: The name org.xfce.SessionManager is not owned
(bookworm:22906): Gtk-DEBUG: Failed to get an inhibit portal proxy: The name org.freedesktop.portal.Desktop is not owned
** (bookworm:22906): DEBUG: bookworm.vala:174: Starting to activate Gtk Window for Bookworm...
** (bookworm:22906): DEBUG: Settings.vala:158: Loading settings from schema 'com.github.babluboy.bookworm'
** (bookworm:22906): DEBUG: headerbar.vala:29: Starting creation of header bar..
** (bookworm:22906): DEBUG: headerbar.vala:189: Completed loading HeaderBar sucessfully...

(bookworm:22906): Gtk-WARNING **: Theme parsing error: <data>:1:29: Using Pango syntax for the font: style property is deprecated; please use CSS syntax
[_LOG_LEVEL_WARN 12:41:54.059043] Utils.vala:222: Couldn't apply style to label: <data>:1:12not a number

(bookworm:22906): Gtk-WARNING **: Theme parsing error: <data>:1:30: Using Pango syntax for the font: style property is deprecated; please use CSS syntax
[_LOG_LEVEL_WARN 12:41:54.059148] Utils.vala:222: Couldn't apply style to label: <data>:1:12not a number
** (bookworm:22906): DEBUG: window.vala:46: Starting to create main window components...

(bookworm:22906): Gtk-WARNING **: Can't set a parent on widget which has a parent
** (bookworm:22906): DEBUG: bookinfo.vala:32: Starting to create BookInfo window components...
** (bookworm:22906): DEBUG: window.vala:466: Completed creation of main window components...
** (bookworm:22906): DEBUG: utils.vala:317: Started file operation[CREATEDIR], for path=/tmp/bookworm/, filename=
[_LOG_LEVEL_WARN 12:41:55.137184] [GLib] Invalid file descriptor.
** (bookworm:22906): DEBUG: utils.vala:471: Completed file operation[CREATEDIR]...
** (bookworm:22906): DEBUG: utils.vala:317: Started file operation[CREATEDIR], for path=/home/foo/.config/bookworm, filename=
[_LOG_LEVEL_WARN 12:41:55.137355] [GLib] Invalid file descriptor.
** (bookworm:22906): DEBUG: utils.vala:471: Completed file operation[CREATEDIR]...
** (bookworm:22906): DEBUG: utils.vala:317: Started file operation[CREATEDIR], for path=/home/foo/.config/bookworm/covers/, filename=
[_LOG_LEVEL_WARN 12:41:55.137516] [GLib] Invalid file descriptor.
** (bookworm:22906): DEBUG: utils.vala:471: Completed file operation[CREATEDIR]...
** (bookworm:22906): DEBUG: utils.vala:317: Started file operation[CREATEDIR], for path=/home/foo/.config/bookworm/books/, filename=
[_LOG_LEVEL_WARN 12:41:55.137675] [GLib] Invalid file descriptor.
** (bookworm:22906): DEBUG: utils.vala:471: Completed file operation[CREATEDIR]...
** (bookworm:22906): DEBUG: database.vala:30: Checking BookWorm DB or creating it if the DB does not exist...
** (bookworm:22906): DEBUG: database.vala:39: Sucessfully checked/created DB for Bookworm.....
** (bookworm:22906): DEBUG: database.vala:42: Creating latest version for Library table if it does not exists
** (bookworm:22906): DEBUG: database.vala:69: Checking/creating bookworm VERSION_TABLE...
** (bookworm:22906): DEBUG: database.vala:83: Sucessfully checked/created Bookworm VERSION_TABLE...
** (bookworm:22906): DEBUG: database.vala:86: Check VERSION table to see if the current DB version is the latest
** (bookworm:22906): DEBUG: database.vala:109: Latest version of BOOKWORM_LIBRARY_TABLE_VERSION is [5] and version fetched from VERSION_TABLE is [5]
** (bookworm:22906): DEBUG: bookworm.vala:512: Initited toggleUIState with BOOKWORM_CURRENT_STATE:LIBRARY_MODE_LIST
** (bookworm:22906): DEBUG: bookworm.vala:216: Sucessfully activated Gtk Window for Bookworm...
** (bookworm:22906): DEBUG: bookworm.vala:512: Initited toggleUIState with BOOKWORM_CURRENT_STATE:LIBRARY_MODE_LIST
** (bookworm:22906): DEBUG: bookworm.vala:243: Ending activate method
[_LOG_LEVEL_DEBUG 12:41:58.107240] [GdkPixbuf] gdk_pixbuf_from_pixdata() called on:
[_LOG_LEVEL_DEBUG 12:41:58.107360] [GdkPixbuf]  Encoding raw
[_LOG_LEVEL_DEBUG 12:41:58.107446] [GdkPixbuf]  Dimensions: 14 x 14
[_LOG_LEVEL_DEBUG 12:41:58.107531] [GdkPixbuf]  Rowstride: 56, Length: 808
[_LOG_LEVEL_DEBUG 12:41:58.107615] [GdkPixbuf]  Copy pixels == false
zsh: segmentation fault (core dumped)  bookworm --debug
$ coredumpctl list
TIME                            PID   UID   GID SIG COREFILE  EXE
Mon 2017-08-21 11:19:26 CEST  11185  1000  1000  11 present   /usr/bin/bookworm
Mon 2017-08-21 11:19:42 CEST  11223  1000  1000  11 present   /usr/bin/bookworm
Mon 2017-08-21 11:34:18 CEST  17178  1000  1000  11 present   /usr/bin/bookworm
Mon 2017-08-21 11:53:36 CEST  21503  1000  1000  11 present   /usr/bin/bookworm
Mon 2017-08-21 12:18:19 CEST  28024  1000  1000  11 present   /usr/bin/bookworm
Mon 2017-08-21 12:20:18 CEST  22906  1000  1000  11 present   /usr/bin/bookworm
$ coredumpctl gdb 22906
           PID: 22906 (bookworm)
           UID: 1000
           GID: 1000
        Signal: 11 (SEGV)
     Timestamp: Mon 2017-08-21 12:41:58 CEST (1min 44s ago)
  Command Line: bookworm --debug
    Executable: /usr/bin/bookworm
 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
       Boot ID: 202bd12848f243a0984338142b99cbf4
    Machine ID: 7019c8f77c1ac926c023b11f00000cb1
      Hostname: workstation
       Storage: /var/lib/systemd/coredump/core.bookworm.1000.202bd12848f243a0984338142b99cbf4.22906.1503312118000000.lz4
       Message: Process 22906 (bookworm) of user 1000 dumped core.

GNU gdb (Gentoo 8.0 vanilla) 8.0
Copyright (C) 2017 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
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/bookworm...(no debugging symbols found)...done.
[New LWP 22906]
[New LWP 22907]
[New LWP 22908]
[New LWP 22913]
[New LWP 22912]
[New LWP 22909]
[New LWP 22910]
[New LWP 22933]
[New LWP 22911]
[New LWP 22929]
[New LWP 22914]
[New LWP 22917]
[New LWP 22928]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `bookworm --debug'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fd6f273c9fb in ?? () from /usr/lib64/libgtk-3.so.0
[Current thread is 1 (Thread 0x7fd6e78099c0 (LWP 22906))]

Similar behaviours can be found in other Elementary apps: https://github.com/needle-and-thread/birdie/issues/189

babluboy commented 7 years ago

@Dr-Terrible Thanks for trying out bookworm on gnome 3.22 with Wayland...can you provide some steps on how I can build this Env on a VM to test and do some debugging to see where it fails...

Will leave this issue on the backburner for now and will come back to it as part of the cross-distro support when I have got all the improvements/features into bookworm ....

Dr-Terrible commented 7 years ago

@Dr-Terrible Thanks for trying out bookworm on gnome 3.22 with Wayland...can you provide some steps on how I can build this Env on a VM to test and do some debugging to see where it fails

I'm using a Gentoo/Linux, but I advise against it because it's tricky to set up correctly and a lot of long compilations are involved. Instead, you should try a VM with Arch, which brings gtk3 with wayland support compiled in by default: https://wiki.archlinux.org/index.php/wayland#GTK.2B_3

Then you launch a Wayland session for Gnome through your login manager (gdm, or sddm); gnome 3.22 already provides everything you need to use a Wayland session.

Will leave this issue on the backburner for now and will come back to it as part of the cross-distro support when I have got all the improvements/features into bookworm

Keep in mind that the problem happens within Xorg sessions too; which means that distros like Gentoo, Arch, and SuSe are all affected right now because they ship gtk3+ with wayland already compiled in. Pretty soon it will be the same for Fedora 25, and most probably for Canonical too since Wayland is supposed to be packaged as a preview technology (limited to some apps) by the end of the current year.

However, later I'll try to compile bookworm with debug symbols and report a proper gdb session; that should help you find the issue ;)

Dr-Terrible commented 7 years ago

Attached you'll find the SIGSEGV captured from a gdb session and its backtrace.

The SIGSEGV is triggered every time I run bookworm and press the "open" button (it's a clean installation of the app, with no ebook collection, or cache).

babluboy commented 7 years ago

I am not able to make much out of the logs attached...ideally I should catch the error and handle it instead of a seg fault happening...will have to create a VM with Arch and debug with the Wayland session...and add some debug into the code on the "add book" button to see where the seg fault is happening.... wish there was some information on which line of code is throwing is the seg fault...