Bug 213876

Summary: Konqueror crashed closing tab [KonqMainWindow::slotPartActivated, KonqViewManager::doSetActivePart, KParts::PartManager::eventFilter]
Product: [Applications] konqueror Reporter: Andrey Borzenkov <arvidjaar>
Component: generalAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: ab.kde, andresbajotierra, faure, frank78ac, johann-nikolaus, mail, marc, martin.nowack, okular-devel, paetow
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Mandriva RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: similar crash backtrace

Description Andrey Borzenkov 2009-11-09 18:40:20 UTC
Application: konqueror (4.3.73 (KDE 4.3.73 (KDE 4.4 >= 20091026)))
KDE Version: 4.3.73 (KDE 4.3.73 (KDE 4.4 >= 20091026))
Qt Version: 4.6.0
Operating System: Linux 2.6.31.5-desktop-1mnb x86_64
Distribution: "Mandriva Linux 2010.0"

What I was doing when the application crashed:

Konqueror crashed closing one tab while browsing Vmware site. Stack crash looks similar to 212213 but is slightly different.

 -- Backtrace:
Application: Konqueror (kdeinit4), signal: Segmentation fault
[KCrash Handler]
#5  KonqMainWindow::slotPartActivated (this=0x1e0dd00, part=0x44155a0) at /usr/src/debug/kdebase-4.3.73svn1040395/apps/konqueror/src/konqmainwindow.cpp:1979
#6  0x00007f3e034f87ac in KonqViewManager::doSetActivePart (this=0x1e11ea0, part=0x44155a0) at /usr/src/debug/kdebase-4.3.73svn1040395/apps/konqueror/src/konqviewmanager.cpp:1048
#7  0x00007f3e1181ad60 in KParts::PartManager::eventFilter (this=0x1e11ea0, obj=<value optimized out>, ev=0x7fff057cf130) at /usr/src/debug/kdelibs-4.3.73svn1040395/kparts/partmanager.cpp:282
#8  0x00007f3e12257ccb in QCoreApplicationPrivate::sendThroughApplicationEventFilters (this=0x1ce4200, receiver=0x5969f90, event=0x7fff057cf130) at kernel/qcoreapplication.cpp:800
#9  0x00007f3e0ff17cf6 in QApplicationPrivate::notify_helper (this=0x0, receiver=0x0, e=0x22fa370) at kernel/qapplication.cpp:4252
#10 0x00007f3e0ff1e4bd in QApplication::notify (this=0x7fff057d1410, receiver=0x5969f90, e=0x7fff057cf130) at kernel/qapplication.cpp:4166
#11 0x00007f3e10be5f96 in KApplication::notify (this=0x7fff057d1410, receiver=0x5969f90, event=0x7fff057cf130) at /usr/src/debug/kdelibs-4.3.73svn1040395/kdeui/kernel/kapplication.cpp:302
#12 0x00007f3e122587fc in QCoreApplication::notifyInternal (this=0x7fff057d1410, receiver=0x5969f90, event=0x7fff057cf130) at kernel/qcoreapplication.cpp:704
#13 0x00007f3e0ff1d256 in QApplicationPrivate::setFocusWidget (focus=0x5969f90, reason=Qt::TabFocusReason) at kernel/qapplication.cpp:2169
#14 0x00007f3e0ff66941 in QWidget::setFocus (this=0x5969f90, reason=Qt::TabFocusReason) at kernel/qwidget.cpp:6047
#15 0x00007f3e0ff66b81 in QWidget::focusNextPrevChild (this=<value optimized out>, next=true) at kernel/qwidget.cpp:6191
#16 0x00007f3e0ff6a225 in QWidgetPrivate::hide_helper (this=0x416c7d0) at kernel/qwidget.cpp:7205
#17 0x00007f3e0ff731d0 in QWidget::setVisible (this=0x4309550, visible=<value optimized out>) at kernel/qwidget.cpp:7365
#18 0x00007f3e0ff55b7c in QStackedLayout::setCurrentIndex (this=0x44ac720, index=1) at ../../src/gui/kernel/qwidget.h:482
#19 0x00007f3df455f7f0 in Sidebar::itemClicked (this=0x45342d0, item=<value optimized out>) at /usr/src/debug/kdegraphics-4.3.73svn1040395/okular/ui/sidebar.cpp:638
#20 0x00007f3df455f928 in Sidebar::setCurrentIndex (this=0x0, index=<value optimized out>) at /usr/src/debug/kdegraphics-4.3.73svn1040395/okular/ui/sidebar.cpp:577
#21 0x00007f3df455faa0 in Sidebar::setItemEnabled (this=0x45342d0, index=<value optimized out>, enabled=<value optimized out>) at /usr/src/debug/kdegraphics-4.3.73svn1040395/okular/ui/sidebar.cpp:558
#22 0x00007f3df44f73f5 in Part::qt_metacall (this=0x44155a0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff057cf580)
    at /usr/src/debug/kdegraphics-4.3.73svn1040395/build/okular/part.moc:232
