Bug 347879 - Crash saving a .kra when I opened a .jpeg
Summary: Crash saving a .kra when I opened a .jpeg
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (other bugs)
Version First Reported In: 2.9.4
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-18 05:59 UTC by untetra
Modified: 2015-06-20 10:13 UTC (History)
2 users (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 untetra 2015-05-18 05:59:00 UTC
I was saving a .kra file with a layer that was created with the option of "open file" when I had no others layers (new project), the file I opened was a jpeg.



Reproducible: Sometimes

Steps to Reproduce:
1) Open Krita
2) File>Open file> a *.jpeg file
3) File>Save as *.kra
4) it says is saving, I check the saving folder and it has the *.kra file with something like this *.kra(1 letter)(five numbers).new, and never stops to say it's saving.
4a) Modify the layer in somethin, paint over it
5) Then File>Save or File>Save as...
6) Crash
7) I check again the folder, and creates another file like *.kra(1 letter)(five numbers).new but now empty
8) Krita says the archive created in steps 3), 4) is corrupted

Actual Results:  
Crash + one corrupted .kra file + one empty .kra file both with weird names

Expected Results:  
one fine .kra file

Workaround

I create the project with File>New with the resolution I have the *.jpeg, I import the *.jpeg instead with Layer>Import/Export>Import>Import Layer and then It saves in the normal way (1 second to save or so, and uncorrupted)

Application: krita (2.9.4)
KDE Platform Version: 4.13.3
Qt Version: 4.8.6
Operating System: Linux 3.16.0-37-generic x86_64
Distribution: Ubuntu 14.04.2 LTS

-- Backtrace:
Application: Krita (krita), signal: Aborted
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fc38211f800 (LWP 26246))]

