Bug 392178 - Krita crashes when deleting palette
Summary: Krita crashes when deleting palette
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Resource Management (show other bugs)
Version: 4.0
Platform: Appimage Linux
: NOR crash
Target Milestone: ---
Assignee: Halla Rempt
URL:
Keywords:
: 392212 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-03-22 14:09 UTC by Livio Fania
Modified: 2018-05-03 09:39 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Livio Fania 2018-03-22 14:09:48 UTC
Krita crashes every time I click on the garbage bin icon to delete a color palette. I'm using the appimage of the 4.0 version released today in Ubuntu 17.10.
Comment 1 Halla Rempt 2018-03-22 14:41:17 UTC
I can confirm:

Thread 1 (Thread 0x7fe007ddd940 (LWP 4219)):
[KCrash Handler]
#6  0x00007fe004bb469e in QScopedPointer<KoColorSet::Private, QScopedPointerDeleter<KoColorSet::Private> >::operator->() const (this=0x20) at /usr/include/qt5/QtCore/qscopedpointer.h:118
#7  0x00007fe004bb469e in KoColorSet::nColors() (this=0x0) at /home/boud/dev/krita/libs/pigment/resources/KoColorSet.cpp:283
#8  0x00007fe0076c83da in KisPaletteModel::indexFromId(int) const (this=0xc2dae40, i=i@entry=-1) at /home/boud/dev/krita/libs/ui/KisPaletteModel.cpp:275
#9  0x00007fdfce4dde7e in PaletteDockerDock::setColorFromNameList(int) (this=0xc2c6aa0, index=-1) at /home/boud/dev/krita/plugins/dockers/palettedocker/palettedocker_dock.cpp:233
#10 0x00007fdfce4e3f4b in PaletteDockerDock::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0xc2c6aa0, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /home/boud/dev/b-krita/plugins/dockers/palettedocker/moc_palettedocker_dock.cpp:109
#11 0x00007fdffd2235ef in QMetaObject::activate(QObject*, int, int, void**) (sender=sender@entry=0xc2d2b40, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=5, argv=argv@entry=0x7ffc182c2250) at kernel/qobject.cpp:3766
#12 0x00007fdffd2241e7 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0xc2d2b40, m=m@entry=0x7fdffe7d7d60 <QComboBox::staticMetaObject>, local_signal_index=local_signal_index@entry=5, argv=argv@entry=0x7ffc182c2250) at kernel/qobject.cpp:3628
#13 0x00007fdffe21e2f1 in QComboBox::currentIndexChanged(int) (this=this@entry=0xc2d2b40, _t1=-1) at .moc/moc_qcombobox.cpp:503
#14 0x00007fdffe21ff21 in QComboBoxPrivate::_q_emitCurrentIndexChanged(QModelIndex const&) (this=this@entry=0xc2d2b90, index=...) at widgets/qcombobox.cpp:1374
#15 0x00007fdffe224568 in QComboBoxPrivate::_q_rowsRemoved(QModelIndex const&, int, int) (this=0xc2d2b90, parent=...) at widgets/qcombobox.cpp:1136
#16 0x00007fdffe226fd9 in QComboBox::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=0x7ffc182c24c0) at .moc/moc_qcombobox.cpp:294
#17 0x00007fdffd2235ef in QMetaObject::activate(QObject*, int, int, void**) (sender=sender@entry=0xc2d2ed0, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=12, argv=argv@entry=0x7ffc182c24c0) at kernel/qobject.cpp:3766
#18 0x00007fdffd2241e7 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0xc2d2ed0, m=m@entry=0x7fdffd652920 <QAbstractItemModel::staticMetaObject>, local_signal_index=local_signal_index@entry=12, argv=argv@entry=0x7ffc182c24c0) at kernel/qobject.cpp:3628
#19 0x00007fdffd1a2dfe in QAbstractItemModel::rowsRemoved(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) (this=this@entry=0xc2d2ed0, _t1=..., _t2=0, _t3=767, _t4=_t4@entry=...) at .moc/moc_qabstractitemmodel.cpp:616
#20 0x00007fdffd1aa3aa in QAbstractItemModel::endRemoveRows() (this=0xc2d2ed0) at itemmodels/qabstractitemmodel.cpp:2763
#21 0x00007fdffdaabe47 in QStandardItemModelPrivate::rowsRemoved(QStandardItem*, int, int) (this=<optimized out>, parent=parent@entry=0xc2d2fc0, row=row@entry=0, count=count@entry=768) at itemmodels/qstandarditemmodel.cpp:589
#22 0x00007fdffdaac069 in QStandardItem::removeRows(int, int) (this=this@entry=0xc2d2fc0, row=row@entry=0, count=count@entry=768) at itemmodels/qstandarditemmodel.cpp:1687
#23 0x00007fdffdaac154 in QStandardItemModel::removeRows(int, int, QModelIndex const&) (this=<optimized out>, row=row@entry=0, count=768, parent=...) at itemmodels/qstandarditemmodel.cpp:2867
#24 0x00007fdffe2219f6 in QComboBox::clear() (this=0xc2d2b40) at widgets/qcombobox.cpp:2929
#25 0x00007fdfce4de134 in PaletteDockerDock::setColorSet(KoColorSet*) (this=0xc2c6aa0, colorSet=0x0) at /home/boud/dev/krita/plugins/dockers/palettedocker/palettedocker_dock.cpp:180
#26 0x00007fe0076d19cc in KoResourceServer<KoColorSet, PointerStoragePolicy<KoColorSet> >::notifyRemovingResource(KoColorSet*) (resource=0x2d91f90, this=0x3654810) at /home/boud/dev/krita/libs/widgets/KoResourceServer.h:611
#27 0x00007fe0076d19cc in KoResourceServer<KoColorSet, PointerStoragePolicy<KoColorSet> >::removeResourceAndBlacklist(KoColorSet*) (resource=0x2d91f90, this=0x3654810) at /home/boud/dev/krita/libs/widgets/KoResourceServer.h:336
#28 0x00007fe0076d19cc in KoResourceServerAdapter<KoColorSet, PointerStoragePolicy<KoColorSet> >::removeResource(KoResource*) (this=<optimized out>, resource=<optimized out>) at /home/boud/dev/krita/libs/widgets/KoResourceServerAdapter.h:179
#29 0x00007fe0057cc9bf in KoResourceItemChooser::slotButtonClicked(int) (this=0xc2e3690, button=<optimized out>) at /home/boud/dev/krita/libs/widgets/KoResourceItemChooser.cpp:221
#30 0x00007fdffd2235ef in QMetaObject::activate(QObject*, int, int, void**) (sender=0xc2f2e50, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffc182c2ac0) at kernel/qobject.cpp:3766
#31 0x00007fdffd2241e7 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=<optimized out>, m=m@entry=0x7fdffe7d5b80 <QButtonGroup::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffc182c2ac0) at kernel/qobject.cpp:3628
#32 0x00007fdffe211bf1 in QButtonGroup::buttonClicked(int) (this=<optimized out>, _t1=1) at .moc/moc_qbuttongroup.cpp:250
#33 0x00007fdffe20d9cc in QAbstractButtonPrivate::emitClicked() (this=0xc2f3b10) at widgets/qabstractbutton.cpp:417
#34 0x00007fdffe20ee93 in QAbstractButtonPrivate::click() (this=0xc2f3b10) at widgets/qabstractbutton.cpp:407
#35 0x00007fdffe20f005 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) (this=0xc2f3ad0, e=0x7ffc182c3010) at widgets/qabstractbutton.cpp:1011
#36 0x00007fdffe159657 in QWidget::event(QEvent*) (this=0xc2f3ad0, event=0x7ffc182c3010) at kernel/qwidget.cpp:8817
#37 0x00007fdffe11d7fc in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0xc2f3ad0, e=0x7ffc182c3010) at kernel/qapplication.cpp:3733
#38 0x00007fdffe124c7c in QApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=receiver@entry=0xc2f3ad0, e=e@entry=0x7ffc182c3010) at kernel/qapplication.cpp:3209
#39 0x00007fe00762fa67 in KisApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=0xc2f3ad0, event=0x7ffc182c3010) at /home/boud/dev/krita/libs/ui/KisApplication.cpp:620
#40 0x00007fdffd1f9325 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=receiver@entry=0xc2f3ad0, event=event@entry=0x7ffc182c3010) at kernel/qcoreapplication.cpp:1044
#41 0x00007fdffe123af9 in QCoreApplication::sendEvent(QObject*, QEvent*) (event=<optimized out>, receiver=<optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:234
#42 0x00007fdffe123af9 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) (receiver=receiver@entry=0xc2f3ad0, event=event@entry=0x7ffc182c3010, alienWidget=alienWidget@entry=0xc2f3ad0, nativeWidget=0xc305ce0, buttonDown=buttonDown@entry=0x7fdffe801860 <qt_button_down>, lastMouseReceiver=..., spontaneous=spontaneous@entry=true) at kernel/qapplication.cpp:2712
#43 0x00007fdffe171884 in QWidgetWindow::handleMouseEvent(QMouseEvent*) (this=this@entry=0xc5cc480, event=event@entry=0x7ffc182c34d0) at kernel/qwidgetwindow.cpp:548
#44 0x00007fdffe174063 in QWidgetWindow::event(QEvent*) (this=0xc5cc480, event=0x7ffc182c34d0) at kernel/qwidgetwindow.cpp:273
#45 0x00007fdffe11d7fc in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0xc5cc480, e=0x7ffc182c34d0) at kernel/qapplication.cpp:3733
#46 0x00007fdffe1245e0 in QApplication::notify(QObject*, QEvent*) (this=0x7ffc182c3bf0, receiver=receiver@entry=0xc5cc480, e=e@entry=0x7ffc182c34d0) at kernel/qapplication.cpp:3492
#47 0x00007fe00762fa67 in KisApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=0xc5cc480, event=0x7ffc182c34d0) at /home/boud/dev/krita/libs/ui/KisApplication.cpp:620
#48 0x00007fdffd1f9325 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=receiver@entry=0xc5cc480, event=event@entry=0x7ffc182c34d0) at kernel/qcoreapplication.cpp:1044
#49 0x00007fdffd76eb0d in QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*) (event=0x7ffc182c34d0, receiver=0xc5cc480) at ../../src/corelib/kernel/qcoreapplication.h:237
#50 0x00007fdffd76eb0d in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) (e=0xc60a710) at kernel/qguiapplication.cpp:1957
#51 0x00007fdffd7706c5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) (e=e@entry=0xc60a710) at kernel/qguiapplication.cpp:1741
#52 0x00007fdffd74e71b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (flags=...) at kernel/qwindowsysteminterface.cpp:976
#53 0x00007fdff13dc47b in QPAEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x2365780, flags=...) at qeventdispatcher_glib.cpp:70
#54 0x00007fdffd1f7a4b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffc182c3710, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#55 0x00007fdffd200104 in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1332
#56 0x00007fdffd766e5c in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1687
#57 0x00007fdffe11d755 in QApplication::exec() () at kernel/qapplication.cpp:2918
#58 0x0000000000405745 in main(int, char**) (argc=1, argv=<optimized out>) at /home/boud/dev/krita/krita/main.cc:361
Comment 2 Halla Rempt 2018-03-28 14:09:40 UTC
*** Bug 392212 has been marked as a duplicate of this bug. ***
Comment 3 Halla Rempt 2018-04-03 09:15:19 UTC
Git commit fa38e733feeb3d156e9bb32a9dfe59c9332e9028 by Boudewijn Rempt.
Committed on 03/04/2018 at 09:03.
Pushed by rempt into branch 'master'.

Check pointer before dereferencing

M  +8    -6    libs/ui/KisPaletteModel.cpp

https://commits.kde.org/krita/fa38e733feeb3d156e9bb32a9dfe59c9332e9028
Comment 4 Halla Rempt 2018-04-03 11:47:23 UTC
Git commit 1530629b303a0073be323163454be299f4b64eb0 by Boudewijn Rempt.
Committed on 03/04/2018 at 11:21.
Pushed by rempt into branch 'krita/4.0'.

Check pointer before dereferencing
(cherry picked from commit fa38e733feeb3d156e9bb32a9dfe59c9332e9028)

M  +8    -6    libs/ui/KisPaletteModel.cpp

https://commits.kde.org/krita/1530629b303a0073be323163454be299f4b64eb0