Bug 1519 - Sometimes dolphin is crashed when /usr/bin is openning
: Sometimes dolphin is crashed when /usr/bin is openning
Status: RESOLVED FIXED
Product: Desktop Bugs
Classification: ROSA Desktop
Component: Main Packages
: Fresh
: All Linux
: Normal normal
: ---
Assigned To: ROSA Linux Bugs
: ROSA Linux Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-28 13:23 MSK by FirstLevel
Modified: 2013-02-05 10:31 MSK (History)
2 users (show)

See Also:
RPM Package: dolphin-4.9.5-1-rosa2012.1.i586
ISO-related:
Bad POT generating:
Upstream:


Attachments
gdb_1.log.txt (1.88 KB, text/plain)
2013-01-29 10:54 MSK, FirstLevel
Details
gdb_2.log.txt (2.26 KB, text/plain)
2013-01-29 10:54 MSK, FirstLevel
Details
gdb_bt.log.txt (9.25 KB, text/plain)
2013-01-29 17:16 MSK, FirstLevel
Details
gdb_thread_apply_all_bt.log.txt (11.35 KB, text/plain)
2013-01-29 17:16 MSK, FirstLevel
Details
Dolphin - error.png (165.80 KB, image/png)
2013-01-31 09:12 MSK, FirstLevel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FirstLevel 2013-01-28 13:23:07 MSK
Description of problem:
I have installed ROSA 2012.1 fresh and discovered that dolphin is crashed sometimes when I was in /usr/bin directory as ussual user.
I open konsole, launch dolphin, traverse to /usr/bin/ and scroll this directory, dolphin is crashed with error
"QThread: Destroyed while thread is still running
Ошибка сегментирования (слепок снят)"
See my video recording http://cdn.2safe.com/202800033047/Dolphin_Crashed.mp4


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
Comment 1 FirstLevel 2013-01-28 13:49:07 MSK
Sometimes dolphin is crashed on /usr/lib.
It does not depends on desktop effects.
Comment 2 Eugene Shatokhin 2013-01-28 16:27:50 MSK
Unfortunately, the problem has not shown up on my machines so far.

If you could obtain a backtrace of the crash, it could be easier to locate and fix the bug.

To do so, one can do the following:

1. Install gdb and kdebase4-debuginfo packages if they are not already installed. It should make no harm to install other kdebase4*-debuginfo packages as well.

2. Start Dolphin under GDB from the console:
$ gdb dolphin

3. Setup logging of GDB output to gdb.log and allow Dolphin to run:
(gdb) set logging file gdb.log
(gdb) set logging on
(gdb) r

4. Do the same things with Dolphin as before: traverse to /usr/bin/, scroll, etc., until Dolphin crashes.

5. After it has crashed, ask GDB to show the backtraces for all threads:
(gdb) thread apply all bt

