Bug 339008

Summary: DigiKam crashed when opening import window
Product: [Applications] digikam Reporter: manuel.kirzinger
Component: Import-IconViewAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: aidanw-subs, caulier.gilles, e.edak, listaccount, metzpinguin, moritz-kdebugs, rainer.lay, simonandric5, vsandre
Priority: NOR    
Version: 4.12.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 4.12.0
Sentry Crash Report:
Attachments: crashreport
Crash log
Crash log
Backtrace for crash when clicking Import>Card Readers>(Any USB stick)

Description manuel.kirzinger 2014-09-11 09:48:05 UTC
Created attachment 88655 [details]
crashreport

Crashed right after pressing import button. Import window did not even show up.
Comment 1 Christoph Feck 2014-09-11 11:25:30 UTC
Looking at the backtrace, there are two threads that mention ICCPreviewWidget. Are UI classes used in multiple threads? Maybe because of external libraries needing nested event loops?
Comment 2 caulier.gilles 2014-09-11 11:30:36 UTC
yes, digiKam use multithreading everywhere.

When i said everywhere, digiKam cannot be started when relevant shared lib for multithreading are not installed (typically QThread)

So, it's not a threads problem. Sound like an unsupported icc profile embeded in image, which cannot be managed by lcms shared lib.

Gilles Caulier
Comment 3 Christoph Feck 2014-09-11 12:08:44 UTC
http://qt-project.org/doc/qt-4.8/thread-basics.html states:

"As mentioned, each program has one thread when it is started. This thread is called the "main thread" (also known as the "GUI thread" in Qt applications). The Qt GUI must run in this thread. All widgets and several related classes, for example QPixmap, don't work in secondary threads."

So while it is nice that digiKam uses multiple threads, it cannot use ICCPreviewWidget outside of the main UI thread.
Comment 4 caulier.gilles 2014-09-11 12:15:14 UTC
I know all of this (:=))) 

But i'm sure that iccpreview widget is not used outside main thread.

Note : About QPixmap, it's only true under X11 based env, because X11 is not re-entrant...

Gilles
Comment 5 caulier.gilles 2014-12-10 17:52:50 UTC
digiKam 4.5.0 have been released.

Crash still reproducible with this release ?

Gilles Caulier
Comment 6 Peter F 2014-12-10 22:35:47 UTC
With 4.5.0, you can still 
- Start Digikam
- Import -> Add images...
- Select folder
- ... See The KDE crash handler

I attached the latest Crash log
Comment 7 Peter F 2014-12-10 22:37:02 UTC
Created attachment 89914 [details]
Crash log

Crash log created by the KDE crash handler, when Digikam crashes while it should import images.
Comment 8 caulier.gilles 2015-03-25 08:50:19 UTC
Problem still reproducible with last stable digiKam 4.8.0 ?

Gilles Caulier
Comment 9 Peter F 2015-03-25 09:40:21 UTC
Can't check:
The most recent Digikam-Installer package on http://download.kde.org/stable/digikam/ is 4.5.0