#23 0x00007f3e1226b80a in QMetaObject::activate (sender=0x4309550, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x43f5c70) at kernel/qobject.cpp:3390
#24 0x00007f3df4566e9f in TOC::hasTOC (this=0x0, _t1=false) at /usr/src/debug/kdegraphics-4.3.73svn1040395/build/okular/toc.moc:90
#25 0x00007f3df3864120 in Okular::Document::closeDocument (this=0x491b400) at /usr/src/debug/kdegraphics-4.3.73svn1040395/okular/core/document.cpp:1834
#26 0x00007f3df44ebfad in Part::closeUrl (this=0x44155a0) at /usr/src/debug/kdegraphics-4.3.73svn1040395/okular/part.cpp:1096
#27 0x00007f3df44ec528 in ~Part (this=0x44155a0) at /usr/src/debug/kdegraphics-4.3.73svn1040395/okular/part.cpp:621
#28 0x00007f3e034f41af in ~KonqView (this=0x4511220) at /usr/src/debug/kdebase-4.3.73svn1040395/apps/konqueror/src/konqview.cpp:132
#29 0x00007f3e034f8e96 in KonqViewManager::removeTab (this=0x1e11ea0, currentFrame=0x55e08e8, emitAboutToRemoveSignal=<value optimized out>)
    at /usr/src/debug/kdebase-4.3.73svn1040395/apps/konqueror/src/konqviewmanager.cpp:404
#30 0x00007f3e0354383e in KonqMainWindow::slotRemoveTab (this=0x1e0dd00) at /usr/src/debug/kdebase-4.3.73svn1040395/apps/konqueror/src/konqmainwindow.cpp:2535
#31 0x00007f3e03548bdd in KonqMainWindow::qt_metacall (this=0x1e0dd00, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff057cfd20)
    at /usr/src/debug/kdebase-4.3.73svn1040395/build/apps/konqueror/src/konqmainwindow.moc:419
