Bug 382542

Summary: Gwenview crashes on start (with any pic) with Qt assert enabled
Product: [Applications] gwenview Reporter: Bernd Buschinski <b.buschinski>
Component: generalAssignee: Gwenview Bugs <gwenview-bugs-null>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: 17.04.3   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 17.08.0
Sentry Crash Report:

Description Bernd Buschinski 2017-07-20 14:57:07 UTC
Gwenview crashes on start (with any picture) with Qt assert enabled.

Starting program: /usr/bin/gwenview example.png
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Qt: gdb: -nograb added to command-line options.
         Use the -dograb option to enforce grabbing.                                                                                                          
[New Thread 0x7fffe5f20700 (LWP 28039)]                                                                                                                       
[New Thread 0x7fffdffff700 (LWP 28572)]                                                                                                                       
[New Thread 0x7fffdcc57700 (LWP 28813)]                                                                                                                       
ASSERT: "last >= first" in file itemmodels/qabstractitemmodel.cpp, line 2641                                                                                  
                                                                                                                                                              
Thread 1 "gwenview" received signal SIGABRT, Aborted.                                                                                                         
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58                                                                                         
58      ../sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden.                                                                            
(gdb) bt                                                                                                                                                      
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58                                                                                     
#1  0x00007ffff5e46d39 in __GI_abort () at abort.c:89                                                                                                         
#2  0x00007ffff6449476 in qt_message_fatal (context=..., message=<synthetic pointer>...) at global/qlogging.cpp:1682
#3  QMessageLogger::fatal (this=this@entry=0x7fffffffbc80, msg=msg@entry=0x7ffff66a0af0 "ASSERT: \"%s\" in file %s, line %d") at global/qlogging.cpp:793
#4  0x00007ffff644277c in qt_assert (assertion=assertion@entry=0x7ffff66acd2f "last >= first", 
    file=file@entry=0x7ffff66a4dc0 "itemmodels/qabstractitemmodel.cpp", line=line@entry=2641) at global/qglobal.cpp:3081
#5  0x00007ffff65b1796 in QAbstractItemModel::beginInsertRows (this=this@entry=0xc0b210, parent=..., first=first@entry=0, last=last@entry=-1)
    at itemmodels/qabstractitemmodel.cpp:2641
#6  0x00007ffff7d52a9b in Gwenview::PlaceTreeModel::slotPlacesRowsInserted (this=this@entry=0xc0b210, start=start@entry=0, end=-1)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/lib/placetreemodel.cpp:299
#7  0x00007ffff7d52ffd in Gwenview::PlaceTreeModel::PlaceTreeModel (this=0xc0b210, parent=<optimized out>)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/lib/placetreemodel.cpp:160
#8  0x000000000043e18b in Gwenview::FolderViewContextManagerItem::setupModel (this=this@entry=0x670da0)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/app/folderviewcontextmanageritem.cpp:179
#9  0x000000000043f068 in Gwenview::FolderViewContextManagerItem::expandToSelectedUrl (this=this@entry=0x670da0)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/app/folderviewcontextmanageritem.cpp:131
#10 0x000000000043f0b8 in Gwenview::FolderViewContextManagerItem::slotCurrentDirUrlChanged (this=0x670da0, url=...)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/app/folderviewcontextmanageritem.cpp:121
#11 0x00000000004773e1 in Gwenview::FolderViewContextManagerItem::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, 
    _a=<optimized out>)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3_build/app/gwenview_autogen/EWIEGA46WW/moc_folderviewcontextmanageritem.cpp:92
#12 0x00007ffff662981e in QMetaObject::activate (sender=0x549980, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, 
    argv=argv@entry=0x7fffffffc150) at kernel/qobject.cpp:3740
#13 0x00007ffff6629fff in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7ffff7dd2e80 <Gwenview::ContextManager::staticMetaObject>, 
    local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffffffc150) at kernel/qobject.cpp:3602
#14 0x00007ffff7d8b5a2 in Gwenview::ContextManager::currentDirUrlChanged (this=<optimized out>, _t1=...)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3_build/lib/gwenviewlib_autogen/EWIEGA46WW/moc_contextmanager.cpp:206
#15 0x00007ffff7cfb9f5 in Gwenview::ContextManager::setCurrentDirUrl (this=<optimized out>, url=...)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/lib/contextmanager.cpp:169
#16 0x000000000044e76f in Gwenview::MainWindow::slotPartCompleted (this=0x577730)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/app/mainwindow.cpp:1124
#17 0x0000000000477cdd in Gwenview::MainWindow::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3_build/app/gwenview_autogen/EWIEGA46WW/moc_mainwindow.cpp:231
#18 0x00007ffff662981e in QMetaObject::activate (sender=0x69c750, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>)
    at kernel/qobject.cpp:3740
#19 0x00007ffff6629af2 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffc3d0, r=0x69c750, this=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:101
#20 QMetaObject::activate (sender=sender@entry=0x957890, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0)
    at kernel/qobject.cpp:3723
