Bug 331714

Summary: Showfoto crash when opening RAW
Product: [Applications] digikam Reporter: Veaceslav Munteanu <veaceslav.munteanu90>
Component: Showfoto-RawProcessingAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: caulier.gilles
Priority: NOR Keywords: drkonqi
Version: 4.0.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 4.0.0
Sentry Crash Report:

Description Veaceslav Munteanu 2014-03-03 22:00:48 UTC
Application: showfoto (4.0.0-beta4)
KDE Platform Version: 4.12.2 (Compiled from sources)
Qt Version: 4.8.5
Operating System: Linux 3.13.5-1-ARCH x86_64
Distribution: "Arch Linux"

-- Information about the crash:
With latest git, Showphoto crashes when trying to open a Raw image

1. Open a RaW image from slow media (SD Card) 
2. While image is still loading, double-click on sidebar thumbnail (without it won't crash)
3. Crash

The crash can be reproduced sometimes.

-- Backtrace:
Application: showFoto (showfoto), signal: Segmentation fault
Using host libthread_db library "/usr/lib/libthread_db.so.1".
To enable execution of this file add
	add-auto-load-safe-path /usr/lib/libstdc++.so.6.0.19-gdb.py
line to your configuration file "/home/slavik/.gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/home/slavik/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
	info "(gdb)Auto-loading safe path"
[Current thread is 1 (Thread 0x7f9e1faa4980 (LWP 2037))]

Thread 7 (Thread 0x7f9df92f2700 (LWP 2038)):
#0  0x00007f9e1ac9335d in poll () from /usr/lib/libc.so.6
#1  0x00007f9e00fe6918 in ?? () from /usr/lib/libusb-1.0.so.0
#2  0x00007f9e1b98f0a2 in start_thread () from /usr/lib/libpthread.so.0
#3  0x00007f9e1ac9bd1d in clone () from /usr/lib/libc.so.6

Thread 6 (Thread 0x7f9df2d0e700 (LWP 2039)):
#0  0x00007f9e1b99304f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f9e1bc1f266 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f9e1f45e68b in Digikam::ParkingThread::run (this=0x1102330) at /media/LinuxHDD/digikam-software-compilation/core/libs/threads/threadmanager.cpp:119
#3  0x00007f9e1bc1ed8f in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f9e1b98f0a2 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007f9e1ac9bd1d in clone () from /usr/lib/libc.so.6

Thread 5 (Thread 0x7f9df14b1700 (LWP 2040)):
#0  0x00007f9e1b9933f8 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f9e1bc1f244 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f9e1bc12945 in ?? () from /usr/lib/libQtCore.so.4
#3  0x00007f9e1bc1ed8f in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f9e1b98f0a2 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007f9e1ac9bd1d in clone () from /usr/lib/libc.so.6

Thread 4 (Thread 0x7f9df0cb0700 (LWP 2041)):
#0  0x00007f9e1b17db02 in ?? () from /usr/lib/libgomp.so.1
#1  0x00007f9e1b17c36e in ?? () from /usr/lib/libgomp.so.1
#2  0x00007f9e1b98f0a2 in start_thread () from /usr/lib/libpthread.so.0
#3  0x00007f9e1ac9bd1d in clone () from /usr/lib/libc.so.6

Thread 3 (Thread 0x7f9dea123700 (LWP 2042)):
#0  0x00007f9e1b17db02 in ?? () from /usr/lib/libgomp.so.1
#1  0x00007f9e1b17c36e in ?? () from /usr/lib/libgomp.so.1
#2  0x00007f9e1b98f0a2 in start_thread () from /usr/lib/libpthread.so.0
#3  0x00007f9e1ac9bd1d in clone () from /usr/lib/libc.so.6

Thread 2 (Thread 0x7f9de9922700 (LWP 2043)):
#0  0x00007f9e1b17db02 in ?? () from /usr/lib/libgomp.so.1
#1  0x00007f9e1b17c36e in ?? () from /usr/lib/libgomp.so.1
#2  0x00007f9e1b98f0a2 in start_thread () from /usr/lib/libpthread.so.0
#3  0x00007f9e1ac9bd1d in clone () from /usr/lib/libc.so.6

Thread 1 (Thread 0x7f9e1faa4980 (LWP 2037)):
[KCrash Handler]
#5  0x00007f9e1f269736 in Digikam::DSharedDataPointer<Digikam::DImg::Private>::assign (this=0x1269e90, o=...) at /media/LinuxHDD/digikam-software-compilation/core/libs/dimg/dshareddata.h:223
#6  0x00007f9e1f267e1a in Digikam::DSharedDataPointer<Digikam::DImg::Private>::operator= (this=0x1269e90, o=...) at /media/LinuxHDD/digikam-software-compilation/core/libs/dimg/dshareddata.h:202
#7  0x00007f9e1f258a41 in Digikam::DImg::operator= (this=0x1269e90, image=...) at /media/LinuxHDD/digikam-software-compilation/core/libs/dimg/dimg.cpp:189
#8  0x00007f9e1f51adbb in Digikam::GraphicsDImgItem::setImage (this=0x1268a80, img=...) at /media/LinuxHDD/digikam-software-compilation/core/libs/widgets/graphicsview/graphicsdimgitem.cpp:154
#9  0x00007f9e1f4d6516 in Digikam::Canvas::slotImageLoaded (this=0x121b800, filePath=..., success=true) at /media/LinuxHDD/digikam-software-compilation/core/utilities/imageeditor/widgets/canvas.cpp:170
#10 0x00007f9e1f4d5781 in Digikam::Canvas::qt_static_metacall (_o=0x121b800, _c=QMetaObject::InvokeMetaMethod, _id=35, _a=0x7fff09c280c0) at /media/LinuxHDD/digikam-software-compilation/build/core/digikam/canvas.moc:152
#11 0x00007f9e1bd32b48 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#12 0x00007f9e1f535aa8 in Digikam::EditorCore::signalImageLoaded (this=0x126d820, _t1=..., _t2=true) at /media/LinuxHDD/digikam-software-compilation/build/core/digikam/editorcore.moc:176
#13 0x00007f9e1f537ba6 in Digikam::EditorCore::Private::load (this=0x1267a70, description=...) at /media/LinuxHDD/digikam-software-compilation/core/utilities/imageeditor/core/editorcore_p.h:389
#14 0x00007f9e1f5381c9 in Digikam::EditorCore::load (this=0x126d820, filePath=..., iofileSettings=0x10c0440) at /media/LinuxHDD/digikam-software-compilation/core/utilities/imageeditor/core/editorcore.cpp:159
#15 0x00007f9e1f4d64cf in Digikam::Canvas::load (this=0x121b800, filename=..., IOFileSettings=0x10c0440) at /media/LinuxHDD/digikam-software-compilation/core/utilities/imageeditor/widgets/canvas.cpp:165
#16 0x0000000000458701 in ShowFoto::ShowFoto::slotOpenUrl (this=0x10c2250, info=...) at /media/LinuxHDD/digikam-software-compilation/core/showfoto/main/showfoto.cpp:598
#17 0x0000000000454693 in ShowFoto::ShowFoto::qt_static_metacall (_o=0x10c2250, _c=QMetaObject::InvokeMetaMethod, _id=10, _a=0x7fff09c28a20) at /media/LinuxHDD/digikam-software-compilation/build/core/showfoto/showfoto.moc:103
#18 0x00007f9e1bd32b48 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#19 0x000000000044da51 in ShowFoto::ShowfotoCategorizedView::showfotoItemInfoActivated (this=0x140d6f0, _t1=...) at /media/LinuxHDD/digikam-software-compilation/build/core/showfoto/showfotocategorizedview.moc:159
#20 0x000000000044fa1c in ShowFoto::ShowfotoCategorizedView::indexActivated (this=0x140d6f0, index=...) at /media/LinuxHDD/digikam-software-compilation/core/showfoto/thumbbar/showfotocategorizedview.cpp:529
#21 0x00007f9e1f4b6079 in Digikam::DCategorizedView::slotActivated (this=0x140d6f0, index=...) at /media/LinuxHDD/digikam-software-compilation/core/libs/widgets/itemview/dcategorizedview.cpp:401
#22 0x00007f9e1f4b4497 in Digikam::DCategorizedView::qt_static_metacall (_o=0x140d6f0, _c=QMetaObject::InvokeMetaMethod, _id=13, _a=0x7fff09c28cf0) at /media/LinuxHDD/digikam-software-compilation/build/core/digikam/dcategorizedview.moc:97
#23 0x00007f9e1bd32b48 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#24 0x00007f9e1d0e26f5 in QAbstractItemView::activated(QModelIndex const&) () from /usr/lib/libQtGui.so.4
#25 0x00007f9e1d0e2978 in QAbstractItemView::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQtGui.so.4
#26 0x00007f9e1d10c09e in QListView::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQtGui.so.4
#27 0x00007f9e1f4abc73 in Digikam::DigikamKCategorizedView::mouseReleaseEvent (this=0x140d6f0, event=0x17bdc90) at /media/LinuxHDD/digikam-software-compilation/core/libs/widgets/itemview/digikamkcategorizedview.cpp:1326
#28 0x00007f9e1f4b7ebd in Digikam::DCategorizedView::mouseReleaseEvent (this=0x140d6f0, event=0x17bdc90) at /media/LinuxHDD/digikam-software-compilation/core/libs/widgets/itemview/dcategorizedview.cpp:804
#29 0x00007f9e1cc3f62e in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#30 0x00007f9e1cfdc89e in QFrame::event(QEvent*) () from /usr/lib/libQtGui.so.4
#31 0x00007f9e1d0eba83 in QAbstractItemView::viewportEvent(QEvent*) () from /usr/lib/libQtGui.so.4
#32 0x00007f9e1f4b86f5 in Digikam::DCategorizedView::viewportEvent (this=0x140d6f0, event=0x17bdc90) at /media/LinuxHDD/digikam-software-compilation/core/libs/widgets/itemview/dcategorizedview.cpp:956
#33 0x00007f9e1bd1f026 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#34 0x00007f9e1cbf00bc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#35 0x00007f9e1cbf67dd in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#36 0x00007f9e1d90f77a in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#37 0x00007f9e1bd1eebd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#38 0x00007f9e1bd21f0f in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#39 0x00007f9e1bd4c263 in ?? () from /usr/lib/libQtCore.so.4
#40 0x00007f9e13c75296 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#41 0x00007f9e13c755e8 in ?? () from /lib64/libglib-2.0.so.0
#42 0x00007f9e13c7568c in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#43 0x00007f9e1bd4bb25 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#44 0x00007f9e1cc8d216 in ?? () from /usr/lib/libQtGui.so.4
#45 0x00007f9e1bd1db1f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#46 0x00007f9e1bd1de15 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#47 0x00007f9e1bd22f4b in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#48 0x0000000000454089 in main (argc=6, argv=0x7fff09c29ce8) at /media/LinuxHDD/digikam-software-compilation/core/showfoto/main/main.cpp:90

Reported using DrKonqi
Comment 1 caulier.gilles 2014-03-05 04:07:57 UTC
Veaceslav,

It crash in DSharedDataPointer class 

Perhaps CppCheck tool is right :

/srv/jenkins/workspace/digikam_master/libs/dimg/dshareddata.h	200	operatorEqVarError	warning	Member variable 'DSharedDataPointer::d' is not assigned a value in 'DSharedDataPointer::operator='.

http://build.kde.org/view/extragear/job/digikam_master/1182/cppcheckResult/source.21/#200

Gilles Caulier
Comment 2 caulier.gilles 2014-03-10 15:37:22 UTC
*** Bug 331975 has been marked as a duplicate of this bug. ***
Comment 3 caulier.gilles 2014-03-10 15:38:46 UTC
Note : An easy way to reproduce the crash is explained in bug #331975

Gilles Caulier
Comment 4 Veaceslav Munteanu 2014-03-13 20:41:46 UTC
Fixed. It was a null pointer dereference. Added an extra guard before dereferencing.

To be honest, Showfoto code is some sort of magic for me =)