#32 0x00007f3e1226b80a in QMetaObject::activate (sender=0x22393c0, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x43f5c70) at kernel/qobject.cpp:3390
#33 0x00007f3e1058d322 in QAbstractButton::clicked (this=0x0, _t1=false) at .moc/release-shared/moc_qabstractbutton.cpp:206
#34 0x00007f3e102bbc2b in QAbstractButtonPrivate::emitClicked (this=0x2250b90) at widgets/qabstractbutton.cpp:546
#35 0x00007f3e102bcaeb in QAbstractButtonPrivate::click (this=0x2250b90) at widgets/qabstractbutton.cpp:539
#36 0x00007f3e102bcd55 in QAbstractButton::mouseReleaseEvent (this=0x22393c0, e=0x7fff057d05b0) at widgets/qabstractbutton.cpp:1118
#37 0x00007f3e10386a7a in QToolButton::mouseReleaseEvent (this=0x0, e=0x0) at widgets/qtoolbutton.cpp:721
#38 0x00007f3e0ff6b8ae in QWidget::event (this=0x22393c0, event=0x7fff057d05b0) at kernel/qwidget.cpp:7904
#39 0x00007f3e0ff17d7c in QApplicationPrivate::notify_helper (this=0x1ce4200, receiver=0x22393c0, e=0x7fff057d05b0) at kernel/qapplication.cpp:4277
#40 0x00007f3e0ff1ed71 in QApplication::notify (this=0x7fff057d1410, receiver=0x22393c0, e=0x7fff057d05b0) at kernel/qapplication.cpp:3863
#41 0x00007f3e10be5f96 in KApplication::notify (this=0x7fff057d1410, receiver=0x22393c0, event=0x7fff057d05b0) at /usr/src/debug/kdelibs-4.3.73svn1040395/kdeui/kernel/kapplication.cpp:302
#42 0x00007f3e122587fc in QCoreApplication::notifyInternal (this=0x7fff057d1410, receiver=0x22393c0, event=0x7fff057d05b0) at kernel/qcoreapplication.cpp:704
#43 0x00007f3e0ff1dec6 in QApplicationPrivate::sendMouseEvent (receiver=0x22393c0, event=0x7fff057d05b0, alienWidget=0x22393c0, nativeWidget=0x1e0dd00, buttonDown=<value optimized out>, 
    lastMouseReceiver=<value optimized out>, spontaneous=true) at ../../src/corelib/kernel/qcoreapplication.h:215
#44 0x00007f3e0ff944b5 in QETWidget::translateMouseEvent (this=0x1e0dd00, event=<value optimized out>) at kernel/qapplication_x11.cpp:4396
#45 0x00007f3e0ff931fa in QApplication::x11ProcessEvent (this=<value optimized out>, event=0x7fff057d0ed0) at kernel/qapplication_x11.cpp:3535
#46 0x00007f3e0ffbc032 in x11EventSourceDispatch (s=0x1ce7f10, callback=<value optimized out>, user_data=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:146
#47 0x00007f3e0ec554ce in IA__g_main_context_dispatch (context=0x1ce6cc0) at gmain.c:1960
#48 0x00007f3e0ec58e98 in g_main_context_iterate (context=0x1ce6cc0, block=<value optimized out>, dispatch=<value optimized out>, self=<value optimized out>) at gmain.c:2591
#49 0x00007f3e0ec58fc0 in IA__g_main_context_iteration (context=0x1ce6cc0, may_block=1) at gmain.c:2654
#50 0x00007f3e12281bb3 in QEventDispatcherGlib::processEvents (this=0x1c57e10, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:407
#51 0x00007f3e0ffbbc1e in QGuiEventDispatcherGlib::processEvents (this=0x0, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#52 0x00007f3e12257122 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#53 0x00007f3e122574fc in QEventLoop::exec (this=0x7fff057d1200, flags=) at kernel/qeventloop.cpp:201
#54 0x00007f3e1225b23b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:981
#55 0x00007f3e0357597b in kdemain (argc=<value optimized out>, argv=<value optimized out>) at /usr/src/debug/kdebase-4.3.73svn1040395/apps/konqueror/src/konqmain.cpp:257
#56 0x0000000000406a58 in launch (argc=2, _name=<value optimized out>, args=<value optimized out>, cwd=<value optimized out>, envc=16, envs=<value optimized out>, reset_env=false, tty=0x0, 
    avoid_loops=false, startup_id_str=0x1cb4cf4 "cooker;1257786902;877287;7558_TIME237254770") at /usr/src/debug/kdelibs-4.3.73svn1040395/kinit/kinit.cpp:705
