Bug 265992 - Drkonqi should avoid synchronous d-bus operations (KWallet, others...)
Summary: Drkonqi should avoid synchronous d-bus operations (KWallet, others...)
Status: RESOLVED LATER
Alias: None
Product: drkonqi
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: LO crash
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
: 278575 286271 293759 308655 (view as bug list)
Depends on:
Blocks: 278575
  Show dependency treegraph
 
Reported: 2011-02-10 16:04 UTC by Šarūnas
Modified: 2019-07-02 12:08 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Šarūnas 2011-02-10 16:04:17 UTC
Version:           unspecified (using KDE 4.5.5) 
OS:                Linux

created bugtrack account via link, activated, entered in bug report tool, then the login box greyed out, but it was stuck, so pressed cancel and closed. then it crashed

Reproducible: Didn't try




Application: The KDE Crash Handler (drkonqi), signal: Segmentation fault
[KCrash Handler]
#6  text (this=<value optimized out>) at ../../include/QtGui/private/../../../src/gui/widgets/qlinecontrol_p.h:201
#7  QLineEdit::text (this=<value optimized out>) at widgets/qlineedit.cpp:377
#8  0x0000000000434261 in BugzillaLoginPage::loginClicked (this=0x234c040) at ../../drkonqi/reportassistantpages_bugzilla.cpp:239
#9  0x0000000000412aac in BugzillaLoginPage::qt_metacall (this=0x234c040, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fffbcf36120) at moc_reportassistantpages_bugzilla.cpp:81
#10 0x00007f275aa8ab27 in QMetaObject::activate (sender=0x235b8a0, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x2) at kernel/qobject.cpp:3280
#11 0x00007f275bd82402 in QAbstractButton::clicked (this=0x7fffbcf35ed0, _t1=false) at .moc/release-shared/moc_qabstractbutton.cpp:206
#12 0x00007f275ba7ceeb in QAbstractButtonPrivate::emitClicked (this=0x235b8e0) at widgets/qabstractbutton.cpp:546
#13 0x00007f275ba7e5bb in QAbstractButtonPrivate::click (this=0x235b8e0) at widgets/qabstractbutton.cpp:539
#14 0x00007f275ba7e82c in QAbstractButton::mouseReleaseEvent (this=0x235b8a0, e=0x7fffbcf36a70) at widgets/qabstractbutton.cpp:1121
#15 0x00007f275b6fb04e in QWidget::event (this=0x235b8a0, event=0x7fffbcf36a70) at kernel/qwidget.cpp:8187
#16 0x00007f275b6a4fdc in QApplicationPrivate::notify_helper (this=0x1d51c20, receiver=0x235b8a0, e=0x7fffbcf36a70) at kernel/qapplication.cpp:4396
#17 0x00007f275b6ab30e in QApplication::notify (this=0x1d51af0, receiver=0x235b8a0, e=0x7fffbcf36a70) at kernel/qapplication.cpp:3959
#18 0x00007f275c63f586 in KApplication::notify (this=0x1d51af0, receiver=0x235b8a0, event=0x7fffbcf36a70) at ../../kdeui/kernel/kapplication.cpp:310
#19 0x00007f275aa72cdc in QCoreApplication::notifyInternal (this=0x1d51af0, receiver=0x235b8a0, event=0x7fffbcf36a70) at kernel/qcoreapplication.cpp:732
#20 0x00007f275b6a9dbe in sendEvent (receiver=0x235b8a0, event=0x7fffbcf36a70, alienWidget=0x235b8a0, nativeWidget=0x234c040, buttonDown=<value optimized out>, lastMouseReceiver=<value optimized out>, spontaneous=true) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#21 QApplicationPrivate::sendMouseEvent (receiver=0x235b8a0, event=0x7fffbcf36a70, alienWidget=0x235b8a0, nativeWidget=0x234c040, buttonDown=<value optimized out>, lastMouseReceiver=<value optimized out>, spontaneous=true) at kernel/qapplication.cpp:3058
#22 0x00007f275b72d345 in QETWidget::translateMouseEvent (this=0x234c040, event=<value optimized out>) at kernel/qapplication_x11.cpp:4403
#23 0x00007f275b72bc5c in QApplication::x11ProcessEvent (this=<value optimized out>, event=0x7fffbcf37390) at kernel/qapplication_x11.cpp:3536
#24 0x00007f275b7580e2 in x11EventSourceDispatch (s=0x1d559b0, callback=<value optimized out>, user_data=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:146
#25 0x00007f2756485342 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#26 0x00007f27564892a8 in ?? () from /lib/libglib-2.0.so.0
#27 0x00007f275648945c in g_main_context_iteration () from /lib/libglib-2.0.so.0
#28 0x00007f275aa9f193 in QEventDispatcherGlib::processEvents (this=0x1d33c00, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:415
#29 0x00007f275b757a4e in QGuiEventDispatcherGlib::processEvents (this=0x7fffbcf35ed0, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#30 0x00007f275aa71a02 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#31 0x00007f275aa71dec in QEventLoop::exec (this=0x7fffbcf376c0, flags=) at kernel/qeventloop.cpp:201
#32 0x00007f275aa75ebb in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1009
#33 0x0000000000414da3 in main (argc=<value optimized out>, argv=<value optimized out>) at ../../drkonqi/main.cpp:108
Comment 1 George Kiagiadakis 2011-02-17 17:58:38 UTC
This probably happened because the "remember login details" checkbox was checked, so drkonqi attempted to open KWallet to save the login information. However, the communication with kwallet over d-bus took a long time, so you clicked the cancel button.

The problem is that the cancel button event was processed inside the event loop started from KWallet::Wallet::openWallet(), so the object that called this function was deleted and when this function returned after some timeout, the widget was already deleted and therefore crashed.

There are two bugs here:

1) KWallet should call QEventLoop::exec() with the QEventLoop::ExcludeUserInputEvents flag, imho, so that such a thing cannot happen.

2) Drkonqi should use KWallet asynchronously anyway...

CCing Michael, the KWallet maintainer. Michael, do you agree about using this flag in the event loop started from KWallet::Wallet::openWallet() ?
Comment 2 George Kiagiadakis 2011-11-12 12:56:10 UTC
*** Bug 286271 has been marked as a duplicate of this bug. ***
Comment 3 George Kiagiadakis 2012-03-29 09:48:05 UTC
*** Bug 293759 has been marked as a duplicate of this bug. ***
Comment 4 Jekyll Wu 2012-12-08 01:56:34 UTC
*** Bug 308655 has been marked as a duplicate of this bug. ***
Comment 5 Jekyll Wu 2013-01-19 03:51:00 UTC
*** Bug 278575 has been marked as a duplicate of this bug. ***
Comment 6 Harald Sitter 2019-07-02 12:08:30 UTC
Since kwallet 4.11.2 there no longer is a nested event loop so this crash is now impossible.

The kwallet API however is still sync, and in fact has no async variant, so the UI can probably lock up if kwallet fails to respond. Not much to be done about this I am afraid, not until we (KDE) move from kwallet to the scecret-service API (async by design), which I think isn't really being worked on by anyone :(