Bug 332767 - dolphin crash during moving/copying several files
Summary: dolphin crash during moving/copying several files
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 4.12.95
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2014-03-29 02:46 UTC by Simon Andric
Modified: 2014-04-03 07:08 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.13.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Andric 2014-03-29 02:46:36 UTC
Application: dolphin (4.12.95)
KDE Platform Version: 4.12.95
Qt Version: 4.8.6
Operating System: Linux 3.13.0-19-generic x86_64
Distribution: Ubuntu Trusty Tahr (development branch)

-- Information about the crash:
- What I was doing when the application crashed:
dolphin crash during moving/copying several files - from hard disk to two different external drives and back - i copied 4 different packs of files to different locations and after some time dr. konqi appeared out of the blue...

nice day!

Simon

The crash can be reproduced every time.

-- Backtrace:
Application: Dolphin (dolphin), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7ffc6d2fe7c0 (LWP 3149))]

Thread 4 (Thread 0x7ffc41e3b700 (LWP 3150)):
#0  0x00007ffc63d538b9 in g_main_context_query () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007ffc63d53f52 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffc63d540ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffc68c417be in QEventDispatcherGlib::processEvents (this=0x7ffc3c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:436
#4  0x00007ffc68c130af in QEventLoop::processEvents (this=this@entry=0x7ffc41e3ade0, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007ffc68c133a5 in QEventLoop::exec (this=this@entry=0x7ffc41e3ade0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007ffc68b0fc5f in QThread::exec (this=this@entry=0xb58800) at thread/qthread.cpp:537
#7  0x00007ffc68bf4823 in QInotifyFileSystemWatcherEngine::run (this=0xb58800) at io/qfilesystemwatcher_inotify.cpp:265
#8  0x00007ffc68b1232f in QThreadPrivate::start (arg=0xb58800) at thread/qthread_unix.cpp:349
#9  0x00007ffc64233182 in start_thread (arg=0x7ffc41e3b700) at pthread_create.c:312
#10 0x00007ffc6cbdf30d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 3 (Thread 0x7ffc414cd700 (LWP 3151)):
[KCrash Handler]
#6  0x00007ffc68c28607 in isSignalConnected (signal_index=2, this=0x0) at kernel/qobject_p.h:237
#7  QMetaObject::activate (sender=sender@entry=0x182baf0, m=m@entry=0x7ffc6c16b9c0 <KDirectoryContentsCounterWorker::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffc414cc7d0) at kernel/qobject.cpp:3444
#8  0x00007ffc6bedb0a3 in KDirectoryContentsCounterWorker::result (this=this@entry=0x182baf0, _t1=..., _t2=6530) at moc_kdirectorycontentscounterworker.cpp:105
#9  0x00007ffc6bf1a899 in KDirectoryContentsCounterWorker::countDirectoryContents (this=0x182baf0, path=..., options=...) at ../../../dolphin/src/kitemviews/private/kdirectorycontentscounterworker.cpp:94
#10 0x00007ffc6bedb0d6 in KDirectoryContentsCounterWorker::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at moc_kdirectorycontentscounterworker.cpp:56
#11 0x00007ffc68c2cc1e in QObject::event (this=0x182baf0, e=<optimized out>) at kernel/qobject.cpp:1194
#12 0x00007ffc69606e2c in QApplicationPrivate::notify_helper (this=this@entry=0x8fe630, receiver=receiver@entry=0x182baf0, e=e@entry=0x901040) at kernel/qapplication.cpp:4567
#13 0x00007ffc6960d4a0 in QApplication::notify (this=this@entry=0x7fff51039780, receiver=receiver@entry=0x182baf0, e=e@entry=0x901040) at kernel/qapplication.cpp:4353
#14 0x00007ffc6a311baa in KApplication::notify (this=0x7fff51039780, receiver=0x182baf0, event=0x901040) at ../../kdeui/kernel/kapplication.cpp:311
#15 0x00007ffc68c144dd in QCoreApplication::notifyInternal (this=0x7fff51039780, receiver=receiver@entry=0x182baf0, event=event@entry=0x901040) at kernel/qcoreapplication.cpp:953
#16 0x00007ffc68c17b3d in sendEvent (event=0x901040, receiver=0x182baf0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#17 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0xd7ec00) at kernel/qcoreapplication.cpp:1577
#18 0x00007ffc68c17fe3 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1470
#19 0x00007ffc68c41f83 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#20 postEventSourceDispatch (s=0x7ffc34001350) at kernel/qeventdispatcher_glib.cpp:287
#21 0x00007ffc63d53e04 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007ffc63d54048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007ffc63d540ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007ffc68c417a1 in QEventDispatcherGlib::processEvents (this=0x7ffc340008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:434
#25 0x00007ffc68c130af in QEventLoop::processEvents (this=this@entry=0x7ffc414cce20, flags=...) at kernel/qeventloop.cpp:149
#26 0x00007ffc68c133a5 in QEventLoop::exec (this=this@entry=0x7ffc414cce20, flags=...) at kernel/qeventloop.cpp:204
#27 0x00007ffc68b0fc5f in QThread::exec (this=<optimized out>) at thread/qthread.cpp:537
#28 0x00007ffc68b1232f in QThreadPrivate::start (arg=0xd401b0) at thread/qthread_unix.cpp:349
#29 0x00007ffc64233182 in start_thread (arg=0x7ffc414cd700) at pthread_create.c:312
#30 0x00007ffc6cbdf30d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 2 (Thread 0x7ffc3bfff700 (LWP 3152)):
#0  0x00007ffc6cbd1fbd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ffc63d53fe4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffc63d540ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffc68c417be in QEventDispatcherGlib::processEvents (this=0x7ffc300008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:436
#4  0x00007ffc68c130af in QEventLoop::processEvents (this=this@entry=0x7ffc3bffede0, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007ffc68c133a5 in QEventLoop::exec (this=this@entry=0x7ffc3bffede0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007ffc68b0fc5f in QThread::exec (this=this@entry=0xc5cab0) at thread/qthread.cpp:537
#7  0x00007ffc68bf4823 in QInotifyFileSystemWatcherEngine::run (this=0xc5cab0) at io/qfilesystemwatcher_inotify.cpp:265
#8  0x00007ffc68b1232f in QThreadPrivate::start (arg=0xc5cab0) at thread/qthread_unix.cpp:349
#9  0x00007ffc64233182 in start_thread (arg=0x7ffc3bfff700) at pthread_create.c:312
#10 0x00007ffc6cbdf30d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7ffc6d2fe7c0 (LWP 3149)):
#0  0x00007ffc6cbd06bd in read () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ffc63d94c20 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffc63d53b14 in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffc63d53f7b in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffc63d540ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffc68c417be in QEventDispatcherGlib::processEvents (this=0x8cea00, flags=...) at kernel/qeventdispatcher_glib.cpp:436
#6  0x00007ffc696a8bb6 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#7  0x00007ffc68c130af in QEventLoop::processEvents (this=this@entry=0x7fff51039650, flags=...) at kernel/qeventloop.cpp:149
#8  0x00007ffc68c133a5 in QEventLoop::exec (this=this@entry=0x7fff51039650, flags=...) at kernel/qeventloop.cpp:204
#9  0x00007ffc68c18b79 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1225
#10 0x00007ffc6960537c in QApplication::exec () at kernel/qapplication.cpp:3828
#11 0x00007ffc6cefa1d7 in kdemain (argc=5, argv=0x7fff510398b8) at ../../../dolphin/src/main.cpp:93
#12 0x00007ffc6cb05ec5 in __libc_start_main (main=0x4006d0 <main(int, char**)>, argc=5, argv=0x7fff510398b8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff510398a8) at libc-start.c:287
#13 0x00000000004006fe in _start ()

