Bug 160183 - Crashed on exit after opening many windows
Summary: Crashed on exit after opening many windows
Status: CLOSED FIXED
Alias: None
Product: kate
Classification: Applications
Component: kwrite (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 160326 160657 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-31 21:42 UTC by Brian Taylor
Modified: 2008-04-12 11:15 UTC (History)
4 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 Brian Taylor 2008-03-31 21:42:22 UTC
Version:            (using Devel)
Installed from:    Compiled sources
Compiler:          gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2) 
OS:                Linux

I opened many windows in kwrite (10+), typed in the final one, exited without saving and then closed all of the other windows by clicking on the window manager (x). After I closed the final window, kwrite crashed with this backtrace.

I'm running the latest subversion snapshot fetched today (3/31).



Application: KWrite (kwrite), signal SIGSEGV
Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 47617654270416 (LWP 3471)]
[KCrash handler]
#5  0x0000000000700cb0 in ?? ()
#6  0x00002b4ed26d78fb in qDeleteAll<QList<KPluginFactory*>::const_iterator> (
    begin=@0x7fffd9393950, end=@0x7fffd9393940)
    at /home/kde-devel/qt-copy/include/QtCore/qalgorithms.h:352
#7  0x00002b4ed26d794b in qDeleteAll<KTextEditorFactoryList> (c=@0x6ed130)
    at /home/kde-devel/qt-copy/include/QtCore/qalgorithms.h:360
#8  0x00002b4ed26d5306 in cleanupKTextEditorFactoryList ()
    at /home/kde-devel/kde/src/kdelibs/interfaces/ktexteditor/ktexteditor.cpp:199
#9  0x00002b4ed58898a3 in qt_call_post_routines ()
    at /home/kde-devel/kde/src/qt-copy/src/corelib/kernel/qcoreapplication.cpp:163
#10 0x00002b4ed6414678 in ~QApplication (this=0x7fffd9393aa0)
    at /home/kde-devel/kde/src/qt-copy/src/gui/kernel/qapplication.cpp:932
#11 0x00002b4ed2af1915 in ~KApplication (this=0x7fffd9393aa0)
    at /home/kde-devel/kde/src/kdelibs/kdeui/kernel/kapplication.cpp:913
#12 0x00002b4ed1942645 in kdemain (argc=1, argv=0x7fffd93947c8)
    at /home/kde-devel/kde/src/KDE/kdebase/apps/kwrite/kwritemain.cpp:786
#13 0x00000000004008e3 in main (argc=1, argv=0x7fffd93947c8)
    at /home/kde-devel/kde/build/KDE/kdebase/apps/kwrite/kwrite_dummy.cpp:3
#0  0x00002b4ed77ae2b0 in nanosleep () from /lib/libc.so.6
Comment 1 Brian Taylor 2008-03-31 21:48:57 UTC
The version was (kdebase) r792250
Comment 2 Oliver Putz 2008-04-08 02:01:06 UTC
I just experienced the same crash after closing two kwrite windows very quickly after one another. The backtrace I got with kdelibs r794323 was:

Application: KWrite (kwrite), signal SIGSEGV
Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 0xb635f6d0 (LWP 8626)]
[KCrash handler]
#6  0x00000000 in ?? ()
#7  0xb7b24186 in qDeleteAll<QList<KPluginFactory*>::const_iterator> (
    begin=@0xbfc97ee8, end=@0xbfc97ee4)
    at /usr/include/qt4/QtCore/qalgorithms.h:352
#8  0xb7b24203 in qDeleteAll<KTextEditorFactoryList> (c=@0x8072520)
    at /usr/include/qt4/QtCore/qalgorithms.h:360
#9  0xb7b21e75 in cleanupKTextEditorFactoryList ()
    at /var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/interfaces/ktexteditor/ktexteditor.cpp:199
#10 0xb733f330 in qt_call_post_routines () at kernel/qcoreapplication.cpp:163
#11 0xb6903be7 in ~QApplication (this=0xbfc98268)
    at kernel/qapplication.cpp:932
#12 0xb79a6b5d in ~KApplication (this=0xbfc98268)
    at /var/tmp/portage/kde-base/kdelibs-9999.4/work/kdelibs-9999.4/kdeui/kernel/kapplication.cpp:946
#13 0xb7f96d14 in kdemain (argc=2, argv=0xbfc98634)
    at /var/tmp/portage/kde-base/kdebase-9999.4/work/kdebase-9999.4/apps/kwrite/kwritemain.cpp:786
#14 0x080487c2 in main (argc=135383376, argv=0x0)
    at /var/tmp/portage/kde-base/kdebase-9999.4/work/kdebase_build/apps/kwrite/kwrite_dummy.cpp:3
#15 0xb659cfdc in __libc_start_main (main=0x80487a0 <main>, argc=2, 
    ubp_av=0xbfc98634, init=0x80487f0 <__libc_csu_init>, 
    fini=0x80487e0 <__libc_csu_fini>, rtld_fini=0xb7fad100 <_dl_fini>, 
    stack_end=0xbfc9862c) at libc-start.c:229
#16 0x08048711 in _start ()
#0  0xffffe410 in __kernel_vsyscall ()
Comment 3 Oliver Putz 2008-04-08 02:02:02 UTC
*** Bug 160326 has been marked as a duplicate of this bug. ***
Comment 4 Urs Wolfer 2008-04-11 21:56:58 UTC
*** Bug 160657 has been marked as a duplicate of this bug. ***
Comment 5 Urs Wolfer 2008-04-11 21:58:04 UTC
See my comment in #160657 for a way to reproduce it.
Comment 6 Jarosław Staniek 2008-04-12 10:55:05 UTC
SVN commit 795996 by staniek:

KTextEditorFactoryList: make qAddPostRoutine play well with K_GLOBAL_STATIC.

(like in KProtocolManagerPrivate)

I've encountered a crash related to double deletion of the list's memory, on app's exit. 
The code is now cleaner too. 

Example: KWrite uses KTextEditor::EditorChooser::editor(), what in turn calls KTextEditor::editor("katepart") for each new editor window, always with the same part name.

Solution: Use QSet (KTextEditorFactorySet) instead of QList to avoid multiple deletion of the same factory object.

BUG:160183



 M  +13 -13    ktexteditor.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=795996