Web lists-archives.org

[PATCH] remove crashing kdebug in kshortcutseditoritem.cpp




Hi,

I encountered a crash (backtrace attached) while configuring KWin shortcuts, 
which is caused by the destructor of KShortcutEditorItem calling undo() which 
does a kDebug() accessing some data that apparently is no longer alive. This 
kDebug() was added in r778112.

Attached is a trivial patch removing that kDebug(), hence fixing that crash.

Should I commit? I'm not too sure as that kDebug() in undo() seems quite 
useful. Only when undo() is called from the destructor, does that kDebug() 
cause a crash. Well, maybe I should just leave that to the persons who know 
better that code.

Cheers,
Benoit
Application: KDE Control Module (kcmshell4), signal SIGSEGV
[Thread debugging using libthread_db enabled]
[New Thread 0xb638a720 (LWP 11734)]
[KCrash handler]
#6  QAction::text (this=0x831c7e0)
    at ../../include/QtCore/../../src/corelib/tools/qstring.h:676
#7  0xb78d908d in KShortcutsEditorItem::data (this=0x82c4ae8, column=0, 
    role=0)
    at /home/gaston/cuisine/trunk/kdelibs/kdeui/dialogs/kshortcutseditoritem.cpp:64
#8  0xb78d892d in KShortcutsEditorItem::undo (this=0x82c4ae8)
    at /home/gaston/cuisine/trunk/kdelibs/kdeui/dialogs/kshortcutseditoritem.cpp:283
#9  0xb78d9958 in ~KShortcutsEditorItem (this=0x82c4ae8)
    at /home/gaston/cuisine/trunk/kdelibs/kdeui/dialogs/kshortcutseditoritem.cpp:48
#10 0xb6f69941 in ~QTreeWidgetItem (this=0x82c52b8)
    at itemviews/qtreewidget.cpp:1500
#11 0xb6f67e81 in QTreeModel::clear (this=0x831cd00)
    at itemviews/qtreewidget.cpp:168
#12 0xb6f67ee9 in ~QTreeModel (this=0x831cd00)
    at itemviews/qtreewidget.cpp:150
#13 0xb72b67bf in QObjectPrivate::deleteChildren (this=0x831dee0)
    at kernel/qobject.cpp:1869
#14 0xb6aff731 in ~QWidget (this=0x831d568) at kernel/qwidget.cpp:1333
#15 0xb6de3cf1 in ~QFrame (this=0x831d568) at widgets/qframe.cpp:244
#16 0xb6e6db0a in ~QAbstractScrollArea (this=0x831d568)
    at widgets/qabstractscrollarea.cpp:481
#17 0xb6efa301 in ~QAbstractItemView (this=0x831d568)
    at itemviews/qabstractitemview.cpp:494
#18 0xb6f2f8e1 in ~QTreeView (this=0x831d568) at itemviews/qtreeview.cpp:211
#19 0xb6f66515 in ~QTreeWidget (this=0x831d568)
    at itemviews/qtreewidget.cpp:2493
#20 0xb72b67bf in QObjectPrivate::deleteChildren (this=0x831da90)
    at kernel/qobject.cpp:1869
#21 0xb6aff731 in ~QWidget (this=0x831cf70) at kernel/qwidget.cpp:1333
#22 0xb78dd491 in ~KShortcutsEditor (this=0x831cf70)
    at /home/gaston/cuisine/trunk/kdelibs/kdeui/dialogs/kshortcutseditor.cpp:72
#23 0xb72b67bf in QObjectPrivate::deleteChildren (this=0x8306ff8)
    at kernel/qobject.cpp:1869
#24 0xb6aff731 in ~QWidget (this=0x81e3be8) at kernel/qwidget.cpp:1333
#25 0xb79d373b in ~KCModule (this=0x81e3be8)
    at /home/gaston/cuisine/trunk/kdelibs/kdeui/widgets/kcmodule.cpp:131
#26 0xb24241e9 in ~PresentWindowsEffectConfig (this=0x81e3be8)
    at /home/gaston/cuisine/trunk/kdebase/workspace/kwin/effects/presentwindows_config.cpp:96
#27 0xb69464b0 in KCModuleProxy::deleteClient (this=0x80ee7a0)
    at /home/gaston/cuisine/trunk/kdelibs/kutils/kcmoduleproxy.cpp:216
#28 0xb694650f in ~KCModuleProxy (this=0x80ee7a0)
    at /home/gaston/cuisine/trunk/kdelibs/kutils/kcmoduleproxy.cpp:207
#29 0xb72b67bf in QObjectPrivate::deleteChildren (this=0x83163a8)
    at kernel/qobject.cpp:1869
#30 0xb6aff321 in ~QWidget (this=0x8316388) at kernel/qwidget.cpp:1333
#31 0xb72b67bf in QObjectPrivate::deleteChildren (this=0x8304bb8)
    at kernel/qobject.cpp:1869
