Review Request 122978: Add unit test for crash of bug 343976

Martin Gräßlin mgraesslin at kde.org
Mon Mar 16 11:59:40 UTC 2015



> On March 16, 2015, 12:26 p.m., Jan Kundrát wrote:
> > This doesn't fix the problem triggered by Trojita:
> > 
> > ```
> > Program received signal SIGSEGV, Segmentation fault.
> > QWidget::removeAction (this=0x0, action=0x555555bf88a0) at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qwidget.cpp:3298
> > 3298    /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qwidget.cpp: No such file or directory.
> > (gdb) bt
> > #0  QWidget::removeAction (this=0x0, action=0x555555bf88a0) at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qwidget.cpp:3298
> > #1  0x00007fffe792e1a0 in SystemTrayMenu::removeMenuItem (this=0x555555cccd10, menuItem=<optimized out>)
> >     at /var/tmp/portage/kde-frameworks/frameworkintegration-9999/work/frameworkintegration-9999/src/platformtheme/kdeplatformsystemtrayicon.cpp:96
> > #2  0x00007ffff77a785f in QMenu::actionEvent (this=0x555555ade210, e=<optimized out>)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/widgets/qmenu.cpp:3193
> > #3  0x00007ffff765f960 in QWidget::event (this=this at entry=0x555555ade210, event=event at entry=0x7fffffffbc80)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qwidget.cpp:9042
> > #4  0x00007ffff77adb8b in QMenu::event (this=0x555555ade210, e=0x7fffffffbc80) at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/widgets/qmenu.cpp:2650
> > #5  0x00007ffff76104dc in QApplicationPrivate::notify_helper (this=this at entry=0x555555a72090, receiver=receiver at entry=0x555555ade210, e=e at entry=0x7fffffffbc80)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:3716
> > #6  0x00007ffff7615eba in QApplication::notify (this=0x7fffffffd4c0, receiver=0x555555ade210, e=0x7fffffffbc80)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:3499
> > #7  0x00007ffff440b9cd in QCoreApplication::notifyInternal (this=0x7fffffffd4c0, receiver=receiver at entry=0x555555ade210, event=event at entry=0x7fffffffbc80)
> >     at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp:963
> > #8  0x00007ffff7655ff9 in sendEvent (event=0x7fffffffbc80, receiver=0x555555ade210) at ../../include/QtCore/../../../qtwidgets-5.5.9999/src/corelib/kernel/qcoreapplication.h:228
> > #9  QWidget::removeAction (this=0x555555ade210, action=action at entry=0x555555c26fc0)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qwidget.cpp:3305
> > #10 0x00007ffff7603b51 in QAction::~QAction (this=0x555555c26fc0, __in_chrg=<optimized out>)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qaction.cpp:573
> > #11 0x00007ffff7603cdf in QAction::~QAction (this=0x555555c26fc0, __in_chrg=<optimized out>)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qaction.cpp:592
> > #12 0x00007ffff4441feb in QObjectPrivate::deleteChildren (this=this at entry=0x555555cb6a10)
> >     at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:1951
> > #13 0x00007ffff444d0dc in QObject::~QObject (this=<optimized out>, __in_chrg=<optimized out>)
> >     at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:1031
> > #14 0x00007ffff79fd62f in QSystemTrayIcon::~QSystemTrayIcon (this=0x555555cc90a0, __in_chrg=<optimized out>)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/util/qsystemtrayicon.cpp:150
> > #15 0x00005555555c39ac in Gui::MainWindow::removeSysTray (this=this at entry=0x7fffffffd570) at /home/jkt/work/prog/trojita/src/Gui/Window.cpp:795
> > #16 0x00005555555d5f88 in Gui::MainWindow::slotShowSettings (this=0x7fffffffd570) at /home/jkt/work/prog/trojita/src/Gui/Window.cpp:1150
> > #17 0x00005555555e51ca in Gui::MainWindow::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at moc_Window.cpp:397
> > #18 0x00007ffff4443bf8 in QMetaObject::activate (sender=sender at entry=0x555555bc61a0, signalOffset=<optimized out>, local_signal_index=local_signal_index at entry=1, 
> >     argv=argv at entry=0x7fffffffc110) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:3718
> > #19 0x00007ffff4444315 in QMetaObject::activate (sender=sender at entry=0x555555bc61a0, m=m at entry=0x7ffff7b96040 <QAction::staticMetaObject>, local_signal_index=local_signal_index at entry=1, 
> >     argv=argv at entry=0x7fffffffc110) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:3583
> > #20 0x00007ffff7603e1f in QAction::triggered (this=this at entry=0x555555bc61a0, _t1=false) at .moc/moc_qaction.cpp:363
> > #21 0x00007ffff7607357 in QAction::activate (this=0x555555bc61a0, event=<optimized out>)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qaction.cpp:1167
> > #22 0x00007ffff77a1cda in QMenuPrivate::activateCausedStack (this=this at entry=0x555555cb42f0, causedStack=..., action=action at entry=0x555555bc61a0, 
> >     action_e=action_e at entry=QAction::Trigger, self=self at entry=true) at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/widgets/qmenu.cpp:1130
> > #23 0x00007ffff77a8d4b in QMenuPrivate::activateAction (this=this at entry=0x555555cb42f0, action=action at entry=0x555555bc61a0, action_e=action_e at entry=QAction::Trigger, self=self at entry=true)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/widgets/qmenu.cpp:1207
> > #24 0x00007ffff77ad11a in QMenu::mouseReleaseEvent (this=<optimized out>, e=0x7fffffffc830)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/widgets/qmenu.cpp:2536
> > #25 0x00007ffff765fa9c in QWidget::event (this=this at entry=0x555555cc3bb0, event=event at entry=0x7fffffffc830)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qwidget.cpp:8676
> > #26 0x00007ffff77adb8b in QMenu::event (this=0x555555cc3bb0, e=0x7fffffffc830) at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/widgets/qmenu.cpp:2650
> > #27 0x00007ffff76104dc in QApplicationPrivate::notify_helper (this=this at entry=0x555555a72090, receiver=receiver at entry=0x555555cc3bb0, e=e at entry=0x7fffffffc830)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:3716
> > #28 0x00007ffff76169b0 in QApplication::notify (this=<optimized out>, receiver=0x555555cc3bb0, e=0x7fffffffc830)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:3276
> > #29 0x00007ffff440b9cd in QCoreApplication::notifyInternal (this=0x7fffffffd4c0, receiver=receiver at entry=0x555555cc3bb0, event=event at entry=0x7fffffffc830)
> >     at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp:963
> > #30 0x00007ffff7615255 in sendSpontaneousEvent (event=0x7fffffffc830, receiver=0x555555cc3bb0)
> >     at ../../include/QtCore/../../../qtwidgets-5.5.9999/src/corelib/kernel/qcoreapplication.h:231
> > #31 QApplicationPrivate::sendMouseEvent (receiver=receiver at entry=0x555555cc3bb0, event=event at entry=0x7fffffffc830, alienWidget=alienWidget at entry=0x0, nativeWidget=0x555555cc3bb0, 
> >     buttonDown=buttonDown at entry=0x7ffff7bc3980 <qt_button_down>, lastMouseReceiver=..., spontaneous=spontaneous at entry=true)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:2770
> > #32 0x00007ffff767e760 in QWidgetWindow::handleMouseEvent (this=this at entry=0x555555df1fc0, event=event at entry=0x7fffffffcce0)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qwidgetwindow.cpp:452
> > #33 0x00007ffff7680d63 in QWidgetWindow::event (this=0x555555df1fc0, event=0x7fffffffcce0)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qwidgetwindow.cpp:210
> > #34 0x00007ffff76104dc in QApplicationPrivate::notify_helper (this=this at entry=0x555555a72090, receiver=receiver at entry=0x555555df1fc0, e=e at entry=0x7fffffffcce0)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:3716
> > #35 0x00007ffff7615eba in QApplication::notify (this=0x7fffffffd4c0, receiver=0x555555df1fc0, e=0x7fffffffcce0)
> >     at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:3499
> > #36 0x00007ffff440b9cd in QCoreApplication::notifyInternal (this=0x7fffffffd4c0, receiver=receiver at entry=0x555555df1fc0, event=event at entry=0x7fffffffcce0)
> >     at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp:963
> > #37 0x00007ffff497668f in sendSpontaneousEvent (event=0x7fffffffcce0, receiver=0x555555df1fc0) at ../../include/QtCore/../../../qtgui-5.5.9999/src/corelib/kernel/qcoreapplication.h:231
> > #38 QGuiApplicationPrivate::processMouseEvent (e=0x555555e338d0) at /var/tmp/portage/dev-qt/qtgui-5.5.9999/work/qtgui-5.5.9999/src/gui/kernel/qguiapplication.cpp:1773
> > #39 0x00007ffff4978155 in QGuiApplicationPrivate::processWindowSystemEvent (e=e at entry=0x555555e338d0)
> >     at /var/tmp/portage/dev-qt/qtgui-5.5.9999/work/qtgui-5.5.9999/src/gui/kernel/qguiapplication.cpp:1576
> > #40 0x00007ffff4954081 in QWindowSystemInterface::sendWindowSystemEvents (flags=...)
> >     at /var/tmp/portage/dev-qt/qtgui-5.5.9999/work/qtgui-5.5.9999/src/gui/kernel/qwindowsysteminterface.cpp:608
> > #41 0x00007fffeaae99c2 in userEventSourceDispatch (source=<optimized out>)
> >     at /var/tmp/portage/dev-qt/qtgui-5.5.9999/work/qtgui-5.5.9999/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp:70
> > #42 0x00007fffef5d19c4 in g_main_dispatch (context=0x7fffe0001e00) at /var/tmp/portage/dev-libs/glib-2.40.0-r1/work/glib-2.40.0/glib/gmain.c:3064
> > #43 g_main_context_dispatch (context=context at entry=0x7fffe0001e00) at /var/tmp/portage/dev-libs/glib-2.40.0-r1/work/glib-2.40.0/glib/gmain.c:3663
> > #44 0x00007fffef5d1c18 in g_main_context_iterate (context=context at entry=0x7fffe0001e00, block=block at entry=1, dispatch=dispatch at entry=1, self=<optimized out>)
> >     at /var/tmp/portage/dev-libs/glib-2.40.0-r1/work/glib-2.40.0/glib/gmain.c:3734
> > #45 0x00007fffef5d1d0c in g_main_context_iteration (context=0x7fffe0001e00, may_block=1) at /var/tmp/portage/dev-libs/glib-2.40.0-r1/work/glib-2.40.0/glib/gmain.c:3795
> > #46 0x00007ffff4472991 in QEventDispatcherGlib::processEvents (this=0x555555ab9a80, flags=...)
> >     at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qeventdispatcher_glib.cpp:418
> > #47 0x00007ffff4408e4b in QEventLoop::exec (this=this at entry=0x7fffffffd140, flags=..., flags at entry=...)
> >     at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qeventloop.cpp:204
> > #48 0x00007ffff441221e in QCoreApplication::exec () at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp:1216
> > #49 0x00005555555b9c08 in main (argc=3, argv=<optimized out>) at /home/jkt/work/prog/trojita/src/Gui/main.cpp:217
> > ```