Thread 6 (Thread 0x7fc350d9f700 (LWP 26254)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007fc37fd2b816 in wait (time=18446744073709551615, this=0x3ae9e50) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=<optimized out>, mutex=mutex@entry=0x3ae9e00, time=time@entry=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00007fc37fd2795b in QSemaphore::acquire (this=this@entry=0x3ae9b30, n=n@entry=1) at thread/qsemaphore.cpp:144
#4  0x00007fc37e3b6b2c in waitForWork (this=0x3ae9b20) at /build/buildd/krita-testing-2+git20150515+r4/krita/image/tiles3/kis_tile_data_pooler.cc:162
#5  KisTileDataPooler::run (this=0x3ae9b20) at /build/buildd/krita-testing-2+git20150515+r4/krita/image/tiles3/kis_tile_data_pooler.cc:184
#6  0x00007fc37fd2b32f in QThreadPrivate::start (arg=0x3ae9b20) at thread/qthread_unix.cpp:349
#7  0x00007fc379cc8182 in start_thread (arg=0x7fc350d9f700) at pthread_create.c:312
#8  0x00007fc37f4c247d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 5 (Thread 0x7fc35b5e7700 (LWP 26255)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007fc37fd2b816 in wait (time=18446744073709551615, this=0x3af72b0) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=<optimized out>, mutex=mutex@entry=0x3af7260, time=time@entry=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00007fc37fd27d63 in QSemaphore::tryAcquire (this=0x3ae9ec0, n=n@entry=1, timeout=timeout@entry=-1) at thread/qsemaphore.cpp:221
#4  0x00007fc37e3dee63 in KisTileDataSwapper::waitForWork (this=this@entry=0x3ae9b58) at /build/buildd/krita-testing-2+git20150515+r4/krita/image/tiles3/swap/kis_tile_data_swapper.cpp:86
#5  0x00007fc37e3df09a in KisTileDataSwapper::run (this=0x3ae9b58) at /build/buildd/krita-testing-2+git20150515+r4/krita/image/tiles3/swap/kis_tile_data_swapper.cpp:92
#6  0x00007fc37fd2b32f in QThreadPrivate::start (arg=0x3ae9b58) at thread/qthread_unix.cpp:349
#7  0x00007fc379cc8182 in start_thread (arg=0x7fc35b5e7700) at pthread_create.c:312
#8  0x00007fc37f4c247d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 4 (Thread 0x7fc332ffd700 (LWP 26264)):
#0  0x00007fc37982a61d in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007fc37982a979 in g_mutex_lock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fc3797e8699 in g_main_context_prepare () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fc3797e8f03 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fc3797e90ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fc37fe5a7be in QEventDispatcherGlib::processEvents (this=0x7fc3180008e0, flags=...) at kernel/qeventdispatcher_glib.cpp:436
#6  0x00007fc37fe2c0af in QEventLoop::processEvents (this=this@entry=0x7fc332ffcda0, flags=...) at kernel/qeventloop.cpp:149
#7  0x00007fc37fe2c3a5 in QEventLoop::exec (this=this@entry=0x7fc332ffcda0, flags=...) at kernel/qeventloop.cpp:204
#8  0x00007fc37fd28c5f in QThread::exec (this=this@entry=0x44a0e40) at thread/qthread.cpp:537
#9  0x00007fc37fe0d823 in QInotifyFileSystemWatcherEngine::run (this=0x44a0e40) at io/qfilesystemwatcher_inotify.cpp:265
#10 0x00007fc37fd2b32f in QThreadPrivate::start (arg=0x44a0e40) at thread/qthread_unix.cpp:349
#11 0x00007fc379cc8182 in start_thread (arg=0x7fc332ffd700) at pthread_create.c:312
#12 0x00007fc37f4c247d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 3 (Thread 0x7fc3327fc700 (LWP 26265)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007fc37fd2b816 in wait (time=18446744073709551615, this=0x4555250) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=this@entry=0x4554db8, mutex=mutex@entry=0x4554db0, time=time@entry=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00007fc380d06d96 in QFileInfoGatherer::run (this=0x4554da0) at dialogs/qfileinfogatherer.cpp:214
#4  0x00007fc37fd2b32f in QThreadPrivate::start (arg=0x4554da0) at thread/qthread_unix.cpp:349
#5  0x00007fc379cc8182 in start_thread (arg=0x7fc3327fc700) at pthread_create.c:312
#6  0x00007fc37f4c247d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 2 (Thread 0x7fc331ffb700 (LWP 26266)):
#0  0x00007fc37f4b382d in read () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007fc375d19f85 in ?? () from /usr/lib/nvidia-349/tls/libnvidia-tls.so.349.16
#2  0x00007fc379829c10 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fc3797e8b14 in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fc3797e8f7b in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fc3797e90ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007fc37fe5a7be in QEventDispatcherGlib::processEvents (this=0x7fc3100008e0, flags=...) at kernel/qeventdispatcher_glib.cpp:436
#7  0x00007fc37fe2c0af in QEventLoop::processEvents (this=this@entry=0x7fc331ffada0, flags=...) at kernel/qeventloop.cpp:149
#8  0x00007fc37fe2c3a5 in QEventLoop::exec (this=this@entry=0x7fc331ffada0, flags=...) at kernel/qeventloop.cpp:204
#9  0x00007fc37fd28c5f in QThread::exec (this=this@entry=0x4555350) at thread/qthread.cpp:537
#10 0x00007fc37fe0d823 in QInotifyFileSystemWatcherEngine::run (this=0x4555350) at io/qfilesystemwatcher_inotify.cpp:265
#11 0x00007fc37fd2b32f in QThreadPrivate::start (arg=0x4555350) at thread/qthread_unix.cpp:349
#12 0x00007fc379cc8182 in start_thread (arg=0x7fc331ffb700) at pthread_create.c:312
#13 0x00007fc37f4c247d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7fc38211f800 (LWP 26246)):
[KCrash Handler]
#5  0x00007fc37f3fecc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#6  0x00007fc37f4020d8 in __GI_abort () at abort.c:89
#7  0x00007fc37fd20c92 in qt_message_output (msgType=msgType@entry=QtFatalMsg, buf=0x4bd8f98 "ASSERT: \"d->kraSaver == 0\" in file /build/buildd/krita-testing-2+git20150515+r4/krita/ui/KisDocument.cpp, line 1992") at global/qglobal.cpp:2383
#8  0x00007fc37fd20ff9 in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=msgType@entry=QtFatalMsg, msg=msg@entry=0x7fc37fe8ea20 "ASSERT: \"%s\" in file %s, line %d", ap=ap@entry=0x7ffe7f81c8a8) at global/qglobal.cpp:2429
#9  0x00007fc37fd21804 in qFatal (msg=msg@entry=0x7fc37fe8ea20 "ASSERT: \"%s\" in file %s, line %d") at global/qglobal.cpp:2612
#10 0x00007fc37fd21846 in qt_assert (assertion=assertion@entry=0x7fc381b91ede "d->kraSaver == 0", file=file@entry=0x7fc381b91788 "/build/buildd/krita-testing-2+git20150515+r4/krita/ui/KisDocument.cpp", line=line@entry=1992) at global/qglobal.cpp:2057
#11 0x00007fc38198a30a in KisDocument::saveXML (this=0x4c6c420) at /build/buildd/krita-testing-2+git20150515+r4/krita/ui/KisDocument.cpp:1992
#12 0x00007fc38198918a in KisDocument::saveToStream (this=this@entry=0x4c6c420, dev=dev@entry=0x7ffe7f81cb90) at /build/buildd/krita-testing-2+git20150515+r4/krita/ui/KisDocument.cpp:1024
#13 0x00007fc381993704 in KisDocument::saveNativeFormatCalligra (this=this@entry=0x4c6c420, store=store@entry=0x4ad4e60) at /build/buildd/krita-testing-2+git20150515+r4/krita/ui/KisDocument.cpp:979
#14 0x00007fc381993fb6 in KisDocument::saveNativeFormat (this=this@entry=0x4c6c420, file=...) at /build/buildd/krita-testing-2+git20150515+r4/krita/ui/KisDocument.cpp:971
#15 0x00007fc38198d321 in KisDocument::saveFile (this=0x4c6c420) at /build/buildd/krita-testing-2+git20150515+r4/krita/ui/KisDocument.cpp:731
#16 0x00007fc381996441 in KisDocument::save (this=0x4c6c420) at /build/buildd/krita-testing-2+git20150515+r4/krita/ui/KisDocument.cpp:2314
#17 0x00007fc3819cc0ae in KisMainWindow::saveDocument (this=this@entry=0x36a3b10, document=0x4c6c420, saveas=saveas@entry=false, silent=silent@entry=false, specialOutputFlag=specialOutputFlag@entry=0) at /build/buildd/krita-testing-2+git20150515+r4/krita/ui/KisMainWindow.cpp:971
#18 0x00007fc3819cd183 in KisMainWindow::slotFileSave (this=this@entry=0x36a3b10) at /build/buildd/krita-testing-2+git20150515+r4/krita/ui/KisMainWindow.cpp:1161
#19 0x00007fc3819d38fd in KisMainWindow::qt_static_metacall (_o=0x36a3b10, _c=<optimized out>, _id=10, _a=0x7ffe7f81d5e0) at /build/buildd/krita-testing-2+git20150515+r4/obj-x86_64-linux-gnu/krita/ui/KisMainWindow.moc:155
#20 0x00007fc37fe4187a in QMetaObject::activate (sender=sender@entry=0x48063a0, m=m@entry=0x7fc3812d3de0 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffe7f81d5e0) at kernel/qobject.cpp:3539
#21 0x00007fc380823a62 in QAction::triggered (this=this@entry=0x48063a0, _t1=false) at .moc/release-shared/moc_qaction.cpp:276
#22 0x00007fc380825433 in QAction::activate (this=this@entry=0x48063a0, event=event@entry=QAction::Trigger) at kernel/qaction.cpp:1257
#23 0x00007fc380c53489 in QMenuPrivate::activateCausedStack (this=this@entry=0x4909900, causedStack=..., action=action@entry=0x48063a0, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1038
#24 0x00007fc380c579b9 in QMenuPrivate::activateAction (this=0x4909900, action=0x48063a0, action_e=QAction::Trigger, self=<optimized out>) at widgets/qmenu.cpp:1130
#25 0x00007fc37a700665 in KMenu::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libkdeui.so.5
#26 0x00007fc38087950a in QWidget::event (this=this@entry=0x4887170, event=event@entry=0x7ffe7f81dd20) at kernel/qwidget.cpp:8376
#27 0x00007fc380c5b7bb in QMenu::event (this=0x4887170, e=0x7ffe7f81dd20) at widgets/qmenu.cpp:2481
#28 0x00007fc380829e2c in QApplicationPrivate::notify_helper (this=this@entry=0x296e470, receiver=receiver@entry=0x4887170, e=e@entry=0x7ffe7f81dd20) at kernel/qapplication.cpp:4567
#29 0x00007fc3808305dd in QApplication::notify (this=<optimized out>, receiver=receiver@entry=0x4887170, e=e@entry=0x7ffe7f81dd20) at kernel/qapplication.cpp:4110
#30 0x00007fc381981637 in KisApplication::notify (this=<optimized out>, receiver=0x4887170, event=0x7ffe7f81dd20) at /build/buildd/krita-testing-2+git20150515+r4/krita/ui/KisApplication.cpp:485
#31 0x00007fc37fe2d4dd in QCoreApplication::notifyInternal (this=0x7ffe7f81e790, receiver=receiver@entry=0x4887170, event=event@entry=0x7ffe7f81dd20) at kernel/qcoreapplication.cpp:953
#32 0x00007fc38082fd93 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#33 QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x4887170, event=event@entry=0x7ffe7f81dd20, alienWidget=alienWidget@entry=0x0, nativeWidget=nativeWidget@entry=0x4887170, buttonDown=buttonDown@entry=0x7fc38130f318 <qt_button_down>, lastMouseReceiver=..., spontaneous=spontaneous@entry=true) at kernel/qapplication.cpp:3178
#34 0x00007fc3808a4cfc in QETWidget::translateMouseEvent (this=this@entry=0x4887170, event=event@entry=0x7ffe7f81e070) at kernel/qapplication_x11.cpp:4568
#35 0x00007fc3808a4269 in QApplication::x11ProcessEvent (this=0x7ffe7f81e790, event=event@entry=0x7ffe7f81e070) at kernel/qapplication_x11.cpp:3627
#36 0x00007fc3808cbb02 in x11EventSourceDispatch (s=0x296eb70, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#37 0x00007fc3797e8e04 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#38 0x00007fc3797e9048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007fc3797e90ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#40 0x00007fc37fe5a7a1 in QEventDispatcherGlib::processEvents (this=0x296e430, flags=...) at kernel/qeventdispatcher_glib.cpp:434
#41 0x00007fc3808cbbb6 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#42 0x00007fc37fe2c0af in QEventLoop::processEvents (this=this@entry=0x7ffe7f81e440, flags=...) at kernel/qeventloop.cpp:149
#43 0x00007fc37fe2c3a5 in QEventLoop::exec (this=this@entry=0x7ffe7f81e440, flags=...) at kernel/qeventloop.cpp:204
#44 0x00007fc37fe31b79 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1225
#45 0x00007fc38082837c in QApplication::exec () at kernel/qapplication.cpp:3828
#46 0x0000000000402682 in main (argc=<optimized out>, argv=<optimized out>) at /build/buildd/krita-testing-2+git20150515+r4/krita/main.cc:179

Possible duplicates by query: bug 347789, bug 345562.
Comment 1 mvowada 2015-05-18 11:48:22 UTC
I can confirm steps 1 to 5. Actually, I can't reproduce the crash by saving (step 5).
The mouse pointer, after step 5, starts to spin (wait) and doesn't stop. 
Ubuntu 14.04 - Krita: 2.9.4 (git f6b201a)
Comment 2 Halla Rempt 2015-05-27 07:24:34 UTC
Hm... I can't reproduce here with a randomjpeg file. There are two possibilities: either there's something in the jpegs you're testing with (please attach one to the bug report), or there's something wrong with the jpeg library krita is built against: which version of libjpeg is on your systems?
Comment 3 Halla Rempt 2015-06-02 19:25:46 UTC
Hm, and the assert 

#11 0x00007fc38198a30a in KisDocument::saveXML (this=0x4c6c420) at /build/buildd/krita-testing-2+git20150515+r4/krita/ui/KisDocument.cpp:1992

Probably means that the document is still saving. I wonder how that can happen. It's consistent with mvowada's observations, though.
Comment 4 Halla Rempt 2015-06-20 10:13:24 UTC
Fixed now in 2.9.5.1!