-q command-line option is crashing

Bug #1375447 reported by Vadim Peretokin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mudlet
Fix Released
High
Stephen Lyons

Bug Description

(gdb) r
Starting program: /home/vadi/Programs/Mudlet2/Github-Mudlet/src/mudlet -q
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe7aa8700 (LWP 23045)]
[New Thread 0x7fffde549700 (LWP 23047)]
[New Thread 0x7fffddb36700 (LWP 23049)]
[New Thread 0x7fffcffff700 (LWP 23050)]
[New Thread 0x7fffcf7fe700 (LWP 23051)]
[New Thread 0x7fffceffd700 (LWP 23052)]

Program received signal SIGSEGV, Segmentation fault.
QWidget::show (this=0x0) at kernel/qwidget.cpp:7011
7011 kernel/qwidget.cpp: No such file or directory.
(gdb) bt
#0 QWidget::show (this=0x0) at kernel/qwidget.cpp:7011
#1 0x00000000005861ba in main (argc=2, argv=0x7fffffffdd98) at main.cpp:490
(gdb)

Revision history for this message
Stephen Lyons (slysven) wrote :

Is the change to use a QScopedPointer compatible with the qobject_cast() used to convert the pointer returned from createApplication() which can be EITHER a QCoreApplication (for the case where a commandline -h(elp) or -v(ersion) argument is used and a GUI application is NOT to be created) OR a QApplication (for the normal GUI application)?

I'd suggest changing the item that becomes the scoped pointer:
FROM:

180 QScopedPointer<QCoreApplication> initApp(createApplication(argc, argv, startupAction));

182 QApplication * app = qobject_cast<QApplication *>(initApp.data());

TO:

180 QCoreApplication * initApp(createApplication(argc, argv, startupAction));

182 QScopedPointer<QApplication> app = qobject_cast<QApplication *>(initApp.data());

Revision history for this message
Stephen Lyons (slysven) wrote :

Ah, lose the ".data()" bit from that last line... - other tweaks could be necessary further down main() to access app's methods and members!

Revision history for this message
Stephen Lyons (slysven) wrote :

Never-mind, it was something else resulting from a recent change.

Fixed in https://github.com/Mudlet/Mudlet/pull/193 - same as the attached patch.

Changed in mudlet:
status: Confirmed → Fix Committed
assignee: nobody → Stephen Lyons (slysven)
importance: Low → High
Changed in mudlet:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.