Maybe, you can forward a request to the one who generates the windows installer to be so kind to let it run? (If it'd be that easy...)
Comment 10 caulier.gilles 2015-03-26 06:49:18 UTC
Peter,

digiKam 4.7.0 for Windows is available :

http://download.kde.org/stable/digikam/digiKam-installer-4.7.0-1-win32.exe.mirrorlist

Please test and report.

Thanks in advance

Gilles Caulier
Comment 11 Peter F 2015-03-26 12:08:20 UTC
Hi Gilles,

thank you for providing the installer!
I'll try it this evening and report the results.

Peter
Comment 12 Peter F 2015-03-26 21:28:52 UTC
Hi Gilles,

on my Win8.1-System, the Digikam 4.7.0 you provided is still crashing on import. 
I was able to do the following:
Import-> Add images -> [walk to import folder]-> select folder -> crash

I attached the crash log.

cu
Peter
Comment 13 Peter F 2015-03-26 21:29:57 UTC
Created attachment 91757 [details]
Crash log
Comment 14 aidan 2015-04-07 21:46:13 UTC
Not sure if helpful to say "me too", but this has been a bug in the last few 4.x versions for me as well on Windows 8.1. It is still happening in 4.9.0. I'll try attach a backtrace to this ticket.
Comment 15 aidan 2015-04-07 21:48:16 UTC
Created attachment 91937 [details]
Backtrace for crash when clicking Import>Card Readers>(Any USB stick)

Backtrace for crash when clicking Import>Card Readers>(Any USB stick)
Comment 16 caulier.gilles 2015-04-08 05:03:09 UTC
*** Bug 342673 has been marked as a duplicate of this bug. ***
Comment 17 caulier.gilles 2015-04-08 05:07:10 UTC
digikamlib.dll!Digikam::PreviewSettings::PreviewSettings() [[unknown] @ -1] at 0x7756790c
kdeui.dll!QList<KSortableItem<QString,int> >::value() [[unknown] @ -1] at 0xf488c10
QtGui4.dll!QFont::operator==() [[unknown] @ -1] at 0x64d9ac8e
QtGui4.dll!QWidgetPrivate::resolveFont() [[unknown] @ -1] at 0x64c3ecae
QtGui4.dll!QWidgetPrivate::updateFont() [[unknown] @ -1] at 0x64c3ef37
QtGui4.dll!QWidgetPrivate::resolveFont() [[unknown] @ -1] at 0x64c3ecae
QtGui4.dll!QWidget::event() [[unknown] @ -1] at 0x64c46036
QtGui4.dll!QAbstractScrollArea::event() [[unknown] @ -1] at 0x64f9e318
QtGui4.dll!QAbstractItemView::event() [[unknown] @ -1] at 0x65016ab5
QtGui4.dll!QApplicationPrivate::notify_helper() [[unknown] @ -1] at 0x64c004cd
kdeui.dll!QList<KSortableItem<QString,int> >::value() [[unknown] @ -1] at 0xf488c10
QtCore4.dll!QCoreApplication::sendEvent() [[unknown] @ -1] at 0x66f63cf6
QtGui4.dll!QWidget::raise() [[unknown] @ -1] at 0x64c4a878

Sound like the problem is in PreviewSettings constructor.
Comment 18 Maik Qualmann 2015-04-08 18:24:30 UTC
Git commit 302f92bd9afb7c7b54cedf89d3bc2166a57dfbce by Maik Qualmann.
Committed on 08/04/2015 at 17:57.
Pushed by mqualmann into branch 'master'.

blocking ImportStackedView::syncSelection to also thumbBar->setModelsFiltered is set

M  +2    -0    utilities/importui/views/importstackedview.cpp

http://commits.kde.org/digikam/302f92bd9afb7c7b54cedf89d3bc2166a57dfbce
Comment 19 Maik Qualmann 2015-04-08 18:33:20 UTC
When the Import window open there was always this message in the console:

digikam(9655)/digikam (core) Digikam::ImportStackedView::syncSelection: one or both of the models are null?! from: Digikam::ImportIconView(0x6a6d420) to: Digikam::ImportThumbnailBar(0x6c0c340) 

I fixed this issue, the crash under Windows it will probably not fix.

Maik
Comment 20 SK 2015-04-22 20:36:39 UTC
This error ("Import-> Add images -> [walk to import folder]-> select folder -> crash") consistently occurs for me using digikam 4.9.0 on OSX 10.10.3, with MacPorts 2.3.3.
Comment 21 caulier.gilles 2015-05-12 12:56:24 UTC
*** Bug 340990 has been marked as a duplicate of this bug. ***
Comment 22 Rainer Lay 2015-05-13 19:22:54 UTC
meanwhile, 4.10.0 is available. I installed it and the error (chrash while rebuilding fingerprints) is still there.
Thanx for the current windows versions.
Comment 23 Maik Qualmann 2015-06-19 21:10:57 UTC
Git commit ad8538938371ec4152450c661b1857f8441e3af8 by Maik Qualmann.
Committed on 19/06/2015 at 21:01.
Pushed by mqualmann into branch 'master'.

fixes the model initialisation from the icon view and thumb bar of the import window
Related: bug 349280
FIXED-IN: 4.12.0

M  +3    -1    NEWS
M  +1    -7    utilities/importui/main/importui.cpp
M  +7    -3    utilities/importui/views/importiconview.cpp
M  +0    -2    utilities/importui/views/importiconview.h
M  +11   -20   utilities/importui/views/importstackedview.cpp
M  +0    -1    utilities/importui/views/importstackedview.h
M  +3    -12   utilities/importui/views/importview.cpp
M  +1    -1    utilities/importui/views/importview.h

http://commits.kde.org/digikam/ad8538938371ec4152450c661b1857f8441e3af8
Comment 24 caulier.gilles 2015-06-20 15:53:48 UTC
Git commit 0d4dca4094dab6930c66dc22adc6b2d31bcbe038 by Gilles Caulier.
Committed on 20/06/2015 at 15:52.
Pushed by cgilles into branch 'frameworks'.

backport commit #ad8538938371ec4152450c661b1857f8441e3af8 from git/master to frameworks branch
Related: bug 349280

M  +1    -7    utilities/importui/main/importui.cpp
M  +7    -3    utilities/importui/views/importiconview.cpp
M  +0    -2    utilities/importui/views/importiconview.h
M  +11   -18   utilities/importui/views/importstackedview.cpp
M  +0    -1    utilities/importui/views/importstackedview.h
M  +8    -14   utilities/importui/views/importview.cpp
M  +3    -2    utilities/importui/views/importview.h

http://commits.kde.org/digikam/0d4dca4094dab6930c66dc22adc6b2d31bcbe038
Comment 25 Rainer Lay 2015-08-07 18:07:48 UTC
the crash while rebuilding fingerprints (Bug 342673), still occurs in 4.12.0