Bug 173473 - Konqueror crashes if an input line has focus and the profile is changed to "File Management"
Summary: Konqueror crashes if an input line has focus and the profile is changed to "F...
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: 4.1.2
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 171179 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-24 22:58 UTC by Frank Reininghaus
Modified: 2009-03-26 20:15 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Suggested patch (451 bytes, patch)
2008-10-24 23:24 UTC, Frank Reininghaus
Details
Alternative (probably better) patch (383 bytes, patch)
2008-10-24 23:38 UTC, Frank Reininghaus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Reininghaus 2008-10-24 22:58:32 UTC
Version:            (using Devel)
Compiler:          gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3) 
OS:                Irix
Installed from:    Compiled sources

I'm getting a crash in Konqueror from trunk rev. 875277 and also 4.1.2 (Kubuntu) if an input line has focus (try the one on the left, below "Actions") and I change the view profile to "File Management" via "Settings->Load View Profile->File Management".

Application: Konqueror (konqueror), signal SIGSEGV

Thread 1 (Thread 0xb5d9d8d0 (LWP 13602)):
[KCrash Handler]
#6  0xb7ed60a6 in KonqView::isPassiveMode (this=0x0) at /home/kde-devel/kde/src/KDE/kdebase/apps/konqueror/src/konqview.h:286
#7  0xb7f2b313 in KonqMainWindow::slotPartActivated (this=0x81166b8, part=0x82b47f8) at /home/kde-devel/kde/src/KDE/kdebase/apps/konqueror/src/konqmainwindow.cpp:1979
#8  0xb7ee7518 in KonqViewManager::emitActivePartChanged (this=0x80d1a68) at /home/kde-devel/kde/src/KDE/kdebase/apps/konqueror/src/konqviewmanager.cpp:1023
#9  0xb7ee7936 in KonqViewManager::doSetActivePart (this=0x80d1a68, part=0x82b47f8) at /home/kde-devel/kde/src/KDE/kdebase/apps/konqueror/src/konqviewmanager.cpp:994
#10 0xb7ee7956 in KonqViewManager::setActivePart (this=0x80d1a68, part=0x82b47f8) at /home/kde-devel/kde/src/KDE/kdebase/apps/konqueror/src/konqviewmanager.cpp:955
#11 0xb66d4b97 in KParts::PartManager::eventFilter (this=0x80d1a68, obj=0x82b4d00, ev=0xbf9fcd88) at /home/kde-devel/kde/src/KDE/kdelibs/kparts/partmanager.cpp:282
#12 0xb74f897d in QCoreApplicationPrivate::sendThroughApplicationEventFilters (this=0x805d1a0, receiver=0x82b4d00, event=0xbf9fcd88) at kernel/qcoreapplication.cpp:682
#13 0xb68422ec in QApplicationPrivate::notify_helper (this=0x805d1a0, receiver=0x82b4d00, e=0xbf9fcd88) at kernel/qapplication.cpp:3784
#14 0xb6844199 in QApplication::notify (this=0xbf9fed20, receiver=0x82b4d00, e=0xbf9fcd88) at kernel/qapplication.cpp:3774
#15 0xb7a6971f in KApplication::notify (this=0xbf9fed20, receiver=0x82b4d00, event=0xbf9fcd88) at /home/kde-devel/kde/src/KDE/kdelibs/kdeui/kernel/kapplication.cpp:307
#16 0xb74faa71 in QCoreApplication::notifyInternal (this=0xbf9fed20, receiver=0x82b4d00, event=0xbf9fcd88) at kernel/qcoreapplication.cpp:593
#17 0xb74ff041 in QCoreApplication::sendEvent (receiver=0x82b4d00, event=0xbf9fcd88) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#18 0xb68459cb in QApplicationPrivate::setFocusWidget (focus=0x82b4d00, reason=Qt::OtherFocusReason) at kernel/qapplication.cpp:2005
#19 0xb68a3188 in QWidget::setFocus (this=0x82b4d00, reason=Qt::OtherFocusReason) at kernel/qwidget.cpp:5382
#20 0xb3c5de49 in QWidget::setFocus (this=0x82b4d00) at /home/kde-devel/qt-copy/include/QtGui/qwidget.h:409
#21 0xb3cd3b91 in DOM::DocumentImpl::quietResetFocus (this=0x845a6e0) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/xml/dom_docimpl.cpp:2386
#22 0xb3c4f166 in KHTMLView::focusNextPrevNode (this=0x82b4d00, next=true) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/khtmlview.cpp:2512
#23 0xb3c4fda4 in KHTMLView::focusNextPrevChild (this=0x82b4d00, next=true) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/khtmlview.cpp:2056
#24 0xb68a3427 in QWidget::focusNextPrevChild (this=0x82b4910, next=true) at kernel/qwidget.cpp:5516
#25 0xb68a3427 in QWidget::focusNextPrevChild (this=0x864d6a8, next=true) at kernel/qwidget.cpp:5516
#26 0xb68a3427 in QWidget::focusNextPrevChild (this=0x8488a68, next=true) at kernel/qwidget.cpp:5516
#27 0xb68a9479 in QWidgetPrivate::hide_helper (this=0x83209b0) at kernel/qwidget.cpp:6467
#28 0xb68b0bc1 in QWidget::setVisible (this=0x8488a68, visible=false) at kernel/qwidget.cpp:6621
#29 0xb3c584ae in QWidget::hide (this=0x8488a68) at /home/kde-devel/qt-copy/include/QtGui/qwidget.h:474
#30 0xb3e09284 in ~RenderWidget (this=0x8368bfc) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/rendering/render_replaced.cpp:231
#31 0xb3e15f1e in ~RenderFormElement (this=0x8368bfc) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/rendering/render_form.cpp:96
#32 0xb3e198c6 in ~RenderLineEdit (this=0x8368bfc) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/rendering/render_form.h:248
#33 0xb3dbeab2 in khtml::RenderObject::arenaDelete (this=0x8368c04, arena=0x8486ad8, base=0x8368bfc) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/rendering/render_object.cpp:1896
#34 0xb3dbeb1c in khtml::RenderObject::arenaDelete (this=0x8368c04, arena=0x8486ad8) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/rendering/render_object.cpp:1909
#35 0xb3e03b50 in khtml::RenderWidget::deref (this=0x8368bfc) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/rendering/render_replaced.cpp:1171
#36 0xb3e095b4 in khtml::RenderWidget::detach (this=0x8368bfc) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/rendering/render_replaced.cpp:223
#37 0xb3ceb118 in DOM::NodeImpl::detach (this=0x837ecc8) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/xml/dom_nodeimpl.cpp:984
#38 0xb3ceb18e in DOM::NodeBaseImpl::detach (this=0x837ecc8) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/xml/dom_nodeimpl.cpp:1749
#39 0xb3cfc060 in DOM::ElementImpl::detach (this=0x837ecc8) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/xml/dom_elementimpl.cpp:844
#40 0xb3ceb17d in DOM::NodeBaseImpl::detach (this=0x833bc58) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/xml/dom_nodeimpl.cpp:1747
#41 0xb3cfc060 in DOM::ElementImpl::detach (this=0x833bc58) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/xml/dom_elementimpl.cpp:844
#42 0xb3ceb17d in DOM::NodeBaseImpl::detach (this=0x845ee20) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/xml/dom_nodeimpl.cpp:1747
#43 0xb3cfc060 in DOM::ElementImpl::detach (this=0x845ee20) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/xml/dom_elementimpl.cpp:844
#44 0xb3ceb17d in DOM::NodeBaseImpl::detach (this=0x83377d0) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/xml/dom_nodeimpl.cpp:1747
#45 0xb3cfc060 in DOM::ElementImpl::detach (this=0x83377d0) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/xml/dom_elementimpl.cpp:844
#46 0xb3ceb17d in DOM::NodeBaseImpl::detach (this=0x845a6ec) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/xml/dom_nodeimpl.cpp:1747
#47 0xb3cd5c41 in DOM::DocumentImpl::detach (this=0x845a6e0) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/xml/dom_docimpl.cpp:1511
#48 0xb3c81895 in KHTMLPart::clear (this=0x82b47f8) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/khtml_part.cpp:1454
#49 0xb3c90a31 in ~KHTMLPart (this=0x82b47f8) at /home/kde-devel/kde/src/KDE/kdelibs/khtml/khtml_part.cpp:534
#50 0xb7ee19e2 in ~KonqView (this=0x82c4a88) at /home/kde-devel/kde/src/KDE/kdebase/apps/konqueror/src/konqview.cpp:132
#51 0xb7eea557 in KonqViewManager::clear (this=0x80d1a68) at /home/kde-devel/kde/src/KDE/kdebase/apps/konqueror/src/konqviewmanager.cpp:652
#52 0xb7eea920 in KonqViewManager::loadViewProfileFromGroup (this=0x80d1a68, profileGroup=@0xbf9fd72c, filename=@0xbf9fd884, forcedUrl=@0xbf9fd840, req=@0xbf9fd7c8, openUrl=true)
    at /home/kde-devel/kde/src/KDE/kdebase/apps/konqueror/src/konqviewmanager.cpp:899