#21 0x00007ffff6629fff in QMetaObject::activate (sender=sender@entry=0x957890, m=m@entry=0x7ffff7dd2a00 <Gwenview::DocumentView::staticMetaObject>, 
    local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3602
#22 0x00007ffff7d8c518 in Gwenview::DocumentView::completed (this=this@entry=0x957890)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3_build/lib/gwenviewlib_autogen/7BXZGBJBAL/moc_documentview.cpp:495
#23 0x00007ffff7d2089f in Gwenview::DocumentView::slotCompleted (this=0x957890)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/lib/documentview/documentview.cpp:445
#24 0x00007ffff7d90255 in Gwenview::DocumentView::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3_build/lib/gwenviewlib_autogen/7BXZGBJBAL/moc_documentview.cpp:234
#25 0x00007ffff662981e in QMetaObject::activate (sender=0x977020, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>)
    at kernel/qobject.cpp:3740
#26 0x00007ffff6629af2 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffc710, r=0x977020, this=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:101
---Type <return> to continue, or q <return> to quit---
#27 QMetaObject::activate (sender=sender@entry=0xc1f720, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=5, argv=argv@entry=0x0)
    at kernel/qobject.cpp:3723
#28 0x00007ffff6629fff in QMetaObject::activate (sender=sender@entry=0xc1f720, m=m@entry=0x7ffff7dd2ac0 <Gwenview::AbstractImageView::staticMetaObject>, 
    local_signal_index=local_signal_index@entry=5, argv=argv@entry=0x0) at kernel/qobject.cpp:3602
#29 0x00007ffff7d8c4bb in Gwenview::AbstractImageView::completed (this=this@entry=0xc1f720)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3_build/lib/gwenviewlib_autogen/7BXZGBJBAL/moc_abstractimageview.cpp:260
#30 0x00007ffff7d27086 in Gwenview::RasterImageView::updateFromScaler (this=0xc1f720, zoomedImageLeft=<optimized out>, zoomedImageTop=<optimized out>, image=
    ...) at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/lib/documentview/rasterimageview.cpp:344
#31 0x00007ffff6629af2 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffc9b0, r=0xc1f720, this=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:101
#32 QMetaObject::activate (sender=sender@entry=0xa600f0, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, 
    argv=argv@entry=0x7fffffffc9b0) at kernel/qobject.cpp:3723
#33 0x00007ffff6629fff in QMetaObject::activate (sender=sender@entry=0xa600f0, m=m@entry=0x7ffff7dd24c0 <Gwenview::ImageScaler::staticMetaObject>, 
    local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffffffc9b0) at kernel/qobject.cpp:3602
#34 0x00007ffff7d8cb71 in Gwenview::ImageScaler::scaledRect (this=this@entry=0xa600f0, _t1=<optimized out>, _t2=<optimized out>, _t3=...)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3_build/lib/gwenviewlib_autogen/EWIEGA46WW/moc_imagescaler.cpp:137
#35 0x00007ffff7d4a048 in Gwenview::ImageScaler::scaleRect (this=this@entry=0xa600f0, rect=...)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/lib/imagescaler.cpp:132
#36 0x00007ffff7d4a6c7 in Gwenview::ImageScaler::doScale (this=0xa600f0)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/lib/imagescaler.cpp:122
#37 0x00007ffff7d4a89d in Gwenview::ImageScaler::setDestinationRegion (this=<optimized out>, region=...)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/lib/imagescaler.cpp:102
#38 0x00007ffff7d25454 in Gwenview::RasterImageViewPrivate::setScalerRegionToVisibleRect (this=0xa79010)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/lib/documentview/rasterimageview.cpp:151
#39 Gwenview::RasterImageView::updateImageRect (this=0xc1f720, imageRect=...)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/lib/documentview/rasterimageview.cpp:305
#40 0x00007ffff7d8e7d1 in Gwenview::RasterImageView::qt_static_metacall (_o=0xc1f720, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3_build/lib/gwenviewlib_autogen/7BXZGBJBAL/moc_rasterimageview.cpp:108
#41 0x00007ffff662981e in QMetaObject::activate (sender=0x972f00, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=1, 
    argv=argv@entry=0x7fffffffcd90) at kernel/qobject.cpp:3740
#42 0x00007ffff6629fff in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7ffff7dd2d00 <Gwenview::Document::staticMetaObject>, 
    local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fffffffcd90) at kernel/qobject.cpp:3602
#43 0x00007ffff7d8bbf5 in Gwenview::Document::imageRectUpdated (this=<optimized out>, _t1=...)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3_build/lib/gwenviewlib_autogen/DV7UALDUNI/moc_document.cpp:294
#44 0x00007ffff662981e in QMetaObject::activate (sender=sender@entry=0x97b740, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, 
    argv=argv@entry=0x7fffffffced0) at kernel/qobject.cpp:3740
#45 0x00007ffff6629fff in QMetaObject::activate (sender=sender@entry=0x97b740, m=m@entry=0x7ffff7dd2d40 <Gwenview::AbstractDocumentImpl::staticMetaObject>, 
    local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffffffced0) at kernel/qobject.cpp:3602