allright, that's yet another crash and I have it also in the unit test now.


- Martin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122978/#review77566
-----------------------------------------------------------


On March 16, 2015, 11:58 a.m., Martin Gräßlin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122978/
> -----------------------------------------------------------
> 
> (Updated March 16, 2015, 11:58 a.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Bugs: 343976
>     https://bugs.kde.org/show_bug.cgi?id=343976
> 
> 
> Repository: frameworkintegration
> 
> 
> Description
> -------
> 
> Use a QPointer for QMenu of SystemTrayMenu
> 
> We need better memory management as the QMenu the SystemTrayMenu creates
> might be deleted externally causing a double delete if the so-far
> QScopedPoiter cleans up.
> 
> Switch to QPointer and call deleteLater if the pointer is still valid
> during destroying the SystemTrayMenu.
> 
> BUG: 343976
> CHANGELOG: Fix possible crash when destroying a QSystemTrayIcon (triggered by Trojita)
> 
> 
> Diffs
> -----
> 
>   autotests/CMakeLists.txt e8ed6a99bb45969231ba21b8c5588e093bbbe3ee 
>   autotests/ksni_unittest.cpp PRE-CREATION 
>   src/platformtheme/kdeplatformsystemtrayicon.h 8f13a36ae7cebed7499ce8a160f3533665b909ac 
>   src/platformtheme/kdeplatformsystemtrayicon.cpp ce3d3de9f9cf479a5fe3af65ef7fb8ec2b9e0d29 
> 
> Diff: https://git.reviewboard.kde.org/r/122978/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Martin Gräßlin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150316/0a93e5e0/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list