#53 0xb7eead89 in KonqViewManager::loadViewProfileFromConfig (this=0x80d1a68, _cfg=@0xbf9fd780, path=@0xbf9fd888, filename=@0xbf9fd884, forcedUrl=@0xbf9fd840, req=@0xbf9fd7c8, resetWindow=false, 
    openUrl=true) at /home/kde-devel/kde/src/KDE/kdebase/apps/konqueror/src/konqviewmanager.cpp:880
#54 0xb7eeae41 in KonqViewManager::loadViewProfileFromFile (this=0x80d1a68, path=@0xbf9fd888, filename=@0xbf9fd884, forcedUrl=@0xbf9fd840, req=@0xbf9fd7c8, resetWindow=false, openUrl=true)
    at /home/kde-devel/kde/src/KDE/kdebase/apps/konqueror/src/konqviewmanager.cpp:836
#55 0xb7eebc61 in KonqViewManager::slotProfileActivated (this=0x80d1a68, action=0x80c3510) at /home/kde-devel/kde/src/KDE/kdebase/apps/konqueror/src/konqviewmanager.cpp:1361
#56 0xb7eed1fe in KonqViewManager::qt_metacall (this=0x80d1a68, _c=QMetaObject::InvokeMetaMethod, _id=5, _a=0xbf9fd9fc)
    at /home/kde-devel/kde/build/KDE/kdebase/apps/konqueror/src/konqviewmanager.moc:90