Reported using DrKonqi
Comment 1 Frank Reininghaus 2014-03-30 16:18:18 UTC
Thanks for the bug report. Looks like it crashes in a secondary thread that is counting the items inside subfolders (either for the "Size" column in Details View or to determine if a subfolder can be expanded in Details View or in the Folders Panel).

> [KCrash Handler]
> #6  0x00007ffc68c28607 in isSignalConnected (signal_index=2, this=0x0) at
> kernel/qobject_p.h:237
> #7  QMetaObject::activate (sender=sender@entry=0x182baf0,
> m=m@entry=0x7ffc6c16b9c0
> <KDirectoryContentsCounterWorker::staticMetaObject>,
> local_signal_index=local_signal_index@entry=0,
> argv=argv@entry=0x7ffc414cc7d0) at kernel/qobject.cpp:3444
> #8  0x00007ffc6bedb0a3 in KDirectoryContentsCounterWorker::result
> (this=this@entry=0x182baf0, _t1=..., _t2=6530) at
> moc_kdirectorycontentscounterworker.cpp:105
> #9  0x00007ffc6bf1a899 in
> KDirectoryContentsCounterWorker::countDirectoryContents (this=0x182baf0,
> path=..., options=...) at
> ../../../dolphin/src/kitemviews/private/kdirectorycontentscounterworker.cpp:
> 94

Hm, strange. Maybe the KDirectoryContentsCounterWorker was deleted while its countDirectoryContents() method was being executed? I thought that I had added some code that protects against this kind of thing, but I'll try to have a closer look soon.
Comment 2 Frank Reininghaus 2014-03-30 16:43:39 UTC
Ouch. In KDirectoryContentsCounter::~KDirectoryContentsCounter(), we just call

delete m_worker;

which could delete the "worker" while it is still running. Only if the worker is the only one remaining the the thread which is shared by the workers for all views, we wait until the thread has finished.

Replacing the above line by

m_worker->deleteLater();

should ensure that the worker object is not deleted while it is still working.
Comment 3 Frank Reininghaus 2014-04-03 07:08:03 UTC
Git commit 80b7aada681ec24d849f8860405a251ec2771380 by Frank Reininghaus.
Committed on 03/04/2014 at 07:03.
Pushed by freininghaus into branch 'KDE/4.13'.

KDirectoryContentsCounter: do not delete currently active worker objects

Before this patch, the destructor of KDirectoryContentsCounter might
delete the worker object, which lives in another thread, while one of
its methods was still being executed. This could cause a crash. Only if
the destroyed KDirectoryContentsCounter was the last one, the worker
thread was stopped, and the destructor waited until all workers are
done.
FIXED-IN: 4.13.0
REVIEW: 117209

M  +12   -3    dolphin/src/kitemviews/private/kdirectorycontentscounter.cpp

http://commits.kde.org/kde-baseapps/80b7aada681ec24d849f8860405a251ec2771380