Bug 254748

Summary: File dialogs crash applications ( fileModule() returns 0 because KService failed to give a result )
Product: [Unmaintained] kfile Reporter: gabriel
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: andresbajotierra, baltasarq, cfeck, christopherheiny, faure, fleabus, gyurco, johnjaylward, m.janssens, nucleo, sebastian
Priority: NOR    
Version: 4.10.3   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description gabriel 2010-10-20 11:34:08 UTC
Application: kfontview (1.1)
KDE Platform Version: 4.4.5 (KDE 4.4.5)
Qt Version: 4.6.3
Operating System: Linux 2.6.34.7-59.AES.f13g.x86_64 x86_64
Distribution: "Fedora release 13 (Goddard)"

-- Information about the crash:
Clicked "Open" button in toolbar. Crash. Running kfontview second time, clicked "Open" button and everything was OK.

The crash does not seem to be reproducible.

 -- Backtrace:
Application: Font Viewer (kfontview), signal: Segmentation fault
82	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
[KCrash Handler]
#5  0x00000032619dd973 in KFileDialog::KFileDialog (this=0x7fffba31b6e0, startDir=..., filter=..., parent=<value optimized out>, customWidget=0x0)
    at /usr/src/debug/kdelibs-4.4.5/kio/kfile/kfiledialog.cpp:269
#6  0x00000032619e0628 in KFileDialogPrivate::getOpenUrl (startDir=..., filter=..., parent=<value optimized out>, caption=..., selectedFilter=0x0)
    at /usr/src/debug/kdelibs-4.4.5/kio/kfile/kfiledialog.cpp:570
#7  0x00000032619e084c in KFileDialog::getOpenUrl (startDir=<value optimized out>, filter=<value optimized out>, parent=<value optimized out>, caption=<value optimized out>)
    at /usr/src/debug/kdelibs-4.4.5/kio/kfile/kfiledialog.cpp:558
#8  0x0000000000405d4c in KFI::CViewer::fileOpen (this=0x1be92d0) at /usr/src/debug/kdebase-workspace-4.4.5/kcontrol/kfontinst/apps/Viewer.cpp:77
#9  0x0000000000405e02 in KFI::CViewer::qt_metacall (this=0x1be92d0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fffba31b960)
    at /usr/src/debug/kdebase-workspace-4.4.5/x86_64-redhat-linux-gnu/kcontrol/kfontinst/apps/Viewer.moc:77
#10 0x0000003f4fd66a36 in QMetaObject::activate (sender=0x1e9de60, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x7fffba31b960) at kernel/qobject.cpp:3295
#11 0x000000325ffa6422 in QAction::triggered (this=<value optimized out>, _t1=false) at .moc/release-shared/moc_qaction.cpp:263
#12 0x000000325ffa7b5b in QAction::activate (this=0x1e9de60, event=<value optimized out>) at kernel/qaction.cpp:1255
#13 0x00000032603ac9e9 in QMenuPrivate::activateCausedStack (this=0x1eb6bc0, causedStack=..., action=0x1e9de60, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:1002
#14 0x00000032603b1dda in QMenuPrivate::activateAction (this=0x1eb6bc0, action=0x1e9de60, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:1094
#15 0x00000032612d09fe in KMenu::mouseReleaseEvent (this=0x1ec5720, e=<value optimized out>) at /usr/src/debug/kdelibs-4.4.5/kdeui/widgets/kmenu.cpp:471
#16 0x000000325fff648a in QWidget::event (this=0x1ec5720, event=0x7fffba31c5b0) at kernel/qwidget.cpp:8044
#17 0x00000032603b3ddb in QMenu::event (this=0x1ec5720, e=0x7fffba31c5b0) at widgets/qmenu.cpp:2421
#18 0x000000325ffab39c in QApplicationPrivate::notify_helper (this=0x1bad3a0, receiver=0x1ec5720, e=0x7fffba31c5b0) at kernel/qapplication.cpp:4306
#19 0x000000325ffb1e2d in QApplication::notify (this=<value optimized out>, receiver=0x1ec5720, e=0x7fffba31c5b0) at kernel/qapplication.cpp:3871
#20 0x0000003261207016 in KApplication::notify (this=0x7fffba31d250, receiver=0x1ec5720, event=0x7fffba31c5b0) at /usr/src/debug/kdelibs-4.4.5/kdeui/kernel/kapplication.cpp:302
#21 0x0000003f4fd53ddc in QCoreApplication::notifyInternal (this=0x7fffba31d250, receiver=0x1ec5720, event=0x7fffba31c5b0) at kernel/qcoreapplication.cpp:726
#22 0x000000325ffb101e in sendEvent (receiver=0x1ec5720, event=0x7fffba31c5b0, alienWidget=0x0, nativeWidget=0x1ec5720, buttonDown=0x3260a2f088, lastMouseReceiver=..., spontaneous=true)
    at ../../src/corelib/kernel/qcoreapplication.h:215
