Bug 220153 - [steps] Kate crashes when reloading two documents at the same time after a change [QListData::size, QList<KDirWatchPrivate::Client*>::count, KDirWatchPrivate::Entry::isValid]
Summary: [steps] Kate crashes when reloading two documents at the same time after a ch...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR critical (vote)
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 218665 224758 225591 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-12-26 17:10 UTC by Dario Andres
Modified: 2010-02-11 08:54 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 Dario Andres 2009-12-26 17:10:59 UTC
Application: kate (3.3.85)
KDE Platform Version: 4.3.85 (KDE 4.3.85 (KDE 4.4 Beta2)) (Compiled from sources)
Qt Version: 4.6.0
Operating System: Linux 2.6.31-ARCH i686
Distribution (Platform): Archlinux Packages

-- Information about the crash:
Here using:

Qt: 4.6.0 (kde-qt master commit 747ff8e6ef6f5a1163dfa75bc9ac4755ce7083d1
        Date:   Tue Dec 15 11:58:13 2009 +0100)
KDE Development Platform: 4.3.85 (KDE 4.3.85 (KDE 4.4 Beta2))
kdelibs svn rev. 1065942 / kdebase svn rev. 1065942
on ArchLinux i686 - Kernel 2.6.31.6

Steps to reproduce:
--

- Create two files with some content on it
  - 'echo "foobar1" > foobar1'
  - 'echo "foobar2" > foobar2'
- Open Kate
- Load this two documents at the same time
Kate opens the two documents and shows "foobar2"
- From Konsole, append new content to the "foobar2" file
  - 'echo "foobar2" >> foobar2'
Kate will notice the change and it will open the "file modified" dialog
- Do not touch that dialog yet ...
- From Konsole, append new content to the "foobar1" file
  - 'echo "foobar1" >> foobar1'
Kate will append the new changed document (foobar1) to the "file modified" dialog
- Press "Reload" into the "file modified" dialog
Kate crashes.

If you repeat this steps to much with the same file set (foobar1 and foobar2), it may stop happening (caching related?)

The crash can be reproduced everytime.

 -- Backtrace:
Application: Kate (kate), signal: Segmentation fault
[Current thread is 1 (Thread 0xb4c09700 (LWP 14119))]

Thread 2 (Thread 0xb2e0eb70 (LWP 14123)):
#0  0xb7807424 in __kernel_vsyscall ()
#1  0xb5c5fe55 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xb2fa46cb in WTF::TCMalloc_PageHeap::scavengerThread (this=0xb30e3ac0) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2304
#3  0xb2fa3e1d in WTF::TCMalloc_PageHeap::runScavengerThread (context=0xb30e3ac0) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1438
#4  0xb5c5b8ac in start_thread () from /lib/libpthread.so.0
#5  0xb5aa501e in clone () from /lib/libc.so.6

