Bug 228983 - Inverting a selection hangs krita
Summary: Inverting a selection hangs krita
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-01 00:40 UTC by Elián Hanisch
Modified: 2010-03-27 13:51 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elián Hanisch 2010-03-01 00:40:45 UTC
Version:           2.2 Alpha 1 (using 4.4.00 (KDE 4.4.0), Kubuntu packages)
Compiler:          cc
OS:                Linux (i686) release 2.6.31-19-generic

Just open a new image, select something, and invert the selection. All the times I tried krita hangs and I have to kill it.
Comment 1 Cyrille Berger 2010-03-01 19:11:16 UTC
Here is the backtrace:

#0  0xb52d2246 in ?? () from /lib/libc.so.6                                                                                               
#1  0xb52d5049 in free () from /lib/libc.so.6                                                                                             
#2  0xb7d8e61b in qFree(void*) () from /usr/lib/libQtCore.so.4                                                                            
#3  0xb7db2a15 in QHashData::freeNode(void*) () from /usr/lib/libQtCore.so.4                                                              
#4  0xb7922dff in deleteNode (this=<value optimized out>, node=<value optimized out>) at /usr/include/QtCore/qhash.h:507                  
#5  remove (this=<value optimized out>, node=<value optimized out>) at /usr/include/QtCore/qhash.h:790                                    
#6  KisMemoryLeakTracker::dereference (this=<value optimized out>, node=<value optimized out>)                                            
    at /home/cyrille/Projects/kde4/src/koffice/krita/image/kis_memory_leak_tracker.cpp:163                                                
#7  0xb7846345 in KisSharedPtr<KisMementoItem>::deref(KisSharedPtr<KisMementoItem> const*, KisMementoItem*) ()                            
   from /home/cyrille/Projects/kde4//inst//lib/libkritaimage.so.6                                                                         
#8  0xb7845026 in deref (this=<value optimized out>) at /home/cyrille/Projects/kde4/src/koffice/krita/image/kis_shared_ptr.h:227          
#9  ~KisSharedPtr (this=<value optimized out>) at /home/cyrille/Projects/kde4/src/koffice/krita/image/kis_shared_ptr.h:107
#10 KisMementoManager::getCommitedTile (this=<value optimized out>) at /home/cyrille/Projects/kde4/src/koffice/krita/image/tiles3/kis_memento_manager.cc:148
#11 0xb784fe5e in getOldTile (row=<value optimized out>, col=<value optimized out>, this=<value optimized out>)
    at /home/cyrille/Projects/kde4/src/koffice/krita/image/tiles3/kis_tiled_data_manager.h:146
#12 KisTiledHLineIterator::fetchTileDataForCache (row=<value optimized out>, col=<value optimized out>, this=<value optimized out>)
    at /home/cyrille/Projects/kde4/src/koffice/krita/image/tiles3/kis_tiledhlineiterator.cc:236
#13 0xb78513f0 in KisTiledHLineIterator::KisTiledHLineIterator (this=0x9da4c48, dataManager=0x9e00f30, x=1963084776, y=-1073741824, w=2147483647, writable=
    false) at /home/cyrille/Projects/kde4/src/koffice/krita/image/tiles3/kis_tiledhlineiterator.cc:63
#14 0xb790ef69 in KisHLineConstIterator::KisHLineConstIterator (this=0xbfffdbfc, dm=0x9e00f30, x=-1073741824, y=-1073741824, w=2147483647)
    at /home/cyrille/Projects/kde4/src/koffice/krita/image/kis_iterator.cc:109
#15 0xb7933859 in KisLineIteratorPixelBase (offsety=<value optimized out>, offsetx=<value optimized out>, s=<value optimized out>, y=<value optimized out>,
    x=<value optimized out>, sel_dm=<value optimized out>, dm=<value optimized out>, this=<value optimized out>)
    at /home/cyrille/Projects/kde4/src/koffice/krita/image/kis_iterators_pixel.h:40
#16 KisPaintDevice::createHLineConstIterator (offsety=<value optimized out>, offsetx=<value optimized out>, s=<value optimized out>,
    y=<value optimized out>, x=<value optimized out>, sel_dm=<value optimized out>, dm=<value optimized out>, this=<value optimized out>)
    at /home/cyrille/Projects/kde4/src/koffice/krita/image/kis_paint_device.cc:704
#17 0xb7935a7d in KisPaintDevice::exactBounds (this=0xabd7710) at /home/cyrille/Projects/kde4/src/koffice/krita/image/kis_paint_device.cc:288
#18 0xb794eb19 in KisPixelSelection::exactBounds (this=0xabd7710) at /home/cyrille/Projects/kde4/src/koffice/krita/image/kis_pixel_selection.h:171
#19 0xb794bda0 in KisPixelSelection::outline (this=0xabd7710) at /home/cyrille/Projects/kde4/src/koffice/krita/image/kis_pixel_selection.cpp:349
#20 0xb7ba9826 in KisSelectionDecoration::selectionChanged (this=0xa8d9238)
    at /home/cyrille/Projects/kde4/src/koffice/krita/ui/kis_selection_decoration.cc:109
#21 0xb7bab4cd in KisSelectionDecoration::qt_metacall (this=0xa8d9238, _c=InvokeMetaMethod, _id=6, _a=0xbfffde7c)
    at /home/cyrille/Projects/kde4/build/koffice/krita/ui/kis_selection_decoration.moc:76
#22 0xb7ea314d in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#23 0xb7eb1faa in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#24 0xb7bac347 in KisSelectionManager::currentSelectionChanged (this=0xaba4088)
    at /home/cyrille/Projects/kde4/build/koffice/krita/ui/kis_selection_manager.moc:139
#25 0xb7bb468a in KisSelectionManager::selectionChanged (this=0xaba4088) at /home/cyrille/Projects/kde4/src/koffice/krita/ui/kis_selection_manager.cc:362


Interesting part is:
#13 0xb78513f0 in KisTiledHLineIterator::KisTiledHLineIterator (this=0x9da4c48, dataManager=0x9e00f30, x=1963084776, y=-1073741824, w=2147483647, writable=
    false) at 

looks like we are trying to iterate over a lot of pixels... probably because the bound is not correct.
Comment 2 Sven Langkamp 2010-03-24 16:56:02 UTC
SVN commit 1107019 by langkamp:

fix a crash on inverting a selection (not completely fixed though)
use selectedExactRect instead of exactBounds because the selection doesn't have the defaultBounds
CCBUG:228983


 M  +1 -1      kis_pixel_selection.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1107019
Comment 3 Sven Langkamp 2010-03-27 13:51:46 UTC
SVN commit 1107989 by langkamp:

use defaultBounds in selection extent and exactBounds
BUG:228983


 M  +1 -1      kis_image.cc  
 M  +5 -0      kis_mask.cc  
 M  +5 -0      kis_paint_device.cc  
 M  +6 -1      kis_paint_device.h  
 M  +8 -36     kis_pixel_selection.cpp  
 M  +2 -2      kis_pixel_selection.h  
 M  +18 -38    kis_selection.cc  
 M  +6 -2      kis_selection.h  
 M  +12 -37    tests/kis_pixel_selection_test.cpp  
 M  +1 -1      tests/kis_pixel_selection_test.h  


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