#57 0x0000000000407750 in handle_launcher_request (sock=8, who=<value optimized out>) at /usr/src/debug/kdelibs-4.3.73svn1040395/kinit/kinit.cpp:1197
#58 0x0000000000407c01 in handle_requests (waitForPid=0) at /usr/src/debug/kdelibs-4.3.73svn1040395/kinit/kinit.cpp:1390
#59 0x00000000004088ca in main (argc=2, argv=<value optimized out>, envp=<value optimized out>) at /usr/src/debug/kdelibs-4.3.73svn1040395/kinit/kinit.cpp:1825

Reported using DrKonqi
Comment 1 Frank Reininghaus 2009-11-09 19:48:04 UTC
Thanks for the bug report! This looks indeed similar to bug 207173, but it looks like you had an Okular part open in the closed tab. Maybe the root cause is similar to the issue fixed by David in the KHTML part.

I'll CC the okular-devel mailing list.
Comment 2 Frank Reininghaus 2009-11-13 15:12:21 UTC
*** Bug 214380 has been marked as a duplicate of this bug. ***
Comment 3 Frank Reininghaus 2009-11-13 15:14:36 UTC
*** Bug 211239 has been marked as a duplicate of this bug. ***
Comment 4 David Faure 2009-11-13 16:28:12 UTC
Hmm, I should fix this at the konqueror level then, so that focus changes inside a part that is being deleted, are not taken into account.
Comment 5 Frank Reininghaus 2009-11-24 11:27:51 UTC
*** Bug 215863 has been marked as a duplicate of this bug. ***
Comment 6 Frank Reininghaus 2009-12-27 23:48:05 UTC
*** Bug 219983 has been marked as a duplicate of this bug. ***
Comment 7 Bernd Buschinski 2010-01-03 18:50:59 UTC
Created attachment 39522 [details]
similar crash backtrace

another similar backtrace, would be nice to have this bug fixed
(backtrace with kde-4.3.3, I accidentally deleted the backtarce with 4.3.4 but it looks the same)
Hope this backtrace helps a bit :)
Comment 8 Dario Andres 2010-01-07 12:53:07 UTC
From bug 221625:
-- Information about the crash:
I closed one instance of konqueror with 2 tabs opened. In one of them I was
viewing a pdf using okular, in the other one I viewed a website.
Comment 9 Dario Andres 2010-01-07 12:53:21 UTC
*** Bug 221625 has been marked as a duplicate of this bug. ***
Comment 10 Frank Reininghaus 2010-02-26 15:30:21 UTC
*** Bug 228437 has been marked as a duplicate of this bug. ***
Comment 11 David Faure 2010-03-16 20:55:32 UTC
First step: reproducing the bug. Using the pdf from bug 214380 I found the following steps:
* konqueror http://www.oedp.de/files/pdf/programme/BundespolitischesProgramm.pdf
* Ctrl+T (to get a second tab)
* Back to first tab, click on an entry in the table of contents (important so that it has focus).
* Ctrl+W (close tab) -> crash.

Okular::Document::closeDocument calls TOC::hasTOC(false), which hides the TOC widget, which triggers a focus change (the Sidebar gets focus), which PartManager notices, and it tries to set the okular part as active again.

OK, removing part from PartManager before deleting it, seems to work. Commit coming up.
Comment 12 David Faure 2010-03-16 21:02:49 UTC
SVN commit 1104129 by dfaure:

Move up the fix for 207173 (crash when closing khtml tab with focus in findbar) from khtml to konqueror,
so that it also fixes 213876 (crash when closing okularpart tab with focus in sidebar) :
unregister part from partmanager before deleting it.
CCBUG: 207173
BUG: 213876
Fixed for: 4.4.2


 M  +3 -0      kdebase/apps/konqueror/src/konqview.cpp  
 M  +1 -8      kdelibs/khtml/khtml_part.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1104129
Comment 13 Frank Reininghaus 2010-04-28 13:41:49 UTC
*** Bug 235617 has been marked as a duplicate of this bug. ***