#23 QApplicationPrivate::sendMouseEvent (receiver=0x1ec5720, event=0x7fffba31c5b0, alienWidget=0x0, nativeWidget=0x1ec5720, buttonDown=0x3260a2f088, lastMouseReceiver=..., spontaneous=true)
    at kernel/qapplication.cpp:2971
#24 0x00000032600235cd in QETWidget::translateMouseEvent (this=0x1ec5720, event=<value optimized out>) at kernel/qapplication_x11.cpp:4314
#25 0x0000003260021acc in QApplication::x11ProcessEvent (this=0x7fffba31d250, event=0x7fffba31ced0) at kernel/qapplication_x11.cpp:3513
#26 0x000000326004ab92 in x11EventSourceDispatch (s=0x1bb2460, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#27 0x0000003f47c3bd02 in g_main_dispatch (context=0x1bb11f0) at gmain.c:1960
#28 IA__g_main_context_dispatch (context=0x1bb11f0) at gmain.c:2513
#29 0x0000003f47c3fae8 in g_main_context_iterate (context=0x1bb11f0, block=1, dispatch=1, self=<value optimized out>) at gmain.c:2591
#30 0x0000003f47c3fc9c in IA__g_main_context_iteration (context=0x1bb11f0, may_block=1) at gmain.c:2654
#31 0x0000003f4fd79863 in QEventDispatcherGlib::processEvents (this=0x1b86c60, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:412
#32 0x000000326004a84e in QGuiEventDispatcherGlib::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#33 0x0000003f4fd52822 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#34 0x0000003f4fd52aec in QEventLoop::exec (this=0x7fffba31d200, flags=...) at kernel/qeventloop.cpp:201
#35 0x0000003f4fd561bb in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1003
#36 0x0000000000406308 in main (argc=<value optimized out>, argv=<value optimized out>) at /usr/src/debug/kdebase-workspace-4.4.5/kcontrol/kfontinst/apps/Viewer.cpp:163

Reported using DrKonqi
Comment 1 Christoph Feck 2010-10-20 12:54:40 UTC
In kfiledialog.cpp fileModule() returns 0 because KService failed to give a result (kbuildsycoca still running?)
Comment 2 David Faure 2010-11-02 22:06:11 UTC
Christoph wrote http://kde.pastebin.ca/1974638 but I was wondering if we should just have that -instead- of the KService-based lookup.

Sebastian, what do you think about the idea of replacing the trader query with a simple KConfig entry for the moduleName to use? How do you handle configuration right now anyway? Using keditfiletype?

I'm not sure what's the best solution. Obviously the trader should be made to work, even if that means waiting longer for kbuildsycoca; but that's unrelated to both the proposed patch and my suggestion; it's something that has to be solved at a much lower level, in fact.
Comment 3 Dario Andres 2011-01-23 15:51:15 UTC
*** Bug 263704 has been marked as a duplicate of this bug. ***
Comment 4 Joris Guisson 2011-01-31 18:19:37 UTC
*** Bug 262943 has been marked as a duplicate of this bug. ***
Comment 5 Myriam Schweingruber 2012-09-07 14:53:23 UTC
If you can reproduce this crash with KDE 4.9.0 or newer please provide a new backtrace.
Comment 6 Christoph Feck 2013-07-12 01:32:07 UTC
Bug 320771 is from KDE 4.10.3 and shows the same issue. From the description:

"I was also in the process of installing new KDE libraries (upgrade from kde 4.10.2 to 4.10.3) so it could be related to a mismatch of libraries at an inoportune time."

Updating KDE could have caused the sycoca to be rebuild.
Comment 7 Christoph Feck 2013-07-12 01:32:42 UTC
*** Bug 320771 has been marked as a duplicate of this bug. ***
Comment 8 Christoph Feck 2013-11-16 12:31:36 UTC
*** Bug 327675 has been marked as a duplicate of this bug. ***
Comment 9 Christoph Feck 2013-11-16 21:14:25 UTC
*** Bug 323450 has been marked as a duplicate of this bug. ***
Comment 10 Szombathelyi György 2014-06-28 14:38:58 UTC
It always happens to me, when I want to run an app compiled for an older version of kdelibs, and running a self-compiled KDE from the master branch (probably because of the system configuration cache mismatches?)
This backtrace is created when tried to open a file in KolourPaint for 4.12.5 running in an environment 4.13.60:

0x000000332cbec0bf in KFileDialog::KFileDialog (this=0x7fffffffcb60, startDir=..., filter=..., parent=<optimized out>, 
    customWidget=0x0) at /usr/src/debug/kdelibs-4.12.5/kio/kfile/kfiledialog.cpp:266
266         QWidget* fileQWidget = fileModule()->createFileWidget(startDir, this);
Comment 11 Christoph Feck 2015-05-10 23:57:00 UTC
*** Bug 347511 has been marked as a duplicate of this bug. ***
Comment 12 David Faure 2015-09-19 23:11:07 UTC
Thanks for the report.

The full redesign around KFileDialog and KFileWidget (+in ksycoca) means this can no longer happen in Plasma 5, closing.