Bug 311092

Summary: Dolphin crashed.
Product: [Applications] dolphin Reporter: qub.box
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: cfeck, hugo.pereira.da.costa
Priority: NOR    
Version: 2.1   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 4.9.5
Attachments: tentative patch

Description qub.box 2012-12-03 16:11:10 UTC
Application: dolphin (2.1)
KDE Platform Version: 4.9.3
Qt Version: 4.8.3
Operating System: Linux 3.6.8-2.fc17.x86_64 x86_64
Distribution (Platform): Fedora RPMs

-- Information about the crash:
- What I was doing when the application crashed:

Dolphin crashed when i pressed close button. I first closed the Geany IDE where was open two files that were explored in Dolphin file manager and in a second i closed the Dolphin, then it crashed.

The crash does not seem to be reproducible.

-- Backtrace:
Application: Dolphin (dolphin), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
82	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
[Current thread is 1 (Thread 0x7f83e7a93880 (LWP 3607))]

Thread 2 (Thread 0x7f83db97f700 (LWP 3610)):
#0  0x00007fffdccf6827 in clock_gettime ()
#1  0x0000003ea2c0410d in __GI_clock_gettime (clock_id=<optimized out>, tp=<optimized out>) at ../sysdeps/unix/clock_gettime.c:116
#2  0x0000003ea9cd16f4 in do_gettime (frac=0x7f83db97ea38, sec=0x7f83db97ea30) at tools/qelapsedtimer_unix.cpp:123
#3  qt_gettime () at tools/qelapsedtimer_unix.cpp:140
#4  0x0000003ea9da67fd in QTimerInfoList::updateCurrentTime (this=this@entry=0x7f83d4002860) at kernel/qeventdispatcher_unix.cpp:343
#5  0x0000003ea9da6b43 in QTimerInfoList::timerWait (this=0x7f83d4002860, tm=...) at kernel/qeventdispatcher_unix.cpp:450
#6  0x0000003ea9da56ac in timerSourcePrepareHelper (src=<optimized out>, timeout=0x7f83db97eb2c) at kernel/qeventdispatcher_glib.cpp:136
#7  0x0000003ea9da5755 in timerSourcePrepare (source=source@entry=0x7f83d4002800, timeout=timeout@entry=0x7f83db97eb2c) at kernel/qeventdispatcher_glib.cpp:169
#8  0x0000003ea344732f in g_main_context_prepare (context=context@entry=0x7f83d40009a0, priority=priority@entry=0x7f83db97eb78) at gmain.c:2836
#9  0x0000003ea3447a1b in g_main_context_iterate (context=context@entry=0x7f83d40009a0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3126
#10 0x0000003ea3447c14 in g_main_context_iteration (context=0x7f83d40009a0, may_block=1) at gmain.c:3207
#11 0x0000003ea9da5ff6 in QEventDispatcherGlib::processEvents (this=0x7f83d40008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#12 0x0000003ea9d76cbf in QEventLoop::processEvents (this=this@entry=0x7f83db97ecd0, flags=...) at kernel/qeventloop.cpp:149
#13 0x0000003ea9d76f48 in QEventLoop::exec (this=0x7f83db97ecd0, flags=...) at kernel/qeventloop.cpp:204
#14 0x0000003ea9c787e0 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#15 0x0000003ea9d574df in QInotifyFileSystemWatcherEngine::run (this=0x18e39a0) at io/qfilesystemwatcher_inotify.cpp:248
#16 0x0000003ea9c7b7bc in QThreadPrivate::start (arg=0x18e39a0) at thread/qthread_unix.cpp:338
#17 0x0000003ea2407d14 in start_thread (arg=0x7f83db97f700) at pthread_create.c:309
#18 0x0000003ea1cf168d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 1 (Thread 0x7f83e7a93880 (LWP 3607)):
[KCrash Handler]
#6  deref (this=0x1021a59c0) at ../../src/corelib/arch/qatomic_x86_64.h:133
#7  QImage::~QImage (this=0x1c72a90, __in_chrg=<optimized out>) at image/qimage.cpp:1282
#8  0x0000003fd0ca7e38 in QRasterPixmapData::~QRasterPixmapData (this=0x1c72a60, __in_chrg=<optimized out>) at image/qpixmap_raster.cpp:93
#9  0x0000003fd0ca7e79 in QRasterPixmapData::~QRasterPixmapData (this=0x1c72a60, __in_chrg=<optimized out>) at image/qpixmap_raster.cpp:95
#10 0x0000003fd0c98992 in ~QExplicitlySharedDataPointer (this=0x2147650, __in_chrg=<optimized out>) at ../../src/corelib/tools/qshareddata.h:166
#11 QPixmap::~QPixmap (this=0x2147640, __in_chrg=<optimized out>) at image/qpixmap.cpp:347
#12 0x00007f83df65e3d4 in QVector<QPixmap>::free (x=0x21475d0, this=<optimized out>) at /usr/include/QtCore/qvector.h:466
#13 0x00007f83df65f17e in ~QVector (this=0x1a8c2c8, __in_chrg=<optimized out>) at /usr/include/QtCore/qvector.h:124
#14 ~TileSet (this=0x1a8c2c0, __in_chrg=<optimized out>) at /usr/src/debug/kde-workspace-4.9.3/libs/oxygen/oxygentileset.h:77
#15 Oxygen::TileSet::~TileSet (this=0x1a8c2c0, __in_chrg=<optimized out>) at /usr/src/debug/kde-workspace-4.9.3/libs/oxygen/oxygentileset.h:77
#16 0x00007f83df694a97 in clear (this=<optimized out>) at /usr/include/QtCore/qcache.h:139
#17 ~QCache (this=0x17920a0, __in_chrg=<optimized out>) at /usr/include/QtCore/qcache.h:103
#18 ~BaseCache (this=0x17920a0, __in_chrg=<optimized out>) at /usr/src/debug/kde-workspace-4.9.3/libs/oxygen/oxygenhelper.h:63
#19 Oxygen::StyleHelper::~StyleHelper (this=0x1791c50, __in_chrg=<optimized out>) at /usr/src/debug/kde-workspace-4.9.3/kstyles/oxygen/oxygenstylehelper.h:59
#20 0x00007f83df695409 in Oxygen::StyleHelper::~StyleHelper (this=0x1791c50, __in_chrg=<optimized out>) at /usr/src/debug/kde-workspace-4.9.3/kstyles/oxygen/oxygenstylehelper.h:59
#21 0x00007f83df664ddd in Oxygen::Style::~Style (this=0x178bca0, __in_chrg=<optimized out>) at /usr/src/debug/kde-workspace-4.9.3/kstyles/oxygen/oxygenstyle.cpp:199
#22 0x00007f83df664e29 in Oxygen::Style::~Style (this=0x178bca0, __in_chrg=<optimized out>) at /usr/src/debug/kde-workspace-4.9.3/kstyles/oxygen/oxygenstyle.cpp:199
#23 0x0000003fd0bd35d1 in QApplication::~QApplication (this=0x7fffdcc4f980, __in_chrg=<optimized out>) at kernel/qapplication.cpp:1170
#24 0x00007f83ea37ab14 in kdemain () from /lib64/libkdeinit4_dolphin.so
#25 0x0000003ea1c21735 in __libc_start_main (main=0x400810, argc=6, ubp_av=0x7fffdcc4fab8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffdcc4faa8) at libc-start.c:226
#26 0x0000000000400841 in _start ()