#46 0x00007ffff7d8b922 in Gwenview::AbstractDocumentImpl::imageRectUpdated (this=this@entry=0x97b740, _t1=...)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3_build/lib/gwenviewlib_autogen/DV7UALDUNI/moc_abstractdocumentimpl.cpp:184
#47 0x00007ffff7d119db in Gwenview::DocumentLoadedImpl::init (this=0x97b740)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/lib/document/documentloadedimpl.cpp:66
#48 0x00007ffff7d06355 in Gwenview::Document::switchToImpl (this=0x972f00, impl=impl@entry=0x97b740)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/lib/document/document.cpp:254
#49 0x00007ffff7d0564c in Gwenview::AbstractDocumentImpl::switchToImpl (this=this@entry=0x976d80, impl=impl@entry=0x97b740)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/lib/document/abstractdocumentimpl.cpp:57
#50 0x00007ffff7d12aa8 in Gwenview::LoadingDocumentImpl::slotImageLoaded (this=0x976d80)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/lib/document/loadingdocumentimpl.cpp:551
#51 0x00007ffff662981e in QMetaObject::activate (sender=0x976f68, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>)
    at kernel/qobject.cpp:3740
#52 0x00007ffff6629fff in QMetaObject::activate (sender=<optimized out>, m=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>)
---Type <return> to continue, or q <return> to quit---
    at kernel/qobject.cpp:3602
#53 0x00007ffff6456670 in QFutureWatcherBase::event (this=<optimized out>, event=0x7fffd0003310) at thread/qfuturewatcher.cpp:335
#54 0x00007ffff70950f4 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x976f68, e=0x7fffd0003310) at kernel/qapplication.cpp:3799
#55 0x00007ffff709c65f in QApplication::notify (this=0x7fffffffd850, receiver=0x976f68, e=0x7fffd0003310) at kernel/qapplication.cpp:3159
#56 0x00007ffff65fe429 in QCoreApplication::notifyInternal2 (receiver=0x976f68, event=event@entry=0x7fffd0003310) at kernel/qcoreapplication.cpp:988
#57 0x00007ffff6600fb5 in QCoreApplication::sendEvent (event=0x7fffd0003310, receiver=<optimized out>) at kernel/qcoreapplication.h:231
#58 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x4d3fa0) at kernel/qcoreapplication.cpp:1649
#59 0x00007ffff6601508 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1503
#60 0x00007ffff66513b3 in postEventSourceDispatch (s=0x51d1e0) at kernel/qeventdispatcher_glib.cpp:276
#61 0x00007ffff347e50e in g_main_dispatch (context=0x7fffe00016f0) at /var/tmp/portage/dev-libs/glib-2.50.3-r1/work/glib-2.50.3/glib/gmain.c:3203
#62 g_main_context_dispatch (context=context@entry=0x7fffe00016f0) at /var/tmp/portage/dev-libs/glib-2.50.3-r1/work/glib-2.50.3/glib/gmain.c:3856
#63 0x00007ffff347e740 in g_main_context_iterate (context=context@entry=0x7fffe00016f0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.50.3-r1/work/glib-2.50.3/glib/gmain.c:3929
#64 0x00007ffff347e7e4 in g_main_context_iteration (context=0x7fffe00016f0, may_block=may_block@entry=1)
    at /var/tmp/portage/dev-libs/glib-2.50.3-r1/work/glib-2.50.3/glib/gmain.c:3990
#65 0x00007ffff6651427 in QEventDispatcherGlib::processEvents (this=0x528700, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#66 0x00007ffff65fccc2 in QEventLoop::exec (this=this@entry=0x7fffffffd720, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#67 0x00007ffff6605365 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1261
#68 0x00007ffff6b38bdc in QGuiApplication::exec () at kernel/qguiapplication.cpp:1633
#69 0x00007ffff7095045 in QApplication::exec () at kernel/qapplication.cpp:2975
#70 0x000000000042ae79 in main (argc=<optimized out>, argv=<optimized out>)
    at /var/tmp/portage/kde-apps/gwenview-17.04.3/work/gwenview-17.04.3/app/main.cpp:157
Comment 1 Christoph Feck 2017-07-20 15:09:08 UTC
Can you confirm that your places bookmarks are either empty, or you have hidden all of them for Gwenview? If unsure, attach the file.

~/.local/share/user-places.xbel
Comment 2 Christoph Feck 2017-07-20 15:16:07 UTC
Ignore comment #1. KFilePlacesModel is created without entries and initializes them delayed.
Comment 3 Christoph Feck 2017-07-20 15:28:00 UTC
Git commit 80a145c1b7096b56e5861f226679cf3748a17740 by Christoph Feck.
Committed on 20/07/2017 at 15:24.
Pushed by cfeck into branch 'Applications/17.08'.

Fix assert with Qt debug builds

KFilePlacesModel creates its items delayed.
Keep the bootstrapping in case this changes.
FIXED-IN: 17.08.0

M  +3    -1    lib/placetreemodel.cpp

https://commits.kde.org/gwenview/80a145c1b7096b56e5861f226679cf3748a17740