Bug 188263

Summary: crash after tinkering with star rating widget in thumbbar
Product: [Applications] digikam Reporter: gerlos <gerlosgm>
Component: Thumbs-BarViewAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: caulier.gilles, ep, gerlosgm, JuergenDiel, kde, marc
Priority: NOR    
Version: 0.10.0   
Target Milestone: ---   
Platform: Mandriva RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 1.5.0
Sentry Crash Report:

Description gerlos 2009-03-27 16:33:02 UTC
Version:           0.10.0 (using KDE 4.2.1)
Compiler:          gcc 4.3.2 
OS:                Linux
Installed from:    Mandriva RPMs

digiKam crashes when I open an image in the editor and edit stars to images in the thumbnail strip (if they don't have any star) or when I remove all the stars from an image with one or more stars using the mouse. 
Crashes seem to happen immediately when removing all the stars, and after some tinkering when editing them.

I don't see any crash if I use the keyboard shortcuts or if I use the right sidebar to do the same operations, neither if I edit the stars in the album view.

Here's a backtrace:

Applicazione: digiKam (digikam), segnale SIGSEGV
[Current thread is 1 (Thread 0xb78e56d0 (LWP 10933))]

Thread 8 (Thread 0xb6103b90 (LWP 10940)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0x47f4fb95 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/i686/libpthread.so.0
#2  0x4229ff1b in QWaitCondition::wait () from /usr/lib/libQtCore.so.4
#3  0x082dc1b1 in Digikam::ScanController::run (this=0xa254cd8) at /home/gerlos/Download/digikam/digikam-0.10.0/digikam/scancontroller.cpp:412
#4  0x4229ee0f in ?? () from /usr/lib/libQtCore.so.4
#5  0x47f4c315 in start_thread () from /lib/i686/libpthread.so.0
#6  0x47ea0d4e in clone () from /lib/i686/libc.so.6

Thread 7 (Thread 0xb53ffb90 (LWP 11013)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0x47f4fb95 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/i686/libpthread.so.0
#2  0x4229ff1b in QWaitCondition::wait () from /usr/lib/libQtCore.so.4
#3  0xb7d3cefd in Digikam::LoadSaveThread::run (this=0xa57a968) at /home/gerlos/Download/digikam/digikam-0.10.0/libs/threadimageio/loadsavethread.cpp:131
#4  0x4229ee0f in ?? () from /usr/lib/libQtCore.so.4
#5  0x47f4c315 in start_thread () from /lib/i686/libpthread.so.0
#6  0x47ea0d4e in clone () from /lib/i686/libc.so.6

Thread 6 (Thread 0xb4bfeb90 (LWP 11014)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0x47f4fb95 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/i686/libpthread.so.0
#2  0x4229ff1b in QWaitCondition::wait () from /usr/lib/libQtCore.so.4
#3  0xb7d3cefd in Digikam::LoadSaveThread::run (this=0xa4a9f20) at /home/gerlos/Download/digikam/digikam-0.10.0/libs/threadimageio/loadsavethread.cpp:131
#4  0x4229ee0f in ?? () from /usr/lib/libQtCore.so.4
#5  0x47f4c315 in start_thread () from /lib/i686/libpthread.so.0
#6  0x47ea0d4e in clone () from /lib/i686/libc.so.6

Thread 5 (Thread 0xb239db90 (LWP 11021)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0x47e962d7 in poll () from /lib/i686/libc.so.6
#2  0x48d59586 in ?? () from /usr/lib/libpulse.so.0
#3  0x48d4b311 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0x48d4ca95 in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0x48d4cb74 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0x48d5932e in ?? () from /usr/lib/libpulse.so.0
#7  0x48d7ae53 in ?? () from /usr/lib/libpulse.so.0
#8  0x47f4c315 in start_thread () from /lib/i686/libpthread.so.0
#9  0x47ea0d4e in clone () from /lib/i686/libc.so.6

Thread 4 (Thread 0xaf6feb90 (LWP 11045)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0x47f4fb95 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/i686/libpthread.so.0
#2  0x4229ff1b in QWaitCondition::wait () from /usr/lib/libQtCore.so.4
#3  0xb7d3cefd in Digikam::LoadSaveThread::run (this=0xb05ec20) at /home/gerlos/Download/digikam/digikam-0.10.0/libs/threadimageio/loadsavethread.cpp:131
#4  0x4229ee0f in ?? () from /usr/lib/libQtCore.so.4
#5  0x47f4c315 in start_thread () from /lib/i686/libpthread.so.0
#6  0x47ea0d4e in clone () from /lib/i686/libc.so.6

Thread 3 (Thread 0xb105ab90 (LWP 11057)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0x47f4fb95 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/i686/libpthread.so.0
#2  0x4229ff1b in QWaitCondition::wait () from /usr/lib/libQtCore.so.4
#3  0xb7d3cefd in Digikam::LoadSaveThread::run (this=0xb975040) at /home/gerlos/Download/digikam/digikam-0.10.0/libs/threadimageio/loadsavethread.cpp:131
#4  0x4229ee0f in ?? () from /usr/lib/libQtCore.so.4
#5  0x47f4c315 in start_thread () from /lib/i686/libpthread.so.0
#6  0x47ea0d4e in clone () from /lib/i686/libc.so.6

Thread 2 (Thread 0xac6ffb90 (LWP 11116)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0x47f4fb95 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/i686/libpthread.so.0
#2  0x4229ff1b in QWaitCondition::wait () from /usr/lib/libQtCore.so.4
#3  0xb7d3cefd in Digikam::LoadSaveThread::run (this=0xc0a4768) at /home/gerlos/Download/digikam/digikam-0.10.0/libs/threadimageio/loadsavethread.cpp:131
#4  0x4229ee0f in ?? () from /usr/lib/libQtCore.so.4
#5  0x47f4c315 in start_thread () from /lib/i686/libpthread.so.0
#6  0x47ea0d4e in clone () from /lib/i686/libc.so.6

Thread 1 (Thread 0xb78e56d0 (LWP 10933)):
[KCrash Handler]
#6  0xb7daa305 in Digikam::ThumbBarItem::repaint (this=0x0) at /home/gerlos/Download/digikam/digikam-0.10.0/libs/widgets/common/thumbbar.cpp:1179
#7  0x082c5487 in Digikam::ImagePreviewBar::rearrangeItems (this=0xc096b58) at /home/gerlos/Download/digikam/digikam-0.10.0/digikam/imagepreviewbar.cpp:200
#8  0xb7daa1e4 in Digikam::ThumbBarView::slotUpdate (this=0xc096b58) at /home/gerlos/Download/digikam/digikam-0.10.0/libs/widgets/common/thumbbar.cpp:1031
#9  0xb7daf86e in Digikam::ThumbBarView::qt_metacall (this=0xc096b58, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0xbfa87678)
    at /home/gerlos/Download/digikam/digikam-0.10.0/debug-build/digikam/thumbbar.moc:85
#10 0x082c6434 in Digikam::ImagePreviewBar::qt_metacall (this=0xc096b58, _c=QMetaObject::InvokeMetaMethod, _id=53, _a=0xbfa87678)
    at /home/gerlos/Download/digikam/digikam-0.10.0/debug-build/digikam/imagepreviewbar.moc:66
#11 0x423b1745 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#12 0x423b2fe5 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#13 0x423ee675 in QTimer::timeout () from /usr/lib/libQtCore.so.4
#14 0x423b7466 in QTimer::timerEvent () from /usr/lib/libQtCore.so.4
#15 0x423ab93b in QObject::event () from /usr/lib/libQtCore.so.4
#16 0x42a1cfcc in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4
#17 0x42a25706 in QApplication::notify () from /usr/lib/libQtGui.so.4
#18 0x43532bd1 in KApplication::notify () from /usr/lib/libkdeui.so.5
#19 0x4239ac3e in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#20 0x423cb29d in ?? () from /usr/lib/libQtCore.so.4
#21 0x423c7b7e in ?? () from /usr/lib/libQtCore.so.4
#22 0x4216d7ea in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#23 0x42170f08 in ?? () from /usr/lib/libglib-2.0.so.0
#24 0x421710c8 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#25 0x423c7ada in QEventDispatcherGlib::processEvents () from /usr/lib/libQtCore.so.4
#26 0x42ac14ba in ?? () from /usr/lib/libQtGui.so.4
#27 0x42399203 in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#28 0x42399651 in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#29 0x4239bbb6 in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#30 0x42a1ce34 in QApplication::exec () from /usr/lib/libQtGui.so.4
#31 0x0830698e in main (argc=1, argv=0xbfa88074) at /home/gerlos/Download/digikam/digikam-0.10.0/digikam/main.cpp:190
Comment 1 Andi Clemens 2009-03-27 16:49:58 UTC
The problem is in digikam/imagepreviewbar.cpp:200,
we need to check for a null pointer here...

Strange I still can't produce this crash.

Andi
Comment 2 gerlos 2009-03-27 17:02:04 UTC
(In reply to comment #1)
> The problem is in digikam/imagepreviewbar.cpp:200,
> we need to check for a null pointer here...
> 
> Strange I still can't produce this crash.
> 
> Andi

I don't know if it's pertinent, just forgotten to say it before, but I enabled that options to make digikam write metadata (keywords, stars, ...) inside each photo.
Comment 3 Andi Clemens 2009-03-27 17:05:24 UTC
There are some other issues:

1. Load an image into the editor.
2. Set some rating in the thumbbar
3. DON'T leave the rating widget and set another rating.
4. LEAVE the rating widget now, the first made rating will be shown again (some signal is missing?)

If you open the Caption/Tags sidebar, you can see that a rating is assigned only once. In the main albumUI you can change the rating as often as you like without losing the focus on the star rating widget.
Maybe this is related to the above problem, too?

Andi
Comment 4 Andi Clemens 2009-03-27 17:06:46 UTC
(In reply to comment #2)
> I don't know if it's pertinent, just forgotten to say it before, but I enabled
> that options to make digikam write metadata (keywords, stars, ...) inside each
> photo.

I have this enabled, too, but I'm not able to crash digiKam.
Comment 5 gerlos 2009-03-27 17:18:17 UTC
(In reply to comment #3)
> There are some other issues:
> 
> 1. Load an image into the editor.
> 2. Set some rating in the thumbbar
> 3. DON'T leave the rating widget and set another rating.
> 4. LEAVE the rating widget now, the first made rating will be shown again (some
> signal is missing?)
> 
> If you open the Caption/Tags sidebar, you can see that a rating is assigned
> only once. In the main albumUI you can change the rating as often as you like
> without losing the focus on the star rating widget.
> Maybe this is related to the above problem, too?

Maybe yes, I tried doing things this way and found the problem you say: when I leave the star widget I get the previous rating.

I also see that the stars seem "garbled", just like there is a second row of stars behind it, when I change the actual rating to an higher one and after to a lower one, without losing the focus, as you said.
I tried these things four or five times, getting one crash, but I can't say what I was doing different that time.

Actually, it crashed every time I change the rating of an image in the thumbnail bar but different from the one loaded in the editor.
Comment 6 Andi Clemens 2009-03-30 14:28:59 UTC
I really tried to provoke this crash on my machine, but I'm just unable to succeed. Maybe you can find a pattern that really crashed digiKam all the time and give us a step-by-step TODO list?
Or you might record a video of it, for example with recordmydesktop or such a software.
Chances are that you will not be able to attach the video here, but feel free to send my an email with the file.

Andi
Comment 7 gerlos 2009-03-30 19:01:09 UTC
(In reply to comment #6)
> I really tried to provoke this crash on my machine, but I'm just unable to
> succeed. Maybe you can find a pattern that really crashed digiKam all the time
> and give us a step-by-step TODO list?
> Or you might record a video of it, for example with recordmydesktop or such a
> software.

OK, I tried some more, and recorded a screencast with recordmydesktop as you suggested. 
You can download it from my personal web server at this address:
http://gerlos.homelinux.org/data/
It won't download the video directly, it will display you an html page and you can download it from there. If you can't reach the page try in a half a hour, maybe they changed my ip and my dyndns record didn't update...

With some more experiments I saw that my digikam crashed *also* when viewing the preview of an image and changing the rating in the thumbnail bar for an image different from the one displayed.

I don't know if I provided enough information, ask if you need more to understand the problem...
Comment 8 Andi Clemens 2009-03-30 19:37:21 UTC
After clicking like crazy on the AbumUI and ThumbBar (over 10 billion times, I swear :-)) I finally managed to crash digiKam:

rogram received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb484e700 (LWP 20293)]
0xb7246ec9 in Digikam::ThumbBarItem::repaint (this=0x0) at /home/andi/Programmieren/KDE/digiKam/digikam_KDE4/digikam/libs/widgets/common/thumbbar.cpp:1181
1181        d->view->repaintItem(this);
(gdb) bt
#0  0xb7246ec9 in Digikam::ThumbBarItem::repaint (this=0x0) at /home/andi/Programmieren/KDE/digiKam/digikam_KDE4/digikam/libs/widgets/common/thumbbar.cpp:1181
#1  0x08316c35 in Digikam::ImagePreviewBar::rearrangeItems (this=0xa55c028) at /home/andi/Programmieren/KDE/digiKam/digikam_KDE4/digikam/digikam/imagepreviewbar.cpp:203
#2  0xb7246da8 in Digikam::ThumbBarView::slotUpdate (this=0xa55c028) at /home/andi/Programmieren/KDE/digiKam/digikam_KDE4/digikam/libs/widgets/common/thumbbar.cpp:1033
#3  0xb724c432 in Digikam::ThumbBarView::qt_metacall (this=0xa55c028, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0xbfd461a8) at /home/andi/Programmieren/KDE/digiKam/digikam_KDE4/digikam/digikam/thumbbar.moc:85
#4  0x08317ddc in Digikam::ImagePreviewBar::qt_metacall (this=0xa55c028, _c=QMetaObject::InvokeMetaMethod, _id=53, _a=0xbfd461a8) at /home/andi/Programmieren/KDE/digiKam/digikam_KDE4/digikam/digikam/imagepreviewbar.moc:66
#5  0xb59dc1a9 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#6  0xb59dc752 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#7  0xb5a13b77 in QTimer::timeout () from /usr/lib/libQtCore.so.4
#8  0xb59e313e in QTimer::timerEvent () from /usr/lib/libQtCore.so.4
#9  0xb59d8f5f in QObject::event () from /usr/lib/libQtCore.so.4
#10 0xb5e3101c in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4
#11 0xb5e38a9e in QApplication::notify () from /usr/lib/libQtGui.so.4
#12 0xb6845cfd in KApplication::notify () from /usr/lib/libkdeui.so.5
#13 0xb59c9c1b in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#14 0xb59f49a1 in ?? () from /usr/lib/libQtCore.so.4
#15 0xbfd469b0 in ?? ()
#16 0x0a6b2688 in ?? ()
#17 0xbfd4663c in ?? ()
#18 0xb6845cfd in KApplication::notify () from /usr/lib/libkdeui.so.5
#19 0xb59f1540 in ?? () from /usr/lib/libQtCore.so.4
#20 0x0a3d8ca4 in ?? ()
#21 0xb51c423c in ?? () from /usr/lib/libglib-2.0.so.0
#22 0xbfd466d8 in ?? ()
#23 0xb51495e8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
Backtrace stopped: frame did not save the PC


Seems to be some kind of race condition, some items should be drawn but it is already deleted. This really happens when clicking like crazy on the thumbbar.

Andi
Comment 9 Andi Clemens 2009-03-30 19:41:14 UTC
This bug is true for AlbumUI and ImageEditor, so I will change the title a little bit...
Comment 10 Andi Clemens 2009-03-31 12:35:22 UTC
(In reply to comment #7)
> OK, I tried some more, and recorded a screencast with recordmydesktop as you
> suggested. 
> You can download it from my personal web server at this address:
> http://gerlos.homelinux.org/data/

Thanks for the video and the very detailed description. As I mentioned above, I managed to crash digikam once now, but it was very hard to do and I didn't manage to do it again.
I have an idea about the crash and the strange "duplicate stars" effect, but right now I can't track it down precisely.

Andi
Comment 11 caulier.gilles 2009-05-19 15:39:53 UTC
Andi, Gerlos,

What's news about this entry. It still valid ?

Gilles Caulier
Comment 12 Andi Clemens 2009-05-19 21:11:39 UTC
Hmm this one is so hard to test, right now I can't reproduce it. But it took me ages before to crash digiKam, so it might be still valid.
Need to check this tomorrow.
Comment 13 Juergen Diel 2009-06-19 11:08:56 UTC
Probably my problem belongs to the same category. But additionally, digikam crashes also after a change of the keywords. After restarting digikam, the change of keyword or star rating is still visible --> the crash happens AFTER these changes have been written.
JD
Comment 14 Nicolas L. 2009-11-02 11:07:51 UTC
is it still valid on mandriva 2010.0 rpms ?

--- 
Nicolas Lécureuil
Mandriva KDE Team
Comment 15 caulier.gilles 2009-12-25 19:58:03 UTC
digiKam 1.0.0 is out since few days...

http://www.digikam.org/drupal/node/491

Please try with this version comming with more than 400 bugfixes. 

Thanks in advance

Gilles Caulier
Comment 16 caulier.gilles 2009-12-25 20:06:56 UTC
digiKam 1.0.0 is out since few days...

http://www.digikam.org/drupal/node/491

Please try with this version coming with more than 400 bug-fixes.

Thanks in advance

Gilles Caulier
Comment 17 caulier.gilles 2010-01-25 21:47:25 UTC
digiKam 1.1. release will be done in few days. Please check if this entry still valid.

Thanks in advance

Gilles Caulier
Comment 18 caulier.gilles 2010-04-04 10:41:57 UTC
digiKam and Kipi-plugins 1.2.0 are out. Please check if crash is still valid there.

Thanks in advance

Gilles Caulier
Comment 19 Ekki Plicht 2010-06-06 23:08:03 UTC
This bug is still valid with:
digikam 1.1.0-r1
kipi-plugins 0.8.0
libkipi 4.3.5
kernel 2.6.32-gentoo-r7

With my machine, a 7 yr old Athlon XP @2.6GHz, 4GB RAM, it does not need a lot of clicking, just a few changes to the ratings and crash it goes... reliably, each time I try it.
I don't use the thumbnail bar, but rightclick on the picture and select a rating there. No other editing. When using the thumbnailbar the crash occurs even faster.

Thanks for looking into that.

Rgds,
Ekki
Comment 20 caulier.gilles 2010-06-07 00:32:19 UTC
ekki,

This bug have been fixed in digiKam 1.2.0.

Gilles Caulier
Comment 21 Ekki Plicht 2010-06-07 07:40:37 UTC
On Monday 07 June 2010 00:32:22 Gilles Caulier wrote:
> https://bugs.kde.org/show_bug.cgi?id=188263
> 
> 
> 
> 
> 
> --- Comment #20 from Gilles Caulier <caulier gilles gmail com>  2010-06-07
>  00:32:19 --- ekki,
> 
> This bug have been fixed in digiKam 1.2.0.

Ok, great, thanks. Didn't see that. So I will wait until the Gentoo guys get 
it into portage.

Many thanks, it's a great program.
Ekki
Comment 22 caulier.gilles 2010-06-07 09:28:54 UTC
Andi,

I think this file can be closed. Right ?

Gilles Caulier