team-phoenix / Phoenix

A multi-system emulator and library manager designed to be both powerful and easy to use.
http://phoenix.vg
GNU General Public License v2.0
376 stars 40 forks source link

Fix crash when opening add game dialog on KDE. #327

Closed bsmt closed 7 years ago

bsmt commented 7 years ago

Presumably because of some change in Qt, when you try to add a game, it crashes. My guess is because the file open dialog is a QWidget, and QWidget wants the main application instance to be a QApplication and not QGuiApplication. Just include QtWidgets and change the declaration and now it works. I am using Qt 5.7.1.

bsmt commented 7 years ago

Just fixed the travis config too, since you added my fix for cmake 3.7.

athairus commented 7 years ago

This is interesting. What OS and Qt version are you using? I've never experienced a crash like this.

bsmt commented 7 years ago

Arch linux and Qt 5.7.1. It's happened on earlier qt versions too.

athairus commented 7 years ago

Since it's Arch, I'll also need to know what DE you're using.

bsmt commented 7 years ago

KDE/Plasma 5. Give me one minute, I'll post a log.

bsmt commented 7 years ago

Only thing that it spits out is this:

F 16:50:23:849 unknown():0: QWidget: Cannot create a QWidget without QApplication 
               [unknown:0 unknown()]
athairus commented 7 years ago

Where did your copy of Qt come from? Official installer, extras repo, AUR, built yourself?

bsmt commented 7 years ago

Just the arch extras repo.

athairus commented 7 years ago

Have you installed all the necessary modules? What does pacman -Q | grep -i qt5 output?

bsmt commented 7 years ago

I believed I installed everything qt5-related, as I did pacman -S qt5. Here's what I have, anyways.

attica-qt5 5.30.0-1
libdbusmenu-qt5 0.9.3+16.04.20160218-1
libechonest-qt5 2.3.1-1
liblastfm-qt5 1.0.9-1
phonon-qt5 4.9.0-1
phonon-qt5-vlc 0.9.0-1
polkit-qt5 0.112.0+git20160226-1
poppler-qt5 0.51.0-1
pyqt5-common 5.7-3
python-pyqt5 5.7-3
python2-pyqt5 5.7-3
qca-qt5 2.1.1-7
qt5-base 5.7.1-2
qt5-declarative 5.7.1-1
qt5-doc 5.7.1-1
qt5-examples 5.7.1-1
qt5-graphicaleffects 5.7.1-1
qt5-location 5.7.1-1
qt5-multimedia 5.7.1-1
qt5-quickcontrols 5.7.1-1
qt5-quickcontrols2 5.7.1-1
qt5-script 5.7.1-1
qt5-sensors 5.7.1-1
qt5-svg 5.7.1-1
qt5-tools 5.7.1-1
qt5-wayland 5.7.1-1
qt5-webchannel 5.7.1-1
qt5-webengine 5.7.1-2
qt5-webkit 5.7.1-1
qt5-x11extras 5.7.1-1
qt5-xmlpatterns 5.7.1-1
athairus commented 7 years ago

At this point I'm just curious... what's the stack trace of your crash?

bsmt commented 7 years ago
F 17:11:48:834 unknown():0: QWidget: Cannot create a QWidget without QApplication 
               [unknown:0 unknown()]

