digiKam 4.0.0-beta1 crashes when opening settings. Reproducible: Always Actual Results: Program received signal SIGSEGV, Segmentation fault. QFont::QFont (this=0xbf800044) at text/qfont.cpp:791 791 : d(QApplication::font().d.data()), resolve_mask(0) (gdb) bt #0 QFont::QFont (this=0xbf800044) at text/qfont.cpp:791 #1 0xb4bedffa in QStyleOption::QStyleOption (this=this@entry=0xbf80016c, version=version@entry=4, type=type@entry=12) at styles/qstyleoption.cpp:163 #2 0xb4bf055e in QStyleOptionViewItem::QStyleOptionViewItem (this=this@entry=0xbf80016c, version=version@entry=4) at styles/qstyleoption.cpp:4440 #3 0xb4bf05e5 in QStyleOptionViewItemV2::QStyleOptionViewItemV2 (this=this@entry=0xbf80016c, version=version@entry=4) at styles/qstyleoption.cpp:874 #4 0xb4bf0686 in QStyleOptionViewItemV3::QStyleOptionViewItemV3 (this=this@entry=0xbf80016c, version=version@entry=4) at styles/qstyleoption.cpp:992 #5 0xb4bf06e7 in QStyleOptionViewItemV4::QStyleOptionViewItemV4 (this=0xbf80016c) at styles/qstyleoption.cpp:1103 #6 0xb542721e in optionView (this=0xb5dfce8, index=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:166 #7 KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:187 #8 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #9 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #10 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #11 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #12 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #13 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #14 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #15 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #16 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #17 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #18 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #19 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #20 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #21 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #22 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) ---Type <return> to continue, or q <return> to quit--- at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #23 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #24 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #25 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #26 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #27 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #28 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #29 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #30 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #31 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #32 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #33 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #34 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #35 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #36 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #37 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #38 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #39 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #40 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #41 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #42 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #43 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 ---Type <return> to continue, or q <return> to quit--- #44 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #45 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #46 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #47 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #48 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #49 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #50 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #51 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #52 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #53 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #54 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #55 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #56 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #57 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #58 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #59 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #60 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #61 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #62 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #63 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #64 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) at /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:194 #65 0xb54273f0 in KWidgetItemDelegatePrivate::initializeModel (this=this@entry=0xb5dfce8, parent=...) ---Type <return> to continue, or q <return> to quit---q at /usr/src/debug/kdeliQuit (gdb) q
Sound like a problem with widget style. It crash in Qt (QFont class)... It's not a digiKam problem. Perhaps a binary compatibility issue on your computer due to recent update. Check your system...
(In reply to comment #1) > It's not a digiKam problem. Perhaps a binary compatibility issue on your > computer due to recent update. > > Check your system... This is impossible, all components have exact version dependencies on qt and kde libs. All libs used at build time are actually installed.
[17:11:14] <@Kevin_Kofler> nucleo: Infinite recursion… I think the model for that tree view is wrong. [17:11:43] <@Kevin_Kofler> nucleo: I don't know where it comes from, if it's a stock model (like KDirItemModel or how it's called) or something from Digikam.
yes, but here it do not crash. Some it's not a the real problem. Check your Qt/KDE widget style... Gilles Caulier
Maybe this problem specific to KDE 4.11.97? I downgraded digiKam to 3.5.0 that also built against 4.11.97 and it also crashes.
Yes, probably KDELibs bugs : /usr/src/debug/kdelibs-4.11.97/kdeui/itemviews/kwidgetitemdelegate.cpp:166 Gilles Caulier
Then reassign bug to kdelibs?
Re-assigned to kdelibs
The problem is caused by KWidgetItemDelegatePrivate::initializeModel(const QModelIndex &parent) calling itself again when the model returns ok for hasChildren. if (index.isValid() && model->hasChildren(index)) { initializeModel(index); } In this case Digikam::SetupCollectionModel doesn't reimplement hasChildren, it will fall back to call this: bool QAbstractItemModel::hasChildren(const QModelIndex &parent) const { return (rowCount(parent) > 0) && (columnCount(parent) > 0); } And while parent.row() == 0 and it's checking against Item::parentId, which most likely is zero for your collection and then the same thing again.
I would say that this sounds more like a bug in digikam's model than in kdelibs. Or should initializeModel() check that the index is not completely the same before calling itself again? Here's some printf-debugging output I was using: digikam(6267)/digikam (core) Digikam::SetupCollectionModel::rowCount: QModelIndex(0,0,0xffffffffffffffff,Digikam::SetupCollectionModel(0x51f2540) ) digikam(6267)/digikam (core) Digikam::SetupCollectionModel::rowCount: internalId: -1 digikam(6267)/digikam (core) Digikam::SetupCollectionModel::rowCount: parentId: 0 digikam(6267)/digikam (core) Digikam::SetupCollectionModel::rowCount: QModelIndex(0,0,0xffffffffffffffff,Digikam::SetupCollectionModel(0x51f2540) ) digikam(6267)/digikam (core) Digikam::SetupCollectionModel::rowCount: internalId: -1 digikam(6267)/digikam (core) Digikam::SetupCollectionModel::rowCount: parentId: 0 digikam(6267)/digikam (core) Digikam::SetupCollectionModel::rowCount: QModelIndex(0,0,0xffffffffffffffff,Digikam::SetupCollectionModel(0x51f2540) ) digikam(6267)/digikam (core) Digikam::SetupCollectionModel::rowCount: internalId: -1 digikam(6267)/digikam (core) Digikam::SetupCollectionModel::rowCount: parentId: 0 parentId is just index.row() here. And in my collection (due to because it's a local one) the parentId inside of Item is set to 0. foreach(const Item& item, m_collections) { if (!item.deleted && item.parentId == parentId) { ++rowCount; } }
As requested on IRC by teprrr, I can confirm this bug with digikam 3.5.0 and kdelibs 4.11.97. http://pastebin.kde.org/pkrglow9p This segfault/crash does NOT happen on a system with the same distro, same Qt4, gcc, and digikam, only that system runs 4.11.4. Digikam build for that version (just to be clear, digikam was rebuild for 4.11 beta1).
Issue is fixed here with kdelibs 4.12.0 build.
Thanks for your feedback Gilles Caulier
*** Bug 328835 has been marked as a duplicate of this bug. ***
I confirm that no crash with kdelibs-4.12.0.