Bug 197700

Summary: Switching from crop tool crashes Krita
Product: [Applications] krita Reporter: Ed <schumifer>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: lukast.dev
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Ed 2009-06-24 08:18:52 UTC
Version:           2.1 Alpha (using 4.2.91 (KDE 4.2.91 (KDE 4.3 >= 20090609)) "release 1", KDE:KDE4:UNSTABLE:Desktop / openSUSE_11.1)
Compiler:          gcc
OS:                Linux (i686) release 2.6.27.23-0.1-default

Krita crashes when executing this sequence:

1. Select crop tool
2. Crop image
3. Switch to any other tool
Comment 1 LukasT 2009-08-22 17:52:02 UTC
Confirmed, here is backtrace. KDE bug?

Application: Krita (krita), signal: Segmentation fault
[KCrash Handler]
#6  0x010693d1 in memcpy () from /lib/libc.so.6
#7  0x031b7c21 in QString::realloc(int) () from /usr/lib/libQtCore.so.4
#8  0x031b7d46 in QString::realloc() () from /usr/lib/libQtCore.so.4
#9  0x022554f6 in ?? () from /usr/lib/libQtGui.so.4
#10 0x022566da in QPainter::drawText(QRect const&, int, QString const&, QRect*) () from /usr/lib/libQtGui.so.4
#11 0x023f8a7d in QStyle::drawItemText(QPainter*, QRect const&, int, QPalette const&, bool, QString const&, QPalette::ColorRole) const () from /usr/lib/libQtGui.so.4
#12 0x02b7ff0f in KStyle::drawItemText(QPainter*, QRect const&, int, QPalette const&, bool, QString const&, QPalette::ColorRole) const () from /usr/lib/libkdeui.so.5
#13 0x012a6433 in ?? () from /usr/lib/kde4/plugins/styles/oxygen.so
#14 0x024f7301 in QComboBox::paintEvent(QPaintEvent*) () from /usr/lib/libQtGui.so.4
#15 0x0217be2a in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#16 0x024f8bdc in QComboBox::event(QEvent*) () from /usr/lib/libQtGui.so.4
#17 0x021273b4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#18 0x0212ea3e in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#19 0x02b72a1a in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#20 0x0326258b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#21 0x02184155 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#22 0x0218497d in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#23 0x02184899 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#24 0x02184899 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#25 0x02184899 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#26 0x02184899 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#27 0x02184899 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#28 0x02184899 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#29 0x02184899 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#30 0x02184899 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#31 0x02184899 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#32 0x02183d46 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#33 0x0218497d in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#34 0x02184899 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#35 0x02183d46 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#36 0x0218497d in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#37 0x02184899 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#38 0x02183d46 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#39 0x02310a88 in ?? () from /usr/lib/libQtGui.so.4
#40 0x021754b6 in QWidgetPrivate::syncBackingStore() () from /usr/lib/libQtGui.so.4
#41 0x0217c604 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#42 0x02547857 in QMainWindow::event(QEvent*) () from /usr/lib/libQtGui.so.4
#43 0x02c57e14 in KMainWindow::event(QEvent*) () from /usr/lib/libkdeui.so.5
#44 0x02c9e67f in KXmlGuiWindow::event(QEvent*) () from /usr/lib/libkdeui.so.5
#45 0x021273b4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#46 0x0212ea3e in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#47 0x02b72a1a in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#48 0x0326258b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#49 0x032631a8 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#50 0x0326337d in QCoreApplication::sendPostedEvents(QObject*, int) () from /usr/lib/libQtCore.so.4
#51 0x0328d3ef in ?? () from /usr/lib/libQtCore.so.4
#52 0x01df6cf8 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#53 0x01dfa370 in ?? () from /lib/libglib-2.0.so.0
#54 0x01dfa4a3 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#55 0x0328d01c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#56 0x021c6445 in ?? () from /usr/lib/libQtGui.so.4
#57 0x03260b79 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#58 0x03260fca in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#59 0x0326343f in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#60 0x02127237 in QApplication::exec() () from /usr/lib/libQtGui.so.4
#61 0x00693779 in kdemain (argc=1, argv=0xbfc52f44) at /home/lukas/src/koffice/krita/main.cc:44
#62 0x08048959 in main (argc=1, argv=0xbfc52f44) at /home/lukas/src/build/koffice/krita/krita_dummy.cpp:3
Comment 2 LukasT 2009-08-22 17:59:22 UTC
Valgrind output

