Bug 291526

Summary: Krita crash at opening file after proposing to recover a backup
Product: [Applications] krita Reporter: David REVOY <info>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: halla, ultmateinferno
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description David REVOY 2012-01-14 16:45:29 UTC
Application: krita (2.4 Beta 6)
KDE Platform Version: 4.7.3 (4.7.3)
Qt Version: 4.7.4
Operating System: Linux 3.0.0-14-generic x86_64
Distribution: Ubuntu 11.10

-- Information about the crash:
- What I was doing when the application crashed:
It was after I lost some minute of work because of a crash ( flatten image crash 291271 ) . So, I tryed to reopen the file to work on. ; Krita propose at this moment me to recover my work because ' a backup file exist' for this file. I'm happy to know it and said immediately 'yes' , then Krita directly launch the crash dialog with this backtrace. 
double crash combo !
By the way first time I try the "Crash Reporting Assistant" from the bug dialog .  looks cool :)

The crash can be reproduced every time.

-- Backtrace:
Application: Krita (kdeinit4), signal: Segmentation fault
[Current thread is 1 (Thread 0x7fd13a0a3780 (LWP 11172))]

Thread 3 (Thread 0x7fd114a35700 (LWP 11173)):
#0  0x00007fd1353d504c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fd138c3c1ab in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007fd138c38ba5 in QSemaphore::acquire(int) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#3  0x00007fd11cd9e3ae in KisTileDataPooler::waitForWork (this=0x5a6c990) at /home/deevad/sources/krita/calligra/calligra-src/krita/image/tiles3/kis_tile_data_pooler.cc:162
#4  0x00007fd11cd9ea94 in KisTileDataPooler::run (this=0x5a6c990) at /home/deevad/sources/krita/calligra/calligra-src/krita/image/tiles3/kis_tile_data_pooler.cc:184
#5  0x00007fd138c3bd05 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#6  0x00007fd12a35556c in ?? () from /usr/lib/nvidia-current/libGL.so.1
#7  0x00007fd1353d0efc in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#8  0x00007fd13791289d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#9  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fd114234700 (LWP 11174)):
#0  0x00007fd1353d504c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fd138c3c1ab in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007fd138c38dd9 in QSemaphore::tryAcquire(int, int) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#3  0x00007fd11cdbeb4a in KisTileDataSwapper::run (this=0x5a6c9c8) at /home/deevad/sources/krita/calligra/calligra-src/krita/image/tiles3/swap/kis_tile_data_swapper.cpp:92
#4  0x00007fd138c3bd05 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#5  0x00007fd12a35556c in ?? () from /usr/lib/nvidia-current/libGL.so.1
#6  0x00007fd1353d0efc in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#7  0x00007fd13791289d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fd13a0a3780 (LWP 11172)):
[KCrash Handler]
#6  KisImage::initialRefreshGraph (this=0x0) at /home/deevad/sources/krita/calligra/calligra-src/krita/image/kis_image.cc:1357
#7  0x00007fd11d2c7a54 in KisDoc2::slotLoadingFinished (this=0x82a4b10) at /home/deevad/sources/krita/calligra/calligra-src/krita/ui/kis_doc2.cc:180
#8  0x00007fd11d2c83fc in KisDoc2::qt_metacall (this=0x82a4b10, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7fff1db53ca0) at /home/deevad/sources/krita/calligra/calligra-build/krita/ui/kis_doc2.moc:86
#9  0x00007fd138d35eba in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#10 0x00007fd11d2c8553 in KisDoc2::setCurrentImage (this=0x82a4b10, image=...) at /home/deevad/sources/krita/calligra/calligra-src/krita/ui/kis_doc2.cc:521
#11 0x00007fd1036ce425 in OraImport::convert (this=0x8d1fe50, to=<optimized out>) at /home/deevad/sources/krita/calligra/calligra-src/krita/plugins/formats/ora/ora_import.cc:85
#12 0x00007fd12611eab6 in CalligraFilter::ChainLink::invokeFilter (this=0x8d1d7b0, parentChainLink=0x0) at /home/deevad/sources/krita/calligra/calligra-src/libs/main/KoFilterChainLink.cpp:90
#13 0x00007fd126116159 in KoFilterChain::invokeChain (this=0x8d1d080) at /home/deevad/sources/krita/calligra/calligra-src/libs/main/KoFilterChain.cpp:94
#14 0x00007fd1261145b5 in KoFilterManager::importDocument (this=0x8d23020, url=..., documentMimeType=<optimized out>, status=@0x7fff1db5492c) at /home/deevad/sources/krita/calligra/calligra-src/libs/main/KoFilterManager.cpp:170
#15 0x00007fd1260c8555 in KoDocument::openFile (this=0x82a4b10) at /home/deevad/sources/krita/calligra/calligra-src/libs/main/KoDocument.cpp:1527
#16 0x00007fd13033587c in ?? () from /usr/lib/libkparts.so.4
#17 0x00007fd130335ec4 in KParts::ReadOnlyPart::openUrl(KUrl const&) () from /usr/lib/libkparts.so.4
#18 0x00007fd1260ccb81 in KoDocument::openUrl (this=0x82a4b10, _url=...) at /home/deevad/sources/krita/calligra/calligra-src/libs/main/KoDocument.cpp:1286
#19 0x00007fd1260e9f87 in KoMainWindow::openDocumentInternal (this=0x7fd104014d30, url=..., newdoc=0x82a4b10) at /home/deevad/sources/krita/calligra/calligra-src/libs/main/KoMainWindow.cpp:666
#20 0x00007fd1260e8b02 in KoMainWindow::openDocument (this=0x7fd104014d30, newdoc=0x82a4b10, url=...) at /home/deevad/sources/krita/calligra/calligra-src/libs/main/KoMainWindow.cpp:649
#21 0x00007fd1260ba4e4 in KoApplication::start (this=<optimized out>) at /home/deevad/sources/krita/calligra/calligra-src/libs/main/KoApplication.cpp:301
#22 0x00007fd1263c1a08 in kdemain (argc=<optimized out>, argv=<optimized out>) at /home/deevad/sources/krita/calligra/calligra-src/krita/main.cc:63
#23 0x0000000000408547 in _start ()