#32 0xb6aff731 in ~QWidget (this=0x83100b0) at kernel/qwidget.cpp:1333
#33 0xb6eabfd3 in ~QDialog (this=0x83100b0) at dialogs/qdialog.cpp:300
#34 0xb78b2223 in ~KDialog (this=0x83100b0)
    at /home/gaston/cuisine/trunk/kdelibs/kdeui/dialogs/kdialog.cpp:183
#35 0xb72b67bf in QObjectPrivate::deleteChildren (this=0x820bb78)
    at kernel/qobject.cpp:1869
#36 0xb6aff731 in ~QWidget (this=0x820ba80) at kernel/qwidget.cpp:1333
#37 0xb694a249 in ~KPluginSelector (this=0x820ba80)
    at /home/gaston/cuisine/trunk/kdelibs/kutils/kpluginselector.cpp:629
#38 0xb72b67bf in QObjectPrivate::deleteChildren (this=0x820b5a0)
    at kernel/qobject.cpp:1869
#39 0xb6aff321 in ~QWidget (this=0x8209f78) at kernel/qwidget.cpp:1333
#40 0xb72b67bf in QObjectPrivate::deleteChildren (this=0x81ffd18)
    at kernel/qobject.cpp:1869
#41 0xb6aff731 in ~QWidget (this=0x81f3ce8) at kernel/qwidget.cpp:1333
#42 0xb6de3cf1 in ~QFrame (this=0x81f3ce8) at widgets/qframe.cpp:244
#43 0xb6e46985 in ~QStackedWidget (this=0x81f3ce8)
    at widgets/qstackedwidget.cpp:154
#44 0xb72b67bf in QObjectPrivate::deleteChildren (this=0x81ffbd0)
    at kernel/qobject.cpp:1869
#45 0xb6aff731 in ~QWidget (this=0x81f2818) at kernel/qwidget.cpp:1333
#46 0xb6e51c15 in ~QTabWidget (this=0x81f2818) at widgets/qtabwidget.cpp:325
#47 0xb72b67bf in QObjectPrivate::deleteChildren (this=0x8186ba8)
    at kernel/qobject.cpp:1869
#48 0xb6aff731 in ~QWidget (this=0x81f3c30) at kernel/qwidget.cpp:1333
#49 0xb79d373b in ~KCModule (this=0x81f3c30)
    at /home/gaston/cuisine/trunk/kdelibs/kdeui/widgets/kcmodule.cpp:131
#50 0xb48767e4 in ~KWinCompositingConfig (this=0x81f3c30)
    at /home/gaston/cuisine/trunk/kdebase/workspace/kwin/kcmkwin/kwincompositing/main.cpp:129
#51 0xb69464b0 in KCModuleProxy::deleteClient (this=0x8193708)
    at /home/gaston/cuisine/trunk/kdelibs/kutils/kcmoduleproxy.cpp:216
#52 0xb6943b1f in KCMultiDialogPrivate::_k_dialogClosed (this=0x80e9348)
    at /home/gaston/cuisine/trunk/kdelibs/kutils/kcmultidialog.cpp:98
#53 0xb6944b15 in KCMultiDialog::qt_metacall (this=0x80e92a8, 
    _c=QMetaObject::InvokeMetaMethod, _id=9, _a=0xbfa3cce8)
    at /home/kde4/kdelibs-build/kutils/kcmultidialog.moc:91
#54 0xb7f09270 in KCMShellMultiDialog::qt_metacall (this=0x80e92a8, 
    _c=QMetaObject::InvokeMetaMethod, _id=81, _a=0xbfa3cce8)
    at /home/kde4/kdebase-build/runtime/kcmshell/main.moc:115
#55 0xb72bb3aa in QMetaObject::activate (sender=0x80e92a8, 
    from_signal_index=51, to_signal_index=51, argv=0x0)
    at kernel/qobject.cpp:3007
#56 0xb72bb922 in QMetaObject::activate (sender=0x80e92a8, m=0xb7a9e284, 
    local_signal_index=16, argv=0x0) at kernel/qobject.cpp:3080
#57 0xb78aeea5 in KDialog::finished (this=0x80e92a8)
    at /home/kde4/kdelibs-build/kdeui/kdialog.moc:288
#58 0xb78aef24 in KDialog::hideEvent (this=0x80e92a8, event=0xbfa3d130)
    at /home/gaston/cuisine/trunk/kdelibs/kdeui/dialogs/kdialog.cpp:1005
#59 0xb6b00f89 in QWidget::event (this=0x80e92a8, event=0xbfa3d130)
    at kernel/qwidget.cpp:7119
#60 0xb6aaf32c in QApplicationPrivate::notify_helper (this=0x805ad18, 
    receiver=0x80e92a8, e=0xbfa3d130) at kernel/qapplication.cpp:3766