#57 0xb7512923 in QMetaObject::activate (sender=0x822d1e0, from_signal_index=29, to_signal_index=29, argv=0xbf9fd9fc) at kernel/qobject.cpp:3037
#58 0xb7512ead in QMetaObject::activate (sender=0x822d1e0, m=0xb71716c8, local_signal_index=2, argv=0xbf9fd9fc) at kernel/qobject.cpp:3107
#59 0xb6ccc244 in QMenu::triggered (this=0x822d1e0, _t1=0x80c3510) at .moc/debug-shared/moc_qmenu.cpp:156
#60 0xb6ccfe31 in QMenuPrivate::_q_actionTriggered (this=0x8230aa8) at widgets/qmenu.cpp:1071
#61 0xb6cd3feb in QMenu::qt_metacall (this=0x822d1e0, _c=QMetaObject::InvokeMetaMethod, _id=8, _a=0xbf9fdb8c) at .moc/debug-shared/moc_qmenu.cpp:98
#62 0xb7b46fd2 in KMenu::qt_metacall (this=0x822d1e0, _c=QMetaObject::InvokeMetaMethod, _id=35, _a=0xbf9fdb8c) at /home/kde-devel/kde/build/KDE/kdelibs/kdeui/kmenu.moc:69
#63 0xb7512923 in QMetaObject::activate (sender=0x80c3510, from_signal_index=5, to_signal_index=6, argv=0xbf9fdb8c) at kernel/qobject.cpp:3037
#64 0xb7512c14 in QMetaObject::activate (sender=0x80c3510, m=0xb716b878, from_local_signal_index=1, to_local_signal_index=2, argv=0xbf9fdb8c) at kernel/qobject.cpp:3127
#65 0xb68390da in QAction::triggered (this=0x80c3510, _t1=false) at .moc/debug-shared/moc_qaction.cpp:216
#66 0xb683b0fa in QAction::activate (this=0x80c3510, event=QAction::Trigger) at kernel/qaction.cpp:1131
#67 0xb6cd5d08 in QMenuPrivate::activateAction (this=0x8230aa8, action=0x80c3510, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:1008
#68 0xb6cd875f in QMenu::mouseReleaseEvent (this=0x822d1e0, e=0xbf9fe3b8) at widgets/qmenu.cpp:2175
#69 0xb7b46e90 in KMenu::mouseReleaseEvent (this=0x822d1e0, e=0xbf9fe3b8) at /home/kde-devel/kde/src/KDE/kdelibs/kdeui/widgets/kmenu.cpp:452
#70 0xb68ab101 in QWidget::event (this=0x822d1e0, event=0xbf9fe3b8) at kernel/qwidget.cpp:7169
#71 0xb6cd3868 in QMenu::event (this=0x822d1e0, e=0xbf9fe3b8) at widgets/qmenu.cpp:2271
#72 0xb6842445 in QApplicationPrivate::notify_helper (this=0x805d1a0, receiver=0x822d1e0, e=0xbf9fe3b8) at kernel/qapplication.cpp:3809
#73 0xb6842f44 in QApplication::notify (this=0xbf9fed20, receiver=0x822d1e0, e=0xbf9fe3b8) at kernel/qapplication.cpp:3534
#74 0xb7a6971f in KApplication::notify (this=0xbf9fed20, receiver=0x822d1e0, event=0xbf9fe3b8) at /home/kde-devel/kde/src/KDE/kdelibs/kdeui/kernel/kapplication.cpp:307
#75 0xb74faa71 in QCoreApplication::notifyInternal (this=0xbf9fed20, receiver=0x822d1e0, event=0xbf9fe3b8) at kernel/qcoreapplication.cpp:593
#76 0xb684fe63 in QCoreApplication::sendSpontaneousEvent (receiver=0x822d1e0, event=0xbf9fe3b8) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:218
#77 0xb6847590 in QApplicationPrivate::sendMouseEvent (receiver=0x822d1e0, event=0xbf9fe3b8, alienWidget=0x0, nativeWidget=0x822d1e0, buttonDown=0xb7189800, lastMouseReceiver=@0xb7189804)
    at kernel/qapplication.cpp:2799
