Bug 355607

Summary: krita crashes on opening a corrupt .jpg
Product: [Applications] krita Reporter: Rik Willemen <goudhaar>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: crash CC: halla
Priority: NOR Keywords: drkonqi
Version: 2.9.9   
Target Milestone: ---   
Platform: Mint (Ubuntu based)   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Rik Willemen 2015-11-19 21:26:27 UTC
Application: krita (2.9.9)
KDE Platform Version: 4.14.2
Qt Version: 4.8.6
Operating System: Linux 3.16.0-38-generic x86_64
Distribution: Linux Mint 17.2 Rafaela

-- Information about the crash:
- What I was doing when the application crashed:
Trying to open a .jpg image that was unopenable with imagemagick. Imagemagick gives the following error: Error interpreting JPEG image file (Not a JPEG file: starts with 0x7c 0xf6)
If I try to open the same image with Krita, the application crashes

- Unusual behavior I noticed:
The jpgs were corrupted all of a sudden (no idea how this happened, perhaps vigorous copying to and from a NTFS volume on a different machine did it somewhere.

- Custom settings of the application:
I removed and reinstalled Krita a couple of times today because it wouldn't launch (missing essential components). I ended up uninstalling Krita and everything associated with it, added the Lime repository and installed Krita 2.9 (plus dbg).

The crash can be reproduced every time.

-- 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 0x7f9fcc7317c0 (LWP 14164))]

Thread 3 (Thread 0x7f9fa6e5b700 (LWP 14175)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f9fca2dd816 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007f9fcb2aee16 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#3  0x00007f9fca2dd32f in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#4  0x00007f9fc4376182 in start_thread (arg=0x7f9fa6e5b700) at pthread_create.c:312
#5  0x00007f9fc9a7d47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 2 (Thread 0x7f9f9a3ef700 (LWP 14176)):
#0  0x00007f9fc9a7012d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f9fc3e96fe4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f9fc3e970ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f9fca40c7be in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#4  0x00007f9fca3de0af in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#5  0x00007f9fca3de3a5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#6  0x00007f9fca2dac5f in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7  0x00007f9fca3bf823 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8  0x00007f9fca2dd32f in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x00007f9fc4376182 in start_thread (arg=0x7f9f9a3ef700) at pthread_create.c:312
#10 0x00007f9fc9a7d47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7f9fcc7317c0 (LWP 14164)):
[KCrash Handler]
#5  0x00007f9fc99b9cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#6  0x00007f9fc99bd0d8 in __GI_abort () at abort.c:89
#7  0x00007f9fca2d2c92 in qt_message_output(QtMsgType, char const*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8  0x00007f9fca2d2ff9 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x00007f9fca2d3804 in qFatal(char const*, ...) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#10 0x00007f9fcbfd0497 in operator-> (this=<optimized out>) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisPart.cpp:189
#11 operator KisPart* (this=<optimized out>) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisPart.cpp:189
#12 KisPart::instance () at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisPart.cpp:190
#13 0x00007f9fcbfb82f7 in KisMainWindow::~KisMainWindow (this=this@entry=0x18693b0, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisMainWindow.cpp:480
#14 0x00007f9fcbfb87b9 in KisMainWindow::~KisMainWindow (this=0x18693b0, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisMainWindow.cpp:488
#15 0x00007f9fcbfcf667 in KisPart::~KisPart (this=0x18d5610, __in_chrg=<optimized out>) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisPart.cpp:217
#16 0x00007f9fcbfcf9f9 in KisPart::~KisPart (this=0x18d5610, __in_chrg=<optimized out>) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisPart.cpp:221
#17 0x00007f9fc99bf259 in __run_exit_handlers (status=1, listp=0x7f9fc9d416c8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:82
#18 0x00007f9fc99bf2a5 in __GI_exit (status=<optimized out>) at exit.c:104
#19 0x00007f9fb0326f1c in ?? () from /usr/lib/x86_64-linux-gnu/libjpeg.so.8
#20 0x00007f9fb0320ecc in ?? () from /usr/lib/x86_64-linux-gnu/libjpeg.so.8
#21 0x00007f9fb031e9ca in ?? () from /usr/lib/x86_64-linux-gnu/libjpeg.so.8
#22 0x00007f9fb0318f57 in jpeg_consume_input () from /usr/lib/x86_64-linux-gnu/libjpeg.so.8
#23 0x00007f9fb0319223 in jpeg_read_header () from /usr/lib/x86_64-linux-gnu/libjpeg.so.8
#24 0x00007f9f74c029c7 in KisJPEGConverter::decode (this=this@entry=0x7ffc210e5e10, uri=...) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/plugins/formats/jpeg/kis_jpeg_converter.cc:154
#25 0x00007f9f74c0780d in KisJPEGConverter::buildImage (this=this@entry=0x7ffc210e5e10, uri=...) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/plugins/formats/jpeg/kis_jpeg_converter.cc:438
#26 0x00007f9f74bff471 in KisJPEGImport::convert (this=0x1c58f10, to=...) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/plugins/formats/jpeg/kis_jpeg_import.cc:73
#27 0x00007f9fcbf9bdff in CalligraFilter::ChainLink::invokeFilter (this=0x1f77380, parentChainLink=parentChainLink@entry=0x0) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisFilterChainLink.cpp:90
#28 0x00007f9fcbf9aa42 in KisFilterChain::invokeChain (this=0x1bebd30) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisFilterChain.cpp:95
#29 0x00007f9fcbfa9ea9 in KisImportExportManager::importDocument (this=0x2139520, url=..., documentMimeType=..., status=@0x7ffc210e6340: 34713616) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisImportExportManager.cpp:169
#30 0x00007f9fcbf8636e in KisDocument::openFile (this=0x211a150) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisDocument.cpp:1337
#31 0x00007f9fcbf8b8b6 in openFile (this=0x1f89160) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisDocument.cpp:379
#32 KisDocument::Private::openLocalFile (this=0x1f89160) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisDocument.cpp:401
#33 0x00007f9fcbf88b05 in KisDocument::openUrlInternal (this=this@entry=0x211a150, url=...) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisDocument.cpp:2436
#34 0x00007f9fcbf88d30 in KisDocument::openUrl (this=this@entry=0x211a150, _url=..., flags=flags@entry=KisDocument::OPEN_URL_FLAG_NONE) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisDocument.cpp:1240
#35 0x00007f9fcbfb324f in KisMainWindow::openDocumentInternal (this=this@entry=0x18693b0, url=..., newdoc=0x211a150) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisMainWindow.cpp:711
#36 0x00007f9fcbf71c6f in KisApplication::start (this=this@entry=0x7ffc210e6ee0) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/ui/KisApplication.cpp:488
#37 0x000000000040275e in main (argc=<optimized out>, argv=<optimized out>) at /build/krita-2.9-XNcYDU/krita-2.9-2+git20151118+r41/krita/main.cc:192

Possible duplicates by query: bug 351298.

Reported using DrKonqi
Comment 1 Halla Rempt 2015-11-19 21:56:08 UTC
Hm, this crash actually happens inside libjpeg. Could you attach the broken jpeg file so I can test?
Comment 2 Halla Rempt 2015-12-07 15:16:37 UTC
Hi Rik,

Can you please provide one of those broken jpeg files? Otherwise I cannot fix the issue.
Comment 3 Rik Willemen 2015-12-07 16:33:29 UTC
Hi Boudewijn,

Sorry, I'm afraid I deleted them already (didn't think they'd be necessary, this is the first time I reported a bug). I tried reproducing the jpegs using the same process that corrupted them in the first place (I think), but to no avail. If I ever run into the issue again, I'll hold on to the files. For now I think we're best off closing this issue?
Comment 4 Halla Rempt 2015-12-07 17:48:53 UTC
Yes, I'm afraid that 's the only thing we can do for now...