Summary: | crashes after splash screen with ASSERT failure in QVector [patch] | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Thomas Eschenbacher <Thomas.Eschenbacher> |
Component: | ProgressManager-Splashscreen | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | caulier.gilles, metzpinguin, Thomas.Eschenbacher |
Priority: | NOR | ||
Version: | 5.0.0 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/digikam/e10a52aefc55d6e47e736910353a53546fd21fde | Version Fixed In: | 5.0.0 |
Sentry Crash Report: | |||
Attachments: |
gdb backtrace
console output up to the crash albummanager.patch albummanager2.patch |
Created attachment 96473 [details]
console output up to the crash
It sound like a Qt5 bug. #13 0x00000037b2808c61 in QAbstractItemModel::beginInsertRows (this=0x13c1c40, parent=..., first=0, last=0) at itemmodels/qabstractitemmodel.cpp:2602 #14 0x00007ffff795dc64 in Digikam::AbstractAlbumModel::slotAlbumAboutToBeAdded (this=0x13c1c40, album=0x22514a0, parent=0x32a94c0, prev=0x0) at /usr/src/packages/multimedia/digikam/core/libs/models/abstractalbummodel.cpp:438 When a parent album need to be inserted in the model (prev = 0), QAbstractItemModel::beginInsertRows() i scalled with 2 arguments to 0. I tried to reproduce the problem here, and it's not reproducible (Qt 5.5.1) Which Qt version did you use ? Gilles Caulier as I wrote above: Qt-5.5.1 It is 100% reproducible here. Git commit 33d1e60c7089f5bcb862a8110cc01c82d009d42c by Maik Qualmann. Committed on 05/01/2016 at 19:12. Pushed by mqualmann into branch 'master'. fix redefined signal started() in DImgThreadedFilter M +1 -1 libs/threads/dynamicthread.cpp M +1 -1 libs/threads/dynamicthread.h http://commits.kde.org/digikam/33d1e60c7089f5bcb862a8110cc01c82d009d42c Please try again with latest git commit. The crash is not to reproduce here. Maik how can I get this source version you are talking about?
I followed the instructions on the project homepage, which lead me to this repo:
> git remote -v
origin git://anongit.kde.org/digikam-software-compilation (fetch)
origin git://anongit.kde.org/digikam-software-compilation (push)
but your change is not visible there.
I tried to "git remote set-url origin git://anongit.kde.org/digikam.git" but that has lead to a big mess, had to restore the local repo from backup.
What should I do now?
The commit from Maik is located is digiKam repository, not digikam-software-compilation. To update this code you need a recursive update. Use script in digikam-software-compilation named "gits", like this : ./gits pull ...or go to "core" subdir where digiKam repository is and do "git pull" Gilles Caulier thanks for the hint! I updated the sources and recompiled the package from scratch, but still exactly the same thing happens :-( Are you sure you have built Qt with DEBUG enabled? Otherwise the Q_ASSERT would do nothing and you would not notice that something goes wrong! (and of course you could not reproduce this) (core is now on 33d1e60c7089f5bcb862a8110cc01c82d009d42c) I just recompiled digiKam at this revision, and no crash for me in same startup conditions. I don't know if my Qt is compiled with DEBUG flag (standard packages installed from the system). Do you mean with debug symbols ? Giles Caulier No, debug symbols (as you get per -g in the CFLAGS) are necessary for a usable backtrace but not sufficient. You need to get theQt5 libs compiled "QT_DEBUG" defined and "QT_NO_DEBUG" _not_ defined, the same way you do when you want a KDE application to evaluate Q_ASSERT checks. See /usr/include/qt5/QtCore/qglobal.h ~line 665, where Q_ASSERT is handled. Normally Qt packages from distributions are compiled without QT_DEBUG and thus silently ignore such kinds of error situations. Maybe you have more luck by using a "developer build" of Qt and force digikam to use it by setting LD_LIBRARY_PATH into it. (see http://doc.qt.io/qt-5/configure-options.html and use the option "-developer-build" as suggested) I have the code of AbstractAlbumModel::slotAlbumAboutToBeAdded(...) debugged and found nothing. Can you digiKam with valgrind testing and post the output? Maik sorry, that is not possible. Valgrind is broken and unusable too, crashes quite early due to this bug: https://bugs.kde.org/show_bug.cgi?id=323431 Did you use AMD based CPU on your computer ? Gilles Caulier Yes, otherwise valgrind wouldn't complain. Anyway, I don't think valgrind could help finding this... I now recompiled Qt with CXXFLAGS="-O0 -g -DQT_DEBUG" and got some better backtrace: ASSERT failure in QVector<T>::at: "index out of range", file ../../include/QtCore/../../src/corelib/tools/qvector.h, line 393 Program received signal SIGABRT, Aborted. 0x000000379dc32cd7 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55 55 ../sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden. (gdb) back #0 0x000000379dc32cd7 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55 #1 0x000000379dc34099 in __GI_abort () at abort.c:89 #2 0x00007ffff407ae51 in qt_message_fatal (context=..., message=...) at global/qlogging.cpp:1578 #3 0x00007ffff407734c in QMessageLogger::fatal (this=0x7fffffffc740, msg=0x7ffff438e550 "ASSERT failure in %s: \"%s\", file %s, line %d") at global/qlogging.cpp:781 #4 0x00007ffff4070a38 in qt_assert_x (where=0x7ffff43d6e52 "QVector<T>::at", what=0x7ffff43d6e3f "index out of range", file=0x7ffff43d6e08 "../../include/QtCore/../../src/corelib/tools/qvector.h", line=393) at global/qglobal.cpp:2974 #5 0x00007ffff414d8c9 in QVector<int>::at (this=0x1391270, i=0) at ../../include/QtCore/../../src/corelib/tools/qvector.h:393 #6 0x00007ffff427921a in QSortFilterProxyModelPrivate::can_create_mapping (this=0x13912f0, source_parent=...) at itemmodels/qsortfilterproxymodel.cpp:416 #7 0x00007ffff427d001 in QSortFilterProxyModelPrivate::_q_sourceRowsAboutToBeInserted (this=0x13912f0, source_parent=..., start=0, end=0) at itemmodels/qsortfilterproxymodel.cpp:1374 #8 0x00007ffff4281555 in QSortFilterProxyModel::qt_static_metacall (_o=0x1391210, _c=QMetaObject::InvokeMetaMethod, _id=11, _a=0x7fffffffca20) at .moc/moc_qsortfilterproxymodel.cpp:208 #9 0x00007ffff42f0b02 in QMetaObject::activate (sender=0x1390690, signalOffset=3, local_signal_index=9, argv=0x7fffffffca20) at kernel/qobject.cpp:3713 #10 0x00007ffff42f02f0 in QMetaObject::activate (sender=0x1390690, m=0x7ffff45a4ec0 <QAbstractItemModel::staticMetaObject>, local_signal_index=9, argv=0x7fffffffca20) at kernel/qobject.cpp:3578 #11 0x00007ffff43873a7 in QAbstractItemModel::rowsAboutToBeInserted (this=0x1390690, _t1=..., _t2=0, _t3=0) at .moc/moc_qabstractitemmodel.cpp:576 #12 0x00007ffff4255569 in QAbstractItemModel::beginInsertRows (this=0x1390690, parent=..., first=0, last=0) at itemmodels/qabstractitemmodel.cpp:2602 #13 0x00007ffff795dc3c in Digikam::AbstractAlbumModel::slotAlbumAboutToBeAdded (this=0x1390690, album=0x21f7de0, parent=0x21f6410, prev=0x0) at /usr/src/packages/multimedia/digikam/core/libs/models/abstractalbummodel.cpp:438 #14 0x00007ffff7969fef in Digikam::AbstractAlbumModel::qt_static_metacall (_o=0x1390690, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fffffffccf0) at /usr/src/packages/multimedia/digikam/build/core/libs/models/moc_abstractalbummodel.cpp:106 #15 0x00007ffff42f0b02 in QMetaObject::activate (sender=0x7ffff7ff8b50 <_ZZN7Digikam12_GLOBAL__N_113Q_QGS_creator13innerFunctionEvE6holder>, signalOffset=3, local_signal_index=0, argv=0x7fffffffccf0) at kernel/qobject.cpp:3713 ---Type <return> to continue, or q <return> to quit--- #16 0x00007ffff42f02f0 in QMetaObject::activate (sender=0x7ffff7ff8b50 <_ZZN7Digikam12_GLOBAL__N_113Q_QGS_creator13innerFunctionEvE6holder>, m=0x7ffff7fc6460 <Digikam::AlbumManager::staticMetaObject>, local_signal_index=0, argv=0x7fffffffccf0) at kernel/qobject.cpp:3578 #17 0x00007ffff79b2835 in Digikam::AlbumManager::signalAlbumAboutToBeAdded ( this=0x7ffff7ff8b50 <_ZZN7Digikam12_GLOBAL__N_113Q_QGS_creator13innerFunctionEvE6holder>, _t1=0x21f7de0, _t2=0x21f6410, _t3=0x0) at /usr/src/packages/multimedia/digikam/build/core/libs/album/moc_albummanager.cpp:502 #18 0x00007ffff79a311b in Digikam::AlbumManager::insertPAlbum ( this=0x7ffff7ff8b50 <_ZZN7Digikam12_GLOBAL__N_113Q_QGS_creator13innerFunctionEvE6holder>, album=0x21f7de0, parent=0x21f6410) at /usr/src/packages/multimedia/digikam/core/libs/album/albummanager.cpp:2899 #19 0x00007ffff799c110 in Digikam::AlbumManager::addAlbumRoot ( this=0x7ffff7ff8b50 <_ZZN7Digikam12_GLOBAL__N_113Q_QGS_creator13innerFunctionEvE6holder>, location=...) at /usr/src/packages/multimedia/digikam/core/libs/album/albummanager.cpp:1224 #20 0x00007ffff799bd44 in Digikam::AlbumManager::handleCollectionStatusChange ( this=0x7ffff7ff8b50 <_ZZN7Digikam12_GLOBAL__N_113Q_QGS_creator13innerFunctionEvE6holder>, location=..., oldStatus=0) at /usr/src/packages/multimedia/digikam/core/libs/album/albummanager.cpp:1179 #21 0x00007ffff799b7d9 in Digikam::AlbumManager::startScan ( this=0x7ffff7ff8b50 <_ZZN7Digikam12_GLOBAL__N_113Q_QGS_creator13innerFunctionEvE6holder>) at /usr/src/packages/multimedia/digikam/core/libs/album/albummanager.cpp:1061 #22 0x00007ffff77a8a9a in Digikam::DigikamApp::DigikamApp (this=0x9193b0, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/packages/multimedia/digikam/core/app/main/digikamapp.cpp:251 #23 0x000000000040f829 in main (argc=1, argv=0x7fffffffd838) at /usr/src/packages/multimedia/digikam/core/app/main/main.cpp:197 (gdb) frame 5 #5 0x00007ffff414d8c9 in QVector<int>::at (this=0x1391270, i=0) at ../../include/QtCore/../../src/corelib/tools/qvector.h:393 393 { Q_ASSERT_X(i >= 0 && i < d->size, "QVector<T>::at", "index out of range"); (gdb) print i $1 = 0 (gdb) print d->size $2 = 0 (gdb) frame 6 #6 0x00007ffff427921a in QSortFilterProxyModelPrivate::can_create_mapping (this=0x13912f0, source_parent=...) at itemmodels/qsortfilterproxymodel.cpp:416 416 if (gm->proxy_rows.at(source_parent.row()) == -1 || (gdb) list 411 if (it == source_index_mapping.constEnd()) { 412 // Don't care, since we don't have mapping for the grand parent 413 return false; 414 } 415 Mapping *gm = it.value(); 416 if (gm->proxy_rows.at(source_parent.row()) == -1 || 417 gm->proxy_columns.at(source_parent.column()) == -1) { 418 // Don't care, since parent is filtered 419 return false; 420 } (gdb) print gm $3 = (QSortFilterProxyModelPrivate::Mapping *) 0x1391260 (gdb) print gm->proxy_rows $4 = {d = 0x7ffff4391c80 <QArrayData::shared_null>} (gdb) print source_parent $5 = (const QModelIndex &) @0x7fffffffcb00: {r = 0, c = 0, i = 35611664, m = 0x1390690} (gdb) print *gm $8 = {source_rows = {d = 0x7ffff4391d78 <qt_array+24>}, source_columns = {d = 0x1393370}, proxy_rows = { d = 0x7ffff4391c80 <QArrayData::shared_null>}, proxy_columns = {d = 0x1393b10}, mapped_children = { d = 0x7ffff4391c80 <QArrayData::shared_null>}, map_iter = {i = 0x1391ff0}} maybe that is a bit more helpful... Qt said that QVector are used out on index. This is an internal use, not from digiKam. The Digikam::AbstractAlbumModel::slotAlbumAboutToBeAdded is called with these arguments (this=0x1390690, album=0x21f7de0, parent=0x21f6410, prev=0x0) prev = 0 wnat mean that a parent album must be registered in model. Code relevant from digiKam is here : https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/models/abstractalbummodel.cpp#L422 This call Qt like this QAbstractItemModel::beginInsertRows (this=0x1390690, parent=..., first=0, last=0) ...and it crash. Note that first and last are null, which is fine with Qt API : http://doc.qt.io/qt-5/qabstractitemmodel.html#beginInsertRows Gilles Caulier Created attachment 96548 [details]
albummanager.patch
Can you try this patch in the "core" subdirectory?
patch -p0 < albummanager.patch
Maik
Created attachment 96562 [details]
albummanager2.patch
A trash for each root album working again.
Maik
Thanks for the patch! It does not show any of my albums and I cannot see any picture anywhere, so the application is pretty useless at the moment, but at least it starts and no longer crashes! :-) The "Album" tree view (or whatever that widget on the left side is), is nearly empty, it contains only the string "Albums" with something that looks like a generic "image" icon at the left. Nothing else, nothing to expand or collapse... Another odd thing: it seems that the settings have not been properly migrated, the strings to my albums were URL encoded or so, the edit fields showed strings like "%2Fhome%2Fuser%2FPictures". After I added my local collection manually again, I can see in the console debug output that it iterates over my complete collection and tries to do some face detection. But still nothing in the Albums list. BTW: Additionally face detection seems to have problems with special characters (unicode) in file names, it shows "file system" errors or file "format not recognized" error for these files, maybe something with file name encoding or conversion QFile-name <-> QUrl goes wrong (I also had these things in Kwave). short update: now, after waiting for a very very long time, it shows Albums and Images again! It seems that it had to do it's job about face recognition in background, without any visible hint for the user what is going on. It was just luck that I recognized this, because I started it from the console, normally I would have given up already, called the "useless" and killed it. Git commit e10a52aefc55d6e47e736910353a53546fd21fde by Maik Qualmann. Committed on 11/01/2016 at 19:29. Pushed by mqualmann into branch 'master'. insert trash album after root album, otherwise not exist the parent album FIXED-IN: 5.0.0 M +2 -1 NEWS M +9 -4 libs/album/albummanager.cpp http://commits.kde.org/digikam/e10a52aefc55d6e47e736910353a53546fd21fde To Thomas, from comment #19 : >BTW: Additionally face detection seems to have problems with special characters (unicode) in file >names, it shows "file system" errors or file "format not recognized" error for these files, maybe >something with file name encoding or conversion QFile-name <-> QUrl goes wrong (I also had >these things in Kwave). Can you open a new file in bugzilla about this problem with : 1/ The file name pattern to use to reproduce the problem 2/ The console backtrace while the problem appears. Note : KUrl to QUrl port was been a big mess and need huge regression tests. Typically, in the future, we will take a care to use less KDE API when Qt API do the job as well. It's typically a waste of time to port back from KDE to Qt and can introduce undesired dysfunctions in code. Porting KUrl to QUrl take me more than one month for only digiKam core , which is unacceptable for a project as digiKam... Gilles Caulier |
Created attachment 96472 [details] gdb backtrace I compiled digikam (today's latest source from git), but soon after showing the splash screen it crashes with an assertion in Qt. This also happens with a new dummy user account that did not use digikam-4 before and thus has no album, no database etc. git commit: bb7b7ef566a1b9606f35b237ddc4b3267299209f Gentoo Linux @ x86_64 gcc-4.8.5, qt-5.5.1 I started digikam with gdb and attached the backtrace.