Thread 1 "Phoenix" received signal SIGABRT, Aborted.
0x00007ffff379a04f in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff379a04f in raise () from /usr/lib/libc.so.6
#1  0x00007ffff379b47a in abort () from /usr/lib/libc.so.6
#2  0x00007ffff443b4f1 in QMessageLogger::fatal(char const*, ...) const () from /usr/lib/libQt5Core.so.5
#3  0x00007ffff53526a1 in QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>) () from /usr/lib/libQt5Widgets.so.5
#4  0x00007ffff54f6bf5 in QDialog::QDialog(QWidget*, QFlags<Qt::WindowType>) () from /usr/lib/libQt5Widgets.so.5
#5  0x00007fffe71528b8 in ?? () from /usr/lib/qt/plugins/platformthemes/KDEPlasmaPlatformTheme.so
#6  0x00007fffe7150bf0 in ?? () from /usr/lib/qt/plugins/platformthemes/KDEPlasmaPlatformTheme.so
#7  0x00007fffe7150fa2 in ?? () from /usr/lib/qt/plugins/platformthemes/KDEPlasmaPlatformTheme.so
#8  0x00007fffe71446ba in ?? () from /usr/lib/qt/plugins/platformthemes/KDEPlasmaPlatformTheme.so
#9  0x00007fffd6eecba7 in ?? () from /usr/lib/qt/qml/QtQuick/Dialogs/libdialogplugin.so
#10 0x00007fffd6eec7c4 in ?? () from /usr/lib/qt/qml/QtQuick/Dialogs/libdialogplugin.so
#11 0x00007fffd6efea9b in ?? () from /usr/lib/qt/qml/QtQuick/Dialogs/libdialogplugin.so
#12 0x00007fffd6efede0 in ?? () from /usr/lib/qt/qml/QtQuick/Dialogs/libdialogplugin.so
#13 0x00007fffd6efcae5 in ?? () from /usr/lib/qt/qml/QtQuick/Dialogs/libdialogplugin.so
#14 0x00007fffd6efd785 in ?? () from /usr/lib/qt/qml/QtQuick/Dialogs/libdialogplugin.so
#15 0x00007ffff5fad600 in QQmlVMEMetaObject::metaCall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQt5Qml.so.5
#16 0x00007ffff5ffea09 in ?? () from /usr/lib/libQt5Qml.so.5
#17 0x00007ffff5f8d270 in ?? () from /usr/lib/libQt5Qml.so.5
#18 0x00007ffff5f8d8a9 in ?? () from /usr/lib/libQt5Qml.so.5
#19 0x00007ffff5f8e205 in QV4::QObjectMethod::callInternal(QV4::CallData*) const () from /usr/lib/libQt5Qml.so.5
#20 0x00007ffff5fa3911 in QV4::Runtime::callProperty(QV4::ExecutionEngine*, int, QV4::CallData*) () from /usr/lib/libQt5Qml.so.5
#21 0x00007fffdc023f88 in ?? ()
#22 0x0000000000000020 in ?? ()
#23 0x000000008236f979 in ?? ()
#24 0x00007fffffffb5b8 in ?? ()
#25 0x0003400000000001 in ?? ()
#26 0x00007fffd80334a8 in ?? ()
#27 0x00007ffff37e1d44 in malloc () from /usr/lib/libc.so.6
#28 0x00007ffff5f3c07b in ?? () from /usr/lib/libQt5Qml.so.5
#29 0x00007ffff602a4a7 in QQmlJavaScriptExpression::evaluate(QV4::CallData*, bool*) () from /usr/lib/libQt5Qml.so.5
#30 0x00007ffff5fcfcb6 in QQmlBoundSignalExpression::evaluate(void**) () from /usr/lib/libQt5Qml.so.5
#31 0x00007ffff5fd0e4b in ?? () from /usr/lib/libQt5Qml.so.5
#32 0x00007ffff6007ea4 in QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) () from /usr/lib/libQt5Qml.so.5
#33 0x00007ffff5fb1d5c in QQmlData::signalEmitted(QAbstractDeclarativeData*, QObject*, int, void**) () from /usr/lib/libQt5Qml.so.5
#34 0x00007ffff465b954 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5
#35 0x00007ffff6aec8b2 in QQuickMouseArea::clicked(QQuickMouseEvent*) () from /usr/lib/libQt5Quick.so.5
#36 0x00007ffff6a1d7a6 in QQuickMouseArea::setPressed(Qt::MouseButton, bool, Qt::MouseEventSource) () from /usr/lib/libQt5Quick.so.5
#37 0x00007ffff6a1e345 in QQuickMouseArea::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQt5Quick.so.5
#38 0x00007ffff699b598 in QQuickItem::event(QEvent*) () from /usr/lib/libQt5Quick.so.5
#39 0x00007ffff462f8da in QCoreApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#40 0x00007ffff462fa40 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#41 0x00007ffff69ae04f in QQuickWindow::sendEvent(QQuickItem*, QEvent*) () from /usr/lib/libQt5Quick.so.5
#42 0x00007ffff69ae8c0 in QQuickWindowPrivate::deliverMouseEvent(QMouseEvent*) () from /usr/lib/libQt5Quick.so.5
#43 0x00007ffff69b0b00 in QQuickWindow::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQt5Quick.so.5
#44 0x00007ffff4b813b5 in QWindow::event(QEvent*) () from /usr/lib/libQt5Gui.so.5
#45 0x00007ffff69b6105 in QQuickWindow::event(QEvent*) () from /usr/lib/libQt5Quick.so.5
#46 0x000000000048e1f8 in PhoenixWindow::event(QEvent*) ()
#47 0x00007ffff462f8da in QCoreApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#48 0x00007ffff462fa40 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#49 0x00007ffff4b75663 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) ()
   from /usr/lib/libQt5Gui.so.5
#50 0x00007ffff4b771e5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) ()
   from /usr/lib/libQt5Gui.so.5
#51 0x00007ffff4b5515b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/libQt5Gui.so.5
#52 0x00007fffeb1f6da0 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#53 0x00007ffff1152587 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#54 0x00007ffff11527f0 in ?? () from /usr/lib/libglib-2.0.so.0
#55 0x00007ffff115289c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#56 0x00007ffff468446f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/libQt5Core.so.5
#57 0x00007ffff462de9a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#58 0x00007ffff463639c in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
---Type <return> to continue, or q <return> to quit---q
athairus commented 7 years ago

abort() gets called eventually once this condition is met: https://code.woboq.org/qt5/qtbase/src/widgets/kernel/qwidget.cpp.html#1132

I suppose we never caught this bug since we usually test on GNOME. KDE probably uses QWidgets to make that file open dialog.

athairus commented 7 years ago

I'll merge once I do a quick compile/sanity check (we don't have any unit testing). I think we dropped QApplication in favor of its parent class QGUIApplication a while back because we felt we didn't need its functionality...