#78 0xb68d2170 in QETWidget::translateMouseEvent (this=0x822d1e0, event=0xbf9fe97c) at kernel/qapplication_x11.cpp:3982
#79 0xb68cf9cd in QApplication::x11ProcessEvent (this=0xbf9fed20, event=0xbf9fe97c) at kernel/qapplication_x11.cpp:3044
#80 0xb68ffaf9 in x11EventSourceDispatch (s=0x80600a8, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:148
#81 0xb6027cc6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#82 0xb602b083 in ?? () from /usr/lib/libglib-2.0.so.0
#83 0xb602b63e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#84 0xb752fff8 in QEventDispatcherGlib::processEvents (this=0x805d2a8, flags=@0xbf9feb14) at kernel/qeventdispatcher_glib.cpp:325
#85 0xb68ff1c8 in QGuiEventDispatcherGlib::processEvents (this=0x805d2a8, flags=@0xbf9feb44) at kernel/qguieventdispatcher_glib.cpp:204
#86 0xb74f72ee in QEventLoop::processEvents (this=0xbf9febcc, flags=@0xbf9feb84) at kernel/qeventloop.cpp:149
#87 0xb74f752d in QEventLoop::exec (this=0xbf9febcc, flags=@0xbf9febd4) at kernel/qeventloop.cpp:200
#88 0xb74fb3a8 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:851
#89 0xb684215e in QApplication::exec () at kernel/qapplication.cpp:3337
#90 0xb7f682f3 in kdemain (argc=1, argv=0xbf9ff094) at /home/kde-devel/kde/src/KDE/kdebase/apps/konqueror/src/konqmain.cpp:257
#91 0x080486f6 in main (argc=11084424, argv=0xb718b000) at /home/kde-devel/kde/build/KDE/kdebase/apps/konqueror/src/konqueror_dummy.cpp:3
Comment 1 Frank Reininghaus 2008-10-24 23:09:07 UTC
Sorry, the OS is Linux not IRIX, of course ;-)
Comment 2 Frank Reininghaus 2008-10-24 23:24:07 UTC
Created attachment 28122 [details]
Suggested patch