#61 0xb6ab641a in QApplication::notify (this=0xbfa3e484, receiver=0x80e92a8, 
    e=0xbfa3d130) at kernel/qapplication.cpp:3733
#62 0xb793c387 in KApplication::notify (this=0xbfa3e484, receiver=0x80e92a8, 
    event=0xbfa3d130)
    at /home/gaston/cuisine/trunk/kdelibs/kdeui/kernel/kapplication.cpp:311
#63 0xb72a9a11 in QCoreApplication::notifyInternal (this=0xbfa3e484, 
    receiver=0x80e92a8, event=0xbfa3d130) at kernel/qcoreapplication.cpp:583
#64 0xb6af9395 in QWidgetPrivate::hide_helper (this=0x80e9418)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#65 0xb6b0284d in QWidget::setVisible (this=0x80e92a8, visible=false)
    at kernel/qwidget.cpp:6395
#66 0xb6ead844 in QDialog::setVisible (this=0x80e92a8, visible=false)
    at dialogs/qdialog.cpp:707
#67 0xb6eabec6 in QDialog::done (this=0x80e92a8, r=1)
    at ../../include/QtGui/../../src/gui/kernel/qwidget.h:474
#68 0xb6eab6cc in QDialog::accept (this=0x80e92a8) at dialogs/qdialog.cpp:507
#69 0xb6943078 in KCMultiDialog::slotOkClicked (this=0x80e92a8)
    at /home/gaston/cuisine/trunk/kdelibs/kutils/kcmultidialog.cpp:228
#70 0xb6944ab5 in KCMultiDialog::qt_metacall (this=0x80e92a8, 
    _c=QMetaObject::InvokeMetaMethod, _id=5, _a=0xbfa3d308)
    at /home/kde4/kdelibs-build/kutils/kcmultidialog.moc:87
#71 0xb7f09270 in KCMShellMultiDialog::qt_metacall (this=0x80e92a8, 
    _c=QMetaObject::InvokeMetaMethod, _id=77, _a=0xbfa3d308)
    at /home/kde4/kdebase-build/runtime/kcmshell/main.moc:115
#72 0xb72bb3aa in QMetaObject::activate (sender=0x80e92a8, 
    from_signal_index=44, to_signal_index=44, argv=0x0)
    at kernel/qobject.cpp:3007
#73 0xb72bb922 in QMetaObject::activate (sender=0x80e92a8, m=0xb7a9e284, 
    local_signal_index=9, argv=0x0) at kernel/qobject.cpp:3080
#74 0xb78af0a9 in KDialog::okClicked (this=0x80e92a8)
    at /home/kde4/kdelibs-build/kdeui/kdialog.moc:245
#75 0xb78b076f in KDialog::slotButtonClicked (this=0x80e92a8, button=4)
    at /home/gaston/cuisine/trunk/kdelibs/kdeui/dialogs/kdialog.cpp:890
#76 0xb78b2f4a in KDialog::qt_metacall (this=0x80e92a8, 
    _c=QMetaObject::InvokeMetaMethod, _id=33, _a=0xbfa3d4fc)
    at /home/kde4/kdelibs-build/kdeui/kdialog.moc:180
#77 0xb796b68a in KPageDialog::qt_metacall (this=0x80e92a8, 
    _c=QMetaObject::InvokeMetaMethod, _id=68, _a=0xbfa3d4fc)
    at /home/kde4/kdelibs-build/kdeui/kpagedialog.moc:63
#78 0xb6944a1b in KCMultiDialog::qt_metacall (this=0x80e92a8, 
    _c=QMetaObject::InvokeMetaMethod, _id=68, _a=0xbfa3d4fc)
    at /home/kde4/kdelibs-build/kutils/kcmultidialog.moc:77
#79 0xb7f09270 in KCMShellMultiDialog::qt_metacall (this=0x80e92a8, 
    _c=QMetaObject::InvokeMetaMethod, _id=68, _a=0xbfa3d4fc)
    at /home/kde4/kdebase-build/runtime/kcmshell/main.moc:115
#80 0xb72bb3aa in QMetaObject::activate (sender=0x80e9398, 
    from_signal_index=4, to_signal_index=4, argv=0xbfa3d4fc)
    at kernel/qobject.cpp:3007
#81 0xb72bb922 in QMetaObject::activate (sender=0x80e9398, m=0xb7345a78, 
    local_signal_index=0, argv=0xbfa3d4fc) at kernel/qobject.cpp:3080
#82 0xb72c01a3 in QSignalMapper::mapped (this=0x80e9398, _t1=4)
    at .moc/release-shared/moc_qsignalmapper.cpp:93
#83 0xb72c027d in QSignalMapper::map (this=0x80e9398, sender=0x80ef108)
    at kernel/qsignalmapper.cpp:277
