FS#50013 - [calibre] Segmentation fault on open file dialog when under wayland session

Attached to Project: Community Packages
Opened by Jonathan Charest (jcharest) - Monday, 11 July 2016, 03:10 GMT
Last edited by Antonio Rojas (arojas) - Friday, 09 December 2016, 10:42 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jelle van der Waa (jelly)
Antonio Rojas (arojas)
Felix Yan (felixonmars)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 5
Private No

Details

Description:

When running a wayland gnome session, I can start calibre but opening a file dialog caused a segmentation fault. I ran calibre under gdb to get the backtrace. From the traces, my guess is that the native dialog is a wayland dialog but calibre is running under xwayland. A quick search for "QDialogPrivate::setNativeDialogVisible(bool)" dit not yield useful results.

I initially opened a bug upstream: https://bugs.launchpad.net/calibre/+bug/1600621
But it was closed because I am using a distribution package. When I tried the "installer" version from 2.62.0, I could not reproduce the crash. So it seems indded that it is not an issue with calibre but something from a dependency.


Additional info:
Package version 2.62.0-1


Steps to reproduce:
Run calibre in a gnome wayland session and click on "add books".

Backtrace:
(python2:7241): Gdk-WARNING **: gdkwindow-x11.c:5555 drawable is not a native X11 window