Reported using DrKonqi
Comment 1 Halla Rempt 2012-01-14 16:50:46 UTC
Oh zut... If you need the image to be recovered, please send it to me and I'll try tonight to get it restored for you. boud@valdyas.org.
Comment 2 Halla Rempt 2012-01-21 11:12:48 UTC
Hi David,

Could you mail me the autosave file? I've just looked at the code and there's something really weird going on. Apparently, at the end of loading we still don't have an image, so I need to be able to test this.

I'll commit something that'll paper over the crash, but it won't help loading a broken autosave file, I'm afraid.
Comment 3 David REVOY 2012-01-21 11:56:16 UTC
Sorry Boud I can't send you the guilty autosave file , I cleaned all autosave files on my home folder a week ago, and I also empty my trash at the start of week. 

I tryed again crashing ( with "flatten image" x2 crash feature ) random new document and unsaved, but all seems to work now ( http://img259.imageshack.us/img259/5086/20120121screenshot03.jpg dialog, then they recover to the last 'autosave' correctly ). I tryed with layers , hidden layers , single layer.
Comment 4 Halla Rempt 2012-01-21 12:01:32 UTC
Git commit b6d2fa75034b0cd52cff452fd645a135e2caf056 by Boudewijn Rempt.
Committed on 21/01/2012 at 12:11.
Pushed by rempt into branch 'master'.

Check whether we have an image before dereferencing

Everywhere in KisDoc2 we check whether we've got an image before using
except in these two places.

M  +4    -1    krita/ui/kis_doc2.cc

http://commits.kde.org/calligra/b6d2fa75034b0cd52cff452fd645a135e2caf056
Comment 5 Halla Rempt 2012-01-21 12:02:27 UTC
Okay, then I'll close the bug -- I made sure the crash couldn't happen anymore in any case. Thanks!
Comment 6 ultmateinferno 2015-12-06 06:02:30 UTC
There's still a problem!
It just happened to me and I need the file!