Possible duplicates by query: bug 285483.

Reported using DrKonqi
Comment 1 Frank Reininghaus 2012-12-03 16:40:36 UTC
Thanks for the bug report. Looks like it might be related to Oxygen?
Comment 2 Hugo Pereira Da Costa 2012-12-03 16:54:04 UTC
It's actually in Qt, related to the use of the raster graphics-system. If the crash can be reproduced and happens too often try run in "native" mode: 
  dolphin -graphicssystem native;
Should fix. Nothing that we (oxyen) can do about it.
Comment 3 Hugo Pereira Da Costa 2012-12-03 17:00:05 UTC
@Frank
... however, there 'might' be something to be done in dolphin. It can well happen that the crash is due to some mess up in the (automatic) de-allocation chain, when exciting dolphin. If QApp (and then QStyle, and then the oxygen stuff) is deleted too late, it might be that some pointers are left dangling, because already being deleted elsewhere by Qt. 

Now, oxygen does not explicitely deletes anything but relies on QCache and other things to do so, so we have no control on this.

But (here comes the question: is the Dolphin application deleted explicitely in the ::main() routine, or just left to automatic deletion at exit() stage ? If the latter is true: can one try to explicitely delete the qApp ? (no rush, and I can try that myself, in fact, to see if it breaks anything).

Cheers, 

Hugo
Comment 4 Hugo Pereira Da Costa 2012-12-03 18:42:19 UTC
Created attachment 75611 [details]
tentative patch

@Frank again
This is typically the kind of patch I'm thinking of, which enforce deletion of DolphinApplication before hitting "return". I think it cannot make any harm, and I think I vaguely remember it fixed similar issues I had with own applications in the past. 
Now, since the bug cannot be reproduced easily, I'm not sure what to make about such a patch.
Your call.
Comment 5 Frank Reininghaus 2012-12-03 19:47:08 UTC
Many thanks for the quick reply and the good investigation, Hugo! Your analysis looks reasonable, and it looks harmless enough, so I'd say please commit :-)

Can go into the 4.9 branch from my point of view (except for the version change, obviously), even though it's not clear yet if another release from that branch is made. No cherry-picking to master needed, we do merge regularly in kde-baseapps.
Comment 6 Hugo Pereira Da Costa 2012-12-03 19:56:01 UTC
I'll test for a day or two (I use dolphin enough for this to be relevant) to make sure no crash is introduced "the other way around", and will push (say by Wednesday evening).
Cheers,

Hugo
Comment 7 Frank Reininghaus 2012-12-04 06:53:44 UTC
Sounds good, great! I've also applied the patch here, I'll shout if it causes any unexpected problems.
Comment 8 Hugo Pereira Da Costa 2012-12-05 20:45:44 UTC
Git commit 5343a18b50e990d75f4434b3bb70b376ab935076 by Hugo Pereira Da Costa.
Committed on 05/12/2012 at 21:44.
Pushed by hpereiradacosta into branch 'KDE/4.9'.

Added curly brackets around DolphinApplication creation and execution, to make sure it is deleted before "return 0;" is
called. This might prevent random crashes due to the de-allocation chain in Qt at exit.

M  +6    -4    dolphin/src/main.cpp

http://commits.kde.org/kde-baseapps/5343a18b50e990d75f4434b3bb70b376ab935076
Comment 9 Christoph Feck 2012-12-09 16:16:50 UTC
Closing after previous commit, which is believed to fix this bug.