Thread 1 "python2" received signal SIGSEGV, Segmentation fault.
0x00007fffe8c9d01b in _XSend () from /usr/lib/libX11.so.6
(gdb) bt
#0 0x00007fffe8c9d01b in _XSend () from /usr/lib/libX11.so.6
#1 0x00007fffe8c9d4d5 in _XFlush () from /usr/lib/libX11.so.6
#2 0x00007fffe8c9ffa5 in _XGetRequest () from /usr/lib/libX11.so.6
#3 0x00007fffe8c7a579 in XChangeProperty () from /usr/lib/libX11.so.6
#4 0x00007fffe8c97919 in XSetTransientForHint () from /usr/lib/libX11.so.6
#5 0x00007fffd722948e in ?? () from /usr/lib/qt/plugins/platformthemes/libqgtk3.so
#6 0x00007fffd722c121 in ?? () from /usr/lib/qt/plugins/platformthemes/libqgtk3.so
#7 0x00007fffec9f7780 in QDialogPrivate::setNativeDialogVisible(bool) () from /usr/lib/libQt5Widgets.so.5
#8 0x00007fffeca09dc2 in QFileDialog::setVisible(bool) () from /usr/lib/libQt5Widgets.so.5
#9 0x00007fffec9f8631 in QDialog::exec() () from /usr/lib/libQt5Widgets.so.5
#10 0x00007fffeca0a8ca in QFileDialog::getOpenFileUrls(QWidget*, QString const&, QUrl const&, QString const&, QString*, QFlags<QFileDialog::Option>, QStringList const&) ()
from /usr/lib/libQt5Widgets.so.5
#11 0x00007fffeca0ab2f in QFileDialog::getOpenFileNames(QWidget*, QString const&, QString const&, QString const&, QString*, QFlags<QFileDialog::Option>) ()
from /usr/lib/libQt5Widgets.so.5
#12 0x00007fffed23c7b8 in ?? () from /usr/lib/python2.7/site-packages/PyQt5/QtWidgets.so
#13 0x00007ffff7adc204 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#14 0x00007ffff7adddcc in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#15 0x00007ffff7a6308d in function_call () from /usr/lib/libpython2.7.so.1.0
#16 0x00007ffff7a3c662 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#17 0x00007ffff7a4bfba in instancemethod_call () from /usr/lib/libpython2.7.so.1.0
#18 0x00007ffff7a3c662 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#19 0x00007ffff7a97136 in slot_tp_init () from /usr/lib/libpython2.7.so.1.0
#20 0x00007ffff7a95ced in type_call () from /usr/lib/libpython2.7.so.1.0
#21 0x00007ffff7a3c662 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#22 0x00007ffff7ad9665 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#23 0x00007ffff7adddcc in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#24 0x00007ffff7adbf68 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#25 0x00007ffff7adddcc in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#26 0x00007ffff7a62fab in function_call () from /usr/lib/libpython2.7.so.1.0
#27 0x00007ffff7a3c662 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#28 0x00007ffff7a4bfba in instancemethod_call () from /usr/lib/libpython2.7.so.1.0
#29 0x00007ffff7a3c662 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#30 0x00007ffff7ad3c46 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.7.so.1.0
#31 0x00007fffe76e0c90 in ?? () from /usr/lib/python2.7/site-packages/PyQt5/QtCore.so
#32 0x00007fffe76e1108 in ?? () from /usr/lib/python2.7/site-packages/PyQt5/QtCore.so
#33 0x00007fffe76e1390 in ?? () from /usr/lib/python2.7/site-packages/PyQt5/QtCore.so
#34 0x00007fffe76e1d87 in ?? () from /usr/lib/python2.7/site-packages/PyQt5/QtCore.so
#35 0x00007fffebb57684 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5
#36 0x00007fffec805472 in QAction::triggered(bool) () from /usr/lib/libQt5Widgets.so.5
#37 0x00007fffec807e60 in QAction::activate(QAction::ActionEvent) () from /usr/lib/libQt5Widgets.so.5
#38 0x00007fffec8f472d in ?? () from /usr/lib/libQt5Widgets.so.5
#39 0x00007fffec8f4964 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQt5Widgets.so.5
#40 0x00007fffec9c030a in QToolButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQt5Widgets.so.5
#41 0x00007fffec852f18 in QWidget::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5
#42 0x00007fffec9c03e9 in QToolButton::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5
#43 0x00007fffec80be3c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#44 0x00007fffec81446d in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
---Type <return> to continue, or q <return> to quit---
#45 0x00007fffed2aa29e in ?? () from /usr/lib/python2.7/site-packages/PyQt5/QtWidgets.so
#46 0x00007fffebb2bc80 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#47 0x00007fffec812b1d in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
from /usr/lib/libQt5Widgets.so.5
#48 0x00007fffec86cfc0 in ?? () from /usr/lib/libQt5Widgets.so.5
#49 0x00007fffec86f763 in ?? () from /usr/lib/libQt5Widgets.so.5
#50 0x00007fffec80be3c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#51 0x00007fffec8135b1 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#52 0x00007fffed2aa29e in ?? () from /usr/lib/python2.7/site-packages/PyQt5/QtWidgets.so
#53 0x00007fffebb2bc80 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#54 0x00007fffec07a0e3 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /usr/lib/libQt5Gui.so.5
#55 0x00007fffec07bc65 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /usr/lib/libQt5Gui.so.5
#56 0x00007fffec059cbb in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Gui.so.5
#57 0x00007fffd9df0310 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#58 0x00007fffee86add7 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#59 0x00007fffee86b040 in ?? () from /usr/lib/libglib-2.0.so.0
#60 0x00007fffee86b0ec in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#61 0x00007fffebb8057f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#62 0x00007fffebb2a0da in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#63 0x00007fffebb325cc in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#64 0x00007fffed2a8c6b in ?? () from /usr/lib/python2.7/site-packages/PyQt5/QtWidgets.so
#65 0x00007ffff7adc204 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#66 0x00007ffff7adddcc in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#67 0x00007ffff7adbf68 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#68 0x00007ffff7adddcc in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#69 0x00007ffff7adbf68 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#70 0x00007ffff7adddcc in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#71 0x00007ffff7adbf68 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#72 0x00007ffff7adddcc in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#73 0x00007ffff7added8 in PyEval_EvalCode () from /usr/lib/libpython2.7.so.1.0
#74 0x00007ffff7af835e in run_mod () from /usr/lib/libpython2.7.so.1.0
#75 0x00007ffff7af9621 in PyRun_FileExFlags () from /usr/lib/libpython2.7.so.1.0
#76 0x00007ffff7afa944 in PyRun_SimpleFileExFlags () from /usr/lib/libpython2.7.so.1.0
#77 0x00007ffff7b0d150 in Py_Main () from /usr/lib/libpython2.7.so.1.0
#78 0x00007ffff7452741 in __libc_start_main () from /usr/lib/libc.so.6
#79 0x0000555555554819 in _start ()
This task depends upon

Closed by  Antonio Rojas (arojas)
Friday, 09 December 2016, 10:42 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed in qt5-base 5.7.0-9
Comment by Doug Newgard (Scimmia) - Monday, 11 July 2016, 04:10 GMT
Pulling in Antonio and Felix because I'm thinking this is a Qt issue.
Comment by Antonio Rojas (arojas) - Monday, 11 July 2016, 16:50 GMT
I doubt this has anything to do with packaging, please report this upstream to Qt.
Comment by Jonathan Charest (jcharest) - Tuesday, 30 August 2016, 17:51 GMT
I did not get around to report the bug upstream but it seems somebody else did:

https://bugreports.qt.io/browse/QTBUG-55583
Comment by Antonio Rojas (arojas) - Tuesday, 30 August 2016, 19:53 GMT
Thanks, so this is clearly an upstream issue. The upstream report mentions some workarounds until this is implemented.

1) run calibre with xwayland: GDK_BACKEND=x11 calibre
2) run qt with wayland backend: QT_QPA_PLATFORM=wayland-egl calibre

Loading...