This patch fixes it for me.
Comment 3 Frank Reininghaus 2008-10-24 23:38:55 UTC
Created attachment 28125 [details]
Alternative (probably better) patch

It's probably sufficient to clear the focus in ~RenderFormElement(), not in ~RenderWidget(). I would guess that this crash occurs only with form elements, so it's not necessary to have every RenderWidget check on destruction if it's got the focus.
Comment 4 Germain Garand 2008-10-25 00:13:31 UTC
looks fine to me, thanks!
I prefer your version (1) though (it keeps widget related cleanups all at the same place and tests for null m_widget)
Comment 5 Frank Reininghaus 2008-10-25 00:33:13 UTC
(In reply to comment #4)

Actually, I thought of the null test just after I attached the second patch, this could easily be added to that patch as well ;-) Maybe it's really more elegant to have all the cleanup stuff in the same place. I just thought that it might be better not to add too much unneeded overhead to the destruction of every single widget.

Comment 6 Germain Garand 2008-10-25 01:18:43 UTC
not a matter of elegance, just easier for the maintening mind...
besides I see no obvious reason this would be guarantedly specific to form widgets -> better safe than sorry.
as for the overhead, any widget has an overhead many magnitudes higher than such a method (so it is negligible)

If nothing of the above convinces you, then just commit the version you prefer because I certainly do not care *all* that much :)
Comment 7 Frank Reininghaus 2008-10-25 11:34:46 UTC
(In reply to comment #6)
I don't care all that much either, but you're right: making future maintenance easier is certainly a strong point for version 1 :-)

> just commit the version you prefer

I don't have an SVN account, so it would be nice if you could do that.
Comment 8 Sebastian Sauer 2008-10-27 00:17:18 UTC
Yay, fantastic work Frank. Thank you!

@Germain: bug #171179 looks like a dup of this one :)
Comment 9 Germain Garand 2008-11-17 09:09:38 UTC
SVN commit 885366 by ggarand:

Apply patch by Frank Reininghaus <frank78ac googlemail com> :

properly clear the focus on form widgets, to avoid crashing when
changing the view profile.

BUG: 173473


 M  +2 -0      render_replaced.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=885366
Comment 10 Germain Garand 2008-11-17 09:22:23 UTC
SVN commit 885374 by ggarand:

automatically merged revision 885366:
Apply patch by Frank Reininghaus <frank78ac googlemail com> :

properly clear the focus on form widgets, to avoid crashing when
changing the view profile.

BUG: 173473

 M  +2 -0      render_replaced.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=885374
Comment 11 Frank Reininghaus 2009-03-26 20:15:24 UTC
*** Bug 171179 has been marked as a duplicate of this bug. ***