6. Attach gdb.log here.
Comment 3 FirstLevel 2013-01-29 10:54:23 MSK
(In reply to comment #2)
> Unfortunately, the problem has not shown up on my machines so far.
> 
> If you could obtain a backtrace of the crash, it could be easier to locate
> and fix the bug.
> 
> To do so, one can do the following:
> 
> 1. Install gdb and kdebase4-debuginfo packages if they are not already
> installed. It should make no harm to install other kdebase4*-debuginfo
> packages as well.
> 
> 2. Start Dolphin under GDB from the console:
> $ gdb dolphin
> 
> 3. Setup logging of GDB output to gdb.log and allow Dolphin to run:
> (gdb) set logging file gdb.log
> (gdb) set logging on
> (gdb) r
> 
> 4. Do the same things with Dolphin as before: traverse to /usr/bin/, scroll,
> etc., until Dolphin crashes.
> 
> 5. After it has crashed, ask GDB to show the backtraces for all threads:
> (gdb) thread apply all bt
> 
> 6. Attach gdb.log here.


1.2.3. I can open dolphin, but after openning /usr/lib Dolphin is frozen (works only minimize, maximize button on the window). If I minimize and restore window it will be "white box". Two attempts gdb.logs are attached.

5. I have got:
(gdb) thread apply all bt
Cannot find new threads: generic error
Quitting: Couldn't get registers: Нет такого процесса.
Comment 4 FirstLevel 2013-01-29 10:54:35 MSK
Created attachment 1091 [details]
gdb_1.log.txt
Comment 5 FirstLevel 2013-01-29 10:54:50 MSK
Created attachment 1092 [details]
gdb_2.log.txt
Comment 6 Eugene Shatokhin 2013-01-29 12:39:07 MSK
Thank you for the logs. At least, they sho that Dolphin did crash with SIGSEGV in both situations, athough in different places. Some kind of race condition perhaps.

The Dolphin's window is frozen rather than closed immediately after SIGSEGV because GDB is active, perhaps.

1. As far as I can see, it is a 32-bit system, right?

2. Just in case, did you modify any Dolphin's settings after the system was installed?

3. Could you additionally install kdelibs4-debuginfo and qt4-debuginfo and then launch Dolphin under GDB again and repeat all those steps? But this time, use 'bt' rather than 'thread apply all bt' when it crashes.

Meanwhile, I'll try to apply race detectors to Dolphin, although they seemed to be not very Qt-friendly some time ago...
Comment 7 Eugene Shatokhin 2013-01-29 16:53:40 MSK
Interesting, the problem finally was finally reproduced on my machine when I launched Dolphin under Helgrind data race detector.

The backtrace of the crashed thread itself is as follows:
-----------------
Process terminating with default action of signal 11 (SIGSEGV)
 Access not within mapped region at address 0x6C0000002F
   at 0x5EBC780: UpdateFileStatesThread::run() (qbasicatomic.h:75)
   by 0x837A56B: QThreadPrivate::start(void*) (in /usr/lib64/libQtCore.so.4.8.4)
   by 0x4C2C1BC: ??? (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
   by 0xA82ED5C: start_thread (in /lib64/libpthread-2.15.so)
   by 0x51C562C: clone (in /lib64/libc-2.15.so)
-----------------

However, Helgrind detected potential data races involving that thread and UpdateFileStatesThread instance in particular. 

I'll dig into this further, let's see if these races have caused the crash.
Comment 8 FirstLevel 2013-01-29 17:15:48 MSK
(In reply to comment #6)
> Thank you for the logs. At least, they sho that Dolphin did crash with
> SIGSEGV in both situations, athough in different places. Some kind of race
> condition perhaps.
> 
> The Dolphin's window is frozen rather than closed immediately after SIGSEGV
> because GDB is active, perhaps.
> 
> 1. As far as I can see, it is a 32-bit system, right?
> 
> 2. Just in case, did you modify any Dolphin's settings after the system was
> installed?
> 
> 3. Could you additionally install kdelibs4-debuginfo and qt4-debuginfo and
> then launch Dolphin under GDB again and repeat all those steps? But this
> time, use 'bt' rather than 'thread apply all bt' when it crashes.
> 
> Meanwhile, I'll try to apply race detectors to Dolphin, although they seemed
> to be not very Qt-friendly some time ago...

1. Yes.
2. Only add pair of scripts for menu extensions
3. I have attached two logs.
With command: thread apply all bt  - file gdb_thread_apply_all_bt.log.txt
With command: bt - file gdb_bt.log.txt
Comment 9 FirstLevel 2013-01-29 17:16:00 MSK
Created attachment 1096 [details]
gdb_bt.log.txt
Comment 10 FirstLevel 2013-01-29 17:16:12 MSK
Created attachment 1097 [details]
gdb_thread_apply_all_bt.log.txt
Comment 11 Eugene Shatokhin 2013-01-30 16:19:46 MSK
Thanks, the last logs are very useful, especially the output of "thread apply all bt". It confirms that there is indeed a race between the destruction of UpdateFileStatesThread instance and the thread that accesses the data from that instance.

I have applied a patch that should fix the problem. Could you test it?

1. Add my repository and perform update from it:

i586:
http://abf.rosalinux.ru/downloads/spectre_personal/repository/rosa2012.1/i586/main/release/

x86_64:
http://abf.rosalinux.ru/downloads/spectre_personal/repository/rosa2012.1/x86_64/main/release/

2. Please reboot after the update. 

3. Check if Dolphin still crashes.
Comment 12 FirstLevel 2013-01-31 09:12:28 MSK
(In reply to comment #11)
> Thanks, the last logs are very useful, especially the output of "thread
> apply all bt". It confirms that there is indeed a race between the
> destruction of UpdateFileStatesThread instance and the thread that accesses
> the data from that instance.
> 
> I have applied a patch that should fix the problem. Could you test it?
> 
> 1. Add my repository and perform update from it:
> 
> i586:
> http://abf.rosalinux.ru/downloads/spectre_personal/repository/rosa2012.1/
> i586/main/release/
> 
> x86_64:
> http://abf.rosalinux.ru/downloads/spectre_personal/repository/rosa2012.1/
> x86_64/main/release/
> 
> 2. Please reboot after the update. 
> 
> 3. Check if Dolphin still crashes.

Ok. After all descried actions Dolphin is not crashed but has other error. See attach Dolphin - error.png
Comment 13 FirstLevel 2013-01-31 09:12:41 MSK
Created attachment 1114 [details]
Dolphin - error.png
Comment 14 Eugene Shatokhin 2013-01-31 17:52:03 MSK
It seems, thread objects were not always reused safely in IconOverlay plugin and that caused the mentioned "Update ... failed" error message among other things.

I have reworked the code to fix that.

Please update again from my repositories mentioned earlier, reboot and check if there are problems this time.
Comment 15 FirstLevel 2013-02-01 09:23:59 MSK
(In reply to comment #14)
> It seems, thread objects were not always reused safely in IconOverlay plugin
> and that caused the mentioned "Update ... failed" error message among other
> things.
> 
> I have reworked the code to fix that.
> 
> Please update again from my repositories mentioned earlier, reboot and check
> if there are problems this time.

After last update user has no any errors with dolphin.
Comment 16 Eugene Shatokhin 2013-02-04 16:46:10 MSK
The updated packages should now be available in our official repositories at ABF. Soon they will be available on the mirrors as well (if they are not already there).
Comment 17 FirstLevel 2013-02-04 20:40:02 MSK
(In reply to comment #16)
> The updated packages should now be available in our official repositories at
> ABF. Soon they will be available on the mirrors as well (if they are not
> already there).

Strange status...
Maybe Resolved - Fixed ?
Comment 18 Eugene Shatokhin 2013-02-05 10:31:40 MSK
Agreed.