Thread 1 (Thread 0xb4c09700 (LWP 14119)):
[KCrash Handler]
#6  0xb753ab4a in QListData::size (this=0xffffffdc) at /home/kde-devel/kde/src/qt/include/QtCore/../../src/corelib/tools/qlist.h:90
#7  0xb75c2d79 in QList<KDirWatchPrivate::Client*>::count (this=0xffffffdc) at /home/kde-devel/kde/src/qt/include/QtCore/../../src/corelib/tools/qlist.h:261
#8  0xb75c2a58 in KDirWatchPrivate::Entry::isValid (this=0xffffffc0) at /home/kde-devel/kde/src/KDE/kdelibs/kio/kio/kdirwatch_p.h:157
#9  0xb75bfd79 in KDirWatchPrivate::slotRescan (this=0x84a2690) at /home/kde-devel/kde/src/KDE/kdelibs/kio/kio/kdirwatch.cpp:1359
#10 0xb75c28ce in KDirWatchPrivate::qt_metacall (this=0x84a2690, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0xbff74a08) at /home/kde-devel/kde/build/KDE/kdelibs/kio/kdirwatch_p.moc:81
#11 0xb5e289c4 in QMetaObject::metacall (object=0x84a2690, cl=QMetaObject::InvokeMetaMethod, idx=4, argv=0xbff74a08) at kernel/qmetaobject.cpp:237
#12 0xb5e3ca85 in QMetaObject::activate (sender=0x84a26d8, m=0xb5f847c4, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3294
#13 0xb5e9bbd7 in QTimer::timeout (this=0x84a26d8) at .moc/debug-shared/moc_qtimer.cpp:134
#14 0xb5e45498 in QTimer::timerEvent (this=0x84a26d8, e=0xbff74ff4) at kernel/qtimer.cpp:271
#15 0xb5e38ac6 in QObject::event (this=0x84a26d8, e=0xbff74ff4) at kernel/qobject.cpp:1224
#16 0xb63e8834 in QApplicationPrivate::notify_helper (this=0x8398940, receiver=0x84a26d8, e=0xbff74ff4) at kernel/qapplication.cpp:4242
#17 0xb63e6231 in QApplication::notify (this=0xbff753e4, receiver=0x84a26d8, e=0xbff74ff4) at kernel/qapplication.cpp:3661
#18 0xb711e538 in KApplication::notify (this=0xbff753e4, receiver=0x84a26d8, event=0xbff74ff4) at /home/kde-devel/kde/src/KDE/kdelibs/kdeui/kernel/kapplication.cpp:302
#19 0xb5e21411 in QCoreApplication::notifyInternal (this=0xbff753e4, receiver=0x84a26d8, event=0xbff74ff4) at kernel/qcoreapplication.cpp:704
#20 0xb63d8f8f in QCoreApplication::sendEvent (receiver=0x84a26d8, event=0xbff74ff4) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#21 0xb5e5bdb6 in QTimerInfoList::activateTimers (this=0x8398234) at kernel/qeventdispatcher_unix.cpp:603
#22 0xb5e57cac in timerSourceDispatch (source=0x8398200) at kernel/qeventdispatcher_glib.cpp:184
#23 0xb5e57d65 in idleTimerSourceDispatch (source=0x8398270) at kernel/qeventdispatcher_glib.cpp:231
#24 0xb50b5378 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#25 0xb50b8bf0 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#26 0xb50b8d23 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#27 0xb5e58e48 in QEventDispatcherGlib::processEvents (this=0x8361630, flags=...) at kernel/qeventdispatcher_glib.cpp:407
#28 0xb64bcd50 in QGuiEventDispatcherGlib::processEvents (this=0x8361630, flags=...) at kernel/qguieventdispatcher_glib.cpp:202
#29 0xb5e1e81b in QEventLoop::processEvents (this=0xbff752ec, flags=...) at kernel/qeventloop.cpp:149
#30 0xb5e1e960 in QEventLoop::exec (this=0xbff752ec, flags=...) at kernel/qeventloop.cpp:201
#31 0xb5e21aed in QCoreApplication::exec () at kernel/qcoreapplication.cpp:981
#32 0xb63e5e54 in QApplication::exec () at kernel/qapplication.cpp:3570
#33 0xb7801ab5 in kdemain (argc=1, argv=0xbff75a84) at /home/kde-devel/kde/src/KDE/kdesdk/kate/app/katemain.cpp:377
#34 0x080486eb in main (argc=1, argv=0xbff75a84) at /home/kde-devel/kde/build/KDE/kdesdk/kate/app/kate_dummy.cpp:3

Reported using DrKonqi
Comment 1 Dario Andres 2010-01-29 17:51:45 UTC
*** Bug 218665 has been marked as a duplicate of this bug. ***
Comment 2 Dario Andres 2010-01-29 17:52:43 UTC
Bug 224758 has another steps-set
Comment 3 Dario Andres 2010-01-29 17:52:48 UTC
*** Bug 224758 has been marked as a duplicate of this bug. ***
Comment 4 Dario Andres 2010-02-05 14:41:02 UTC
*** Bug 225591 has been marked as a duplicate of this bug. ***
Comment 5 Dario Andres 2010-02-10 14:23:26 UTC
Other steps to reproduce:

- Create a dummy file "test"
- Open Kate
- Open the "test" file
- Delete the file externally
- On Kate prompt select "Overwrite" -> Crash
or
- On Kate prompt select "Reload.", accept the error message about the file not being found and select "Overwrite" again -> Crash
Comment 6 Milian Wolff 2010-02-10 14:42:13 UTC
could confirm, will have to try to fix it later today
Comment 7 David Faure 2010-02-11 08:54:35 UTC
SVN commit 1088537 by dfaure:

Fix crash in KDirWatch when using a messagebox in a slot connected to dirty(),
and in that nested event loop, doing things like getting another notification
and removing/adding watches.
Fixed for: 4.4.1
BUG: 220153


 M  +5 -2      kio/kdirwatch.cpp  
 M  +90 -9     tests/kdirwatch_unittest.cpp  


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