Bug 268356 - 0-pointer access if mysql-db is not working correctly
Summary: 0-pointer access if mysql-db is not working correctly
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Unclassified
Component: Database-Mysql (show other bugs)
Version: 2.0.0
Platform: Compiled Sources Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-13 10:35 UTC by Ian Hubbertz
Modified: 2017-07-25 10:34 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.12.0


Attachments
New crash information added by DrKonqi (15.57 KB, text/plain)
2011-06-28 19:34 UTC, Francesco Riosa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Hubbertz 2011-03-13 10:35:12 UTC
Application: digikam (2.0.0-beta3)
KDE Platform Version: 4.6.1 (4.6.1) (Compiled from sources)
Qt Version: 4.7.2
Operating System: Linux 2.6.37-gentoo x86_64
Distribution (Platform): Gentoo Packages

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

Configured the mysql connection: 

1. mysql connection where incorrect (db was missing)
2. created the DB, but no tables or access right with mysqladmin
3. clicked "check database connection" in digikam
4. closed the window

--> error: cannot create table (because of missing access rights)

--> crash (see backtrace)

-- Backtrace:
Application: digiKam (digikam), signal: Segmentation fault
[Current thread is 1 (Thread 0x7fef4d2e2980 (LWP 21525))]

Thread 4 (Thread 0x7fef2affa700 (LWP 21526)):
#0  0x00007fef4482164c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007fef44aade33 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00000000005e725e in Digikam::ScanController::run (this=0xc8acd0) at /home/ian/Desktop/Coding/compile/digikam-2.0.0-beta3/core/digikam/database/scancontroller.cpp:602
#3  0x00007fef44aad7c5 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007fef32fcbae3 in ?? () from //usr/lib64/opengl/nvidia/lib/libGL.so.1
#5  0x00007fef4481cd6c in start_thread () from /lib/libpthread.so.0
#6  0x00007fef4384240d in clone () from /lib/libc.so.6

Thread 3 (Thread 0x7fef2a7f9700 (LWP 21527)):
#0  0x00007fef44820944 in __pthread_mutex_unlock_usercnt () from /lib/libpthread.so.0
#1  0x00007fef3f0bc991 in g_main_context_prepare () from /usr/lib/libglib-2.0.so.0
#2  0x00007fef3f0bcdf2 in ?? () from /usr/lib/libglib-2.0.so.0
#3  0x00007fef3f0bd3c2 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#4  0x00007fef44bc0d76 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#5  0x00007fef44b95012 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007fef44b95294 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#7  0x00007fef44aaaf64 in QThread::exec() () from /usr/lib64/qt4/libQtCore.so.4
#8  0x00007fef44b76c60 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#9  0x00007fef44aad7c5 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#10 0x00007fef32fcbae3 in ?? () from //usr/lib64/opengl/nvidia/lib/libGL.so.1
#11 0x00007fef4481cd6c in start_thread () from /lib/libpthread.so.0
#12 0x00007fef4384240d in clone () from /lib/libc.so.6

Thread 2 (Thread 0x7fef29ff8700 (LWP 21541)):
#0  0x00007fef4482164c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007fef44aade33 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007fef49c70427 in Digikam::ParkingThread::run (this=0xec9060) at /home/ian/Desktop/Coding/compile/digikam-2.0.0-beta3/core/libs/threads/threadmanager.cpp:119
#3  0x00007fef44aad7c5 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007fef32fcbae3 in ?? () from //usr/lib64/opengl/nvidia/lib/libGL.so.1
#5  0x00007fef4481cd6c in start_thread () from /lib/libpthread.so.0
#6  0x00007fef4384240d in clone () from /lib/libc.so.6