==7241==                                                                                                                                                                             
==7241== Invalid read of size 4                                                                                                                                                      
==7241==    at 0x48EA39B: KoCompositeOp::description() const (KoCompositeOp.cpp:99)                                                                                                  
==7241==    by 0x4107C12: KisCompositeOpsModel::data(QModelIndex const&, int) const (kis_composite_ops_model.cc:95)                                                                  
==7241==    by 0x26FBBC7: QSortFilterProxyModel::data(QModelIndex const&, int) const (in /usr/lib/libQtGui.so.4.5.2)                                                                 
==7241==    by 0x24F5428: (within /usr/lib/libQtGui.so.4.5.2)                                                                                                                        
==7241==    by 0x24F55BF: QComboBox::currentText() const (in /usr/lib/libQtGui.so.4.5.2)                                                                                             
==7241==    by 0x24F6E5C: QComboBox::initStyleOption(QStyleOptionComboBox*) const (in /usr/lib/libQtGui.so.4.5.2)                                                                    
==7241==    by 0x24F72BC: QComboBox::paintEvent(QPaintEvent*) (in /usr/lib/libQtGui.so.4.5.2)                                                                                        
==7241==    by 0x217BE29: QWidget::event(QEvent*) (in /usr/lib/libQtGui.so.4.5.2)                                                                                                    
==7241==    by 0x24F8BDB: QComboBox::event(QEvent*) (in /usr/lib/libQtGui.so.4.5.2)                                                                                                  
==7241==    by 0x21273B3: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQtGui.so.4.5.2)                                                                      
==7241==    by 0x212EA3D: QApplication::notify(QObject*, QEvent*) (in /usr/lib/libQtGui.so.4.5.2)                                                                                    
==7241==    by 0x2B72A19: KApplication::notify(QObject*, QEvent*) (in /usr/lib/libkdeui.so.5.3.0)                                                                                    
==7241==  Address 0x68a933c is 0 bytes after a block of size 4 free'd                                                                                                                
==7241==    at 0x400576A: operator delete(void*) (vg_replace_malloc.c:342)                                                                                                           
==7241==    by 0x226BF1A: (within /usr/lib/libQtGui.so.4.5.2)                                                                                                                        
==7241==    by 0x226BF66: (within /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x2269C21: QPainterPath::toFillPolygons(QTransform const&) const (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x226A2B1: QPainterPath::toFillPolygons(QMatrix const&) const (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x22FE050: (within /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x22FE96E: (within /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x2240D38: QPaintEngine::drawEllipse(QRectF const&) (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x22F98D7: (within /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x2259921: QPainter::drawEllipse(QRectF const&) (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x669D512: (within /usr/lib/kde4/plugins/styles/oxygen.so)
==7241==    by 0x66A8376: (within /usr/lib/kde4/plugins/styles/oxygen.so)
==7241==
==7241== Invalid read of size 4
==7241==    at 0x48CB1E1: QString::QString(QString const&) (qstring.h:711)
==7241==    by 0x48EA3AC: KoCompositeOp::description() const (KoCompositeOp.cpp:99)
==7241==    by 0x4107C12: KisCompositeOpsModel::data(QModelIndex const&, int) const (kis_composite_ops_model.cc:95)
==7241==    by 0x26FBBC7: QSortFilterProxyModel::data(QModelIndex const&, int) const (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x24F5428: (within /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x24F55BF: QComboBox::currentText() const (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x24F6E5C: QComboBox::initStyleOption(QStyleOptionComboBox*) const (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x24F72BC: QComboBox::paintEvent(QPaintEvent*) (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x217BE29: QWidget::event(QEvent*) (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x24F8BDB: QComboBox::event(QEvent*) (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x21273B3: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x212EA3D: QApplication::notify(QObject*, QEvent*) (in /usr/lib/libQtGui.so.4.5.2)
==7241==  Address 0x9f65010 is 8 bytes inside a block of size 20 free'd
==7241==    at 0x4007070: realloc (vg_replace_malloc.c:429)
==7241==    by 0x316C973: qRealloc(void*, unsigned int) (in /usr/lib/libQtCore.so.4.5.2)
==7241==    by 0x3196724: QListData::realloc(int) (in /usr/lib/libQtCore.so.4.5.2)
==7241==    by 0x3196963: QListData::append() (in /usr/lib/libQtCore.so.4.5.2)
==7241==    by 0x226BC76: (within /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x2269720: QPainterPath::toFillPolygons(QTransform const&) const (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x226A2B1: QPainterPath::toFillPolygons(QMatrix const&) const (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x22FE050: (within /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x22FE96E: (within /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x2240D38: QPaintEngine::drawEllipse(QRectF const&) (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x22F98D7: (within /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x2259921: QPainter::drawEllipse(QRectF const&) (in /usr/lib/libQtGui.so.4.5.2)
==7241==
==7241== Invalid read of size 4
==7241==    at 0x48CB0F3: QBasicAtomicInt::ref() (qatomic_i386.h:120)
==7241==    by 0x48CB223: QString::QString(QString const&) (qstring.h:712)
==7241==    by 0x48EA3AC: KoCompositeOp::description() const (KoCompositeOp.cpp:99)
==7241==    by 0x4107C12: KisCompositeOpsModel::data(QModelIndex const&, int) const (kis_composite_ops_model.cc:95)
==7241==    by 0x26FBBC7: QSortFilterProxyModel::data(QModelIndex const&, int) const (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x24F5428: (within /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x24F55BF: QComboBox::currentText() const (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x24F6E5C: QComboBox::initStyleOption(QStyleOptionComboBox*) const (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x24F72BC: QComboBox::paintEvent(QPaintEvent*) (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x217BE29: QWidget::event(QEvent*) (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x24F8BDB: QComboBox::event(QEvent*) (in /usr/lib/libQtGui.so.4.5.2)
==7241==    by 0x21273B3: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQtGui.so.4.5.2)
==7241==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
Comment 3 Cyrille Berger 2009-08-29 11:33:18 UTC
SVN commit 1016891 by berger:

Fix: crash when croping.

Don't recreate a paint device when you can clear it.

BUG:197700


 M  +4 -1      kis_adjustment_layer.cc  
 M  +2 -0      kis_group_layer.cc  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1016891