#84 0xb72c046e in QSignalMapper::map (this=0x80e9398)
    at kernel/qsignalmapper.cpp:268
#85 0xb72c137b in QSignalMapper::qt_metacall (this=0x80e9398, 
    _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0xbfa3d67c)
    at .moc/release-shared/moc_qsignalmapper.cpp:80
#86 0xb72bb3aa in QMetaObject::activate (sender=0x80ef108, 
    from_signal_index=29, to_signal_index=30, argv=0xbfa3d67c)
    at kernel/qobject.cpp:3007
#87 0xb72bb6a0 in QMetaObject::activate (sender=0x80ef108, m=0xb70cea84, 
    from_local_signal_index=2, to_local_signal_index=3, argv=0xbfa3d67c)
    at kernel/qobject.cpp:3100
#88 0xb7008711 in QAbstractButton::clicked (this=0x80ef108, _t1=false)
    at .moc/release-shared/moc_qabstractbutton.cpp:185
#89 0xb6d9d3a9 in QAbstractButtonPrivate::emitClicked (this=0x80ef150)
    at widgets/qabstractbutton.cpp:543
#90 0xb6d9e164 in QAbstractButtonPrivate::click (this=0x80ef150)
    at widgets/qabstractbutton.cpp:536
#91 0xb6d9e3c6 in QAbstractButton::mouseReleaseEvent (this=0x80ef108, 
    e=0xbfa3dc18) at widgets/qabstractbutton.cpp:1112
#92 0xb6b01446 in QWidget::event (this=0x80ef108, event=0xbfa3dc18)
    at kernel/qwidget.cpp:6920
#93 0xb6d9d24e in QAbstractButton::event (this=0x80ef108, e=0xbfa3dc18)
    at widgets/qabstractbutton.cpp:1074
#94 0xb6e33ac0 in QPushButton::event (this=0x80ef108, e=0xbfa3dc18)
    at widgets/qpushbutton.cpp:658
#95 0xb6aaf32c in QApplicationPrivate::notify_helper (this=0x805ad18, 
    receiver=0x80ef108, e=0xbfa3dc18) at kernel/qapplication.cpp:3766
#96 0xb6ab6cd7 in QApplication::notify (this=0xbfa3e484, receiver=0x80ef108, 
    e=0xbfa3dc18) at kernel/qapplication.cpp:3495
#97 0xb793c387 in KApplication::notify (this=0xbfa3e484, receiver=0x80ef108, 
    event=0xbfa3dc18)
    at /home/gaston/cuisine/trunk/kdelibs/kdeui/kernel/kapplication.cpp:311
#98 0xb72a9a11 in QCoreApplication::notifyInternal (this=0xbfa3e484, 
    receiver=0x80ef108, event=0xbfa3dc18) at kernel/qcoreapplication.cpp:583
#99 0xb6ab5fce in QApplicationPrivate::sendMouseEvent (receiver=0x80ef108, 
    event=0xbfa3dc18, alienWidget=0x80ef108, nativeWidget=0x80e92a8, 
    buttonDown=0xb70da5d0, lastMouseReceiver=@0xb70da5d4)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:218
#100 0xb6b14528 in QETWidget::translateMouseEvent (this=0x80e92a8, 
    event=0xbfa3e1cc) at kernel/qapplication_x11.cpp:4112
#101 0xb6b138c4 in QApplication::x11ProcessEvent (this=0xbfa3e484, 
    event=0xbfa3e1cc) at kernel/qapplication_x11.cpp:3112
#102 0xb6b39b5c in x11EventSourceDispatch (s=0x805df28, callback=0, 
    user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:148
#103 0xb6564bf8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#104 0xb6567e5e in ?? () from /usr/lib/libglib-2.0.so.0
#105 0x0805d298 in ?? ()
#106 0x00000000 in ?? ()
#0  0xb7f0e410 in __kernel_vsyscall ()
Index: kdelibs/kdeui/dialogs/kshortcutseditoritem.cpp
===================================================================
--- kdelibs/kdeui/dialogs/kshortcutseditoritem.cpp	(revision 805390)
+++ kdelibs/kdeui/dialogs/kshortcutseditoritem.cpp	(working copy)
@@ -278,11 +278,6 @@
 
 void KShortcutsEditorItem::undo()
 {
-#ifndef NDEBUG
-    if (m_oldLocalShortcut || m_oldGlobalShortcut || m_oldShapeGesture || m_oldRockerGesture ) {
-        kDebug(125) << "Undoing changes for " << data(Name, Qt::DisplayRole).toString();
-    }
-#endif
     if (m_oldLocalShortcut) {
         m_action->setShortcut(*m_oldLocalShortcut);
     }

Attachment: signature.asc
Description: This is a digitally signed message part.

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<