Bug 269823

Summary: kde-open --noninteractive foo.noassoc crashes
Product: [Unmaintained] kdelibs Reporter: Rex Dieter <rdieter>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: adawit, frank78ac, lasse.liehu
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Patch that fixes the crash in some situations

Description Rex Dieter 2011-03-31 15:34:58 UTC
Version:           unspecified (using KDE 4.6.1) 
OS:                Linux

Trying to use 'kde-open --noninteractive' on a file with currently no mimetype association yields a crash.


Reproducible: Always

Steps to Reproduce:
# create a file with no app/mime association
1. 
touch foo.noassoc

2.
kde-open --noninteractive foo.noassoc

3
crash



Here's a quick-n-dirty backtrace

(gdb) exec-file kde-open
(gdb) set args --noninteractive foo.noassoc
(gdb) run
Starting program: /usr/bin/kde-open --noninteractive foo.noassoc
[Thread debugging using libthread_db enabled]
QWidget: Cannot create a QWidget when no GUI is being used

Program received signal SIGABRT, Aborted.
0x000000377b8330c5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64        return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
#0  0x000000377b8330c5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x000000377b834a76 in abort () at abort.c:92
#2  0x0000003d8506a784 in qt_message_output (msgType=<value optimized out>, buf=<value optimized out>) at global/qglobal.cpp:2282
#3  0x0000003d8506a94d in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=QtFatalMsg, msg=
    0x3897c3ace8 "QWidget: Cannot create a QWidget when no GUI is being used", ap=0x7fffffffc0c0) at global/qglobal.cpp:2328
#4  0x0000003d8506aae5 in qFatal (msg=<value optimized out>) at global/qglobal.cpp:2511
#5  0x000000389760da3c in QWidgetPrivate::init (this=0x76cfa0, parentWidget=0x0, f=...) at kernel/qwidget.cpp:1247
#6  0x000000389760dc61 in QWidget::QWidget (this=0x7fffffffc3c0, dd=<value optimized out>, parent=0x0, f=...) at kernel/qwidget.cpp:1170
#7  0x0000003897a718bf in QDialog::QDialog (this=0x7fffffffc3c0, parent=0x0, f=<value optimized out>) at dialogs/qdialog.cpp:261
#8  0x00000038ad59c1bd in KDialog::KDialog (this=0x7fffffffc3c0, parent=<value optimized out>, flags=<value optimized out>) at /usr/src/debug/kdelibs-4.6.1/kdeui/dialogs/kdialog.cpp:190
#9  0x00000038ae9f22e6 in KOpenWithDialog::KOpenWithDialog (this=0x7fffffffc3c0, _urls=..., _text=..., _value=..., parent=<value optimized out>)
    at /usr/src/debug/kdelibs-4.6.1/kio/kfile/kopenwithdialog.cpp:500
#10 0x00000038ae963f11 in KRun::displayOpenWithDialog (lst=..., window=0x0, tempFiles=false, suggestedFileName=..., asn=...) at /usr/src/debug/kdelibs-4.6.1/kio/kio/krun.cpp:202
#11 0x00000038ae964c12 in KRun::runUrl (u=<value optimized out>, _mimetype=..., window=0x0, tempFile=false, runExecutables=<value optimized out>, suggestedFileName=..., asn=...)
    at /usr/src/debug/kdelibs-4.6.1/kio/kio/krun.cpp:180
#12 0x00000038ae9650bc in KRun::foundMimeType (this=0x6c2110, type=...) at /usr/src/debug/kdelibs-4.6.1/kio/kio/krun.cpp:1472
#13 0x00000038ae959812 in KRun::mimeTypeDetermined (this=0x6c2110, mimeType=<value optimized out>) at /usr/src/debug/kdelibs-4.6.1/kio/kio/krun.cpp:1420
#14 0x00000038ae962ce7 in KRun::init (this=0x6c2110) at /usr/src/debug/kdelibs-4.6.1/kio/kio/krun.cpp:1181
#15 0x00000038ae95b7a0 in KRun::slotTimeout (this=0x6c2110) at /usr/src/debug/kdelibs-4.6.1/kio/kio/krun.cpp:1304
#16 0x00000038ae95b96c in KRun::qt_metacall (this=0x6c2110, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fffffffcf70)
    at /usr/src/debug/kdelibs-4.6.1/x86_64-redhat-linux-gnu/kio/krun.moc:86
#17 0x0000003d85171acf in QMetaObject::activate (sender=0x6c22a0, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x0) at kernel/qobject.cpp:3278
#18 0x0000003d851712f9 in QObject::event (this=0x6c22a0, e=<value optimized out>) at kernel/qobject.cpp:1181
#19 0x00000038975b7cd4 in QApplicationPrivate::notify_helper (this=0x6546d0, receiver=0x6c22a0, e=0x7fffffffd660) at kernel/qapplication.cpp:4462
#20 0x00000038975bc88a in QApplication::notify (this=<value optimized out>, receiver=0x6c22a0, e=0x7fffffffd660) at kernel/qapplication.cpp:4341
#21 0x0000003d8515d19c in QCoreApplication::notifyInternal (this=0x7fffffffda50, receiver=0x6c22a0, event=0x7fffffffd660) at kernel/qcoreapplication.cpp:731
#22 0x0000003d8518aeae in sendEvent (this=0x67e730) at kernel/qcoreapplication.h:215
#23 QTimerInfoList::activateTimers (this=0x67e730) at kernel/qeventdispatcher_unix.cpp:604
#24 0x0000003d85187c54 in timerSourceDispatch (source=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:184
#25 0x000000377b441e33 in g_main_dispatch (context=0x67d520) at gmain.c:2149
#26 g_main_context_dispatch (context=0x67d520) at gmain.c:2702
#27 0x000000377b442610 in g_main_context_iterate (context=0x67d520, block=1, dispatch=1, self=<value optimized out>) at gmain.c:2780
#28 0x000000377b4428ad in g_main_context_iteration (context=0x67d520, may_block=1) at gmain.c:2843
#29 0x0000003d8518834f in QEventDispatcherGlib::processEvents (this=0x62fde0, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:422
#30 0x0000003d8515c532 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#31 0x0000003d8515c77c in QEventLoop::exec (this=0x7fffffffd8c0, flags=...) at kernel/qeventloop.cpp:201
#32 0x0000003d85160c3b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1008
#33 0x00000000004034ad in ?? ()
#34 0x00007fffffffd9b0 in ?? ()
#35 0x00007fffffffd940 in ?? ()
#36 0x00007fffffffd990 in ?? ()
#37 0x00000038acf46978 in ~QString (_urlArg=<value optimized out>) at /usr/include/QtCore/qstring.h:883
#38 KCmdLineArgs::makeURL (_urlArg=<value optimized out>) at /usr/src/debug/kdelibs-4.6.1/kdecore/kernel/kcmdlineargs.cpp:1566
#39 0x00000038acf46a49 in ~QString (this=<value optimized out>, n=<value optimized out>) at /usr/include/QtCore/qstring.h:883
#40 KCmdLineArgs::url (this=<value optimized out>, n=<value optimized out>) at /usr/src/debug/kdelibs-4.6.1/kdecore/kernel/kcmdlineargs.cpp:1561
#41 0x0000000000403974 in ?? ()
#42 0x0000000000647120 in ?? ()
#43 0x00007fffffffdae0 in ?? ()
#44 0x00007fffffffdb20 in ?? ()
#45 0x00000038acf4586a in operator== (this=0x646e30, _options=..., _name=..., _id=...) at /usr/include/QtCore/qbytearray.h:512
#46 KCmdLineArgsPrivate (this=0x646e30, _options=..., _name=..., _id=...) at /usr/src/debug/kdelibs-4.6.1/kdecore/kernel/kcmdlineargs.cpp:343
#47 KCmdLineArgs::KCmdLineArgs (this=0x646e30, _options=..., _name=..., _id=...) at /usr/src/debug/kdelibs-4.6.1/kdecore/kernel/kcmdlineargs.cpp:1313
#48 0x00000000006546d0 in ?? ()
#49 0x00000038ad049d0b in ?? () from /usr/lib64/libkdecore.so.5
#50 0x0000000000000000 in ?? ()

(hrm... looks like I may be missing some -debuginfo ...)
Comment 1 Frank Reininghaus 2011-04-01 13:11:57 UTC
I think the backtrace is clear enough - it tries to open a dialog asking the user for an app to open the file with, and that fails because you've run it without GUI support (because of the --noninteractive option).

Probably it should just exit with an error message in that case.
Comment 2 Dawit Alemayehu 2011-08-10 23:27:28 UTC
Can you still reproduce this problem ? I cannot reproduce it with KDE 4.7.
Comment 3 Rex Dieter 2011-08-11 14:33:51 UTC
I can't reproduce it anymore on either kde-4.6.5 or kde-4.7.0

I get,

$ kde-open --noninteractive foo.noassoc
kioclient(28437) KMessageBoxWrapper::error: "<html>Unable to run the command specified. The file or folder <b>file:///home/rdieter/foo.noassoc</b> does not exist.</html>" 

so, not ideal, but no crash either.  yay.
Comment 4 Lasse Liehu 2014-06-27 21:59:53 UTC
I can reproduce this with kde-runtime and kdelibs built recently (probably less than two weeks ago) from master branch.

kde-open aborts with message: QWidget: Cannot create a QWidget when no GUI is being used
Comment 5 Lasse Liehu 2014-06-27 22:09:26 UTC
Created attachment 87439 [details]
Patch that fixes the crash in some situations

This patch asks KRun to not show progress info, which fixes the crash when trying to show progress info. This does not fix the crash when trying to show an error message.
Comment 6 Rex Dieter 2014-06-30 12:33:01 UTC
fyi, recent crashes are being tracked in bug #336117