Thread 1 (Thread 0x7fef4d2e2980 (LWP 21525)):
[KCrash Handler]
#6  0x00000000005a9638 in Digikam::Album::lastChild (this=0x0) at /home/ian/Desktop/Coding/compile/digikam-2.0.0-beta3/core/digikam/album/album.cpp:102
#7  0x00000000005c11ce in Digikam::AlbumManager::slotDatesJobData (this=0xd06920, data=...) at /home/ian/Desktop/Coding/compile/digikam-2.0.0-beta3/core/digikam/album/albummanager.cpp:3218
#8  0x00000000005b0333 in Digikam::AlbumManager::qt_metacall (this=0xd06920, _c=QMetaObject::InvokeMetaMethod, _id=22, _a=0x7fff7c4c0a20) at /home/ian/Desktop/Coding/compile/digikam-2.0.0-beta3/core/digikam/albummanager.moc:193
#9  0x00007fef44baa59f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#10 0x00007fef47501054 in KIO::TransferJob::data(KIO::Job*, QByteArray const&) () from /usr/lib/libkio.so.5
#11 0x00007fef475010a9 in KIO::TransferJob::slotData(QByteArray const&) () from /usr/lib/libkio.so.5
#12 0x00007fef475088fe in KIO::TransferJob::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkio.so.5
#13 0x00007fef44baa59f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#14 0x00007fef475a4da2 in KIO::SlaveInterface::data(QByteArray const&) () from /usr/lib/libkio.so.5
#15 0x00007fef475a7e08 in KIO::SlaveInterface::dispatch(int, QByteArray const&) () from /usr/lib/libkio.so.5
#16 0x00007fef475a484c in KIO::SlaveInterface::dispatch() () from /usr/lib/libkio.so.5
#17 0x00007fef47598056 in KIO::Slave::gotInput() () from /usr/lib/libkio.so.5
#18 0x00007fef47598624 in KIO::Slave::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkio.so.5
#19 0x00007fef44baa59f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#20 0x00007fef474d094d in ?? () from /usr/lib/libkio.so.5
#21 0x00007fef474d09dd in KIO::Connection::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkio.so.5
#22 0x00007fef44baa062 in QObject::event(QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#23 0x00007fef457df93c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#24 0x00007fef457e449a in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#25 0x00007fef4653dee8 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#26 0x00007fef44b95ccb in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#27 0x00007fef44b994e4 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/qt4/libQtCore.so.4
#28 0x00007fef44bc0bd3 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#29 0x00007fef3f0b9399 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#30 0x00007fef3f0bd220 in ?? () from /usr/lib/libglib-2.0.so.0
#31 0x00007fef3f0bd3c2 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#32 0x00007fef44bc0d3a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#33 0x00007fef458859c6 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#34 0x00007fef44b95012 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#35 0x00007fef44b95294 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#36 0x00007fef44b9977b in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4
#37 0x00000000006c90c7 in main (argc=1, argv=0x7fff7c4c22c8) at /home/ian/Desktop/Coding/compile/digikam-2.0.0-beta3/core/digikam/main/main.cpp:232

Possible duplicates by query: bug 233766.

Reported using DrKonqi
Comment 1 Marcel Wiesweg 2011-03-13 16:17:38 UTC
This is a weird backtrace. I dont understand how to reach lastChild() from line 3218, which invokes the DAlbum constructor.
Comment 2 Marcel Wiesweg 2011-04-16 16:02:37 UTC
Git commit 460427733fd770368b02fcc772c360776dad0da1 by Marcel Wiesweg.
Committed on 07/04/2011 at 21:53.
Pushed by mwiesweg into branch 'master'.

Ensure to have a root album at this point.
Under the exceptional circumstances in the bug, this
could prevent the crash

CCBUG: 268356

M  +1    -1    digikam/album/albummanager.cpp     

http://commits.kde.org/digikam/460427733fd770368b02fcc772c360776dad0da1
Comment 3 caulier.gilles 2011-04-29 11:36:50 UTC
Ian,

Marcel has patched git master source code. Can you take a look if problem still exist ?

Thanks in advace

Gilles Caulier
Comment 4 Francesco Riosa 2011-06-28 19:34:01 UTC
Created attachment 61424 [details]
New crash information added by DrKonqi

digikam (2.0.0-rc) on KDE Platform 4.6.4 (4.6.4) using Qt 4.7.3

in 2.0.0-rc
1) open digikam
2) shutdown mysql database
3) click an thumbnail

-- Backtrace (Reduced):
#6  ref (this=0x7fff1e41f300, other=...) at ../../src/corelib/arch/qatomic_x86_64.h:121
#7  QString (this=0x7fff1e41f300, other=...) at ../../src/corelib/tools/qstring.h:729
#8  QSqlError::QSqlError (this=0x7fff1e41f300, other=...) at kernel/qsqlerror.cpp:109
#9  0x00007f98bea423d4 in QSqlDriver::lastError (this=<value optimized out>) at kernel/qsqldriver.cpp:339
#10 0x00007f98bb66c779 in Digikam::DatabaseCoreBackendPrivate::debugOutputFailedQuery (this=0x1f4e940, query=...) at /home/vivo/digikam-devel/cppsrc/core/libs/database/databasecorebackend.cpp:342
Comment 5 caulier.gilles 2011-07-02 10:02:10 UTC
digiKam 2.0.0 RC is out. Please check if crash is reproducible with this version.

Thanks in advance

Gilles Caulier
Comment 6 Marcel Wiesweg 2011-07-11 17:03:03 UTC
Git commit d2bca3f9fe3840d68c5b78e04926ff5f0787aa1d by Marcel Wiesweg.
Committed on 11/07/2011 at 17:05.
Pushed by mwiesweg into branch 'master'.

Avoid accessing the driver() of a possibly failed query, it may obviously crash

CCBUG: 268356

M  +1    -1    libs/database/databasecorebackend.cpp     

http://commits.kde.org/digikam/d2bca3f9fe3840d68c5b78e04926ff5f0787aa1d
Comment 7 caulier.gilles 2011-11-03 12:42:07 UTC
digiKam 2.2.0 is out since few weeks. Crash still valid with this version ?

Gilles Caulier
Comment 8 caulier.gilles 2011-12-15 08:21:42 UTC
Ian, 

We need a feedback using digiKam 2.4...

Gilles Caulier
Comment 9 caulier.gilles 2015-06-26 14:04:24 UTC
Not reproducible.

Gilles Caulier