Bug 371523

Summary: Crash when open xcf (gimp) files
Product: [Applications] krita Reporter: Enzo_01
Component: File formatsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: halla
Priority: NOR    
Version First Reported In: 3.1 Beta   
Target Milestone: ---   
Platform: macOS (DMG)   
OS: macOS   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: evrosportcom-logo.xcf

Description Enzo_01 2016-10-23 12:44:03 UTC
After the crash I get the dialog with report.


Reproducible: Always

Steps to Reproduce:
1. Install Krita krita-3.0.91
2. Open xcf

Actual Results:  
Crash

Expected Results:  
Get file opened or even message that this file type is not supported.


Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000010
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]

VM Regions Near 0x10:
--> 
    __TEXT                 0000000104456000-000000010482e000 [ 3936K] r-x/rwx SM=COW  /Applications/krita.app/Contents/MacOS/krita

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libkritawidgets.15.dylib      	0x000000010564cf74 KoResourceItemChooserSync::baseLength() + 4
1   libkritaui.15.dylib           	0x0000000104c93202 KisViewManager::~KisViewManager() + 562
2   libkritaui.15.dylib           	0x0000000104c9340e KisViewManager::~KisViewManager() + 14
3   libkritaui.15.dylib           	0x0000000104c5b956 KisMainWindow::~KisMainWindow() + 118
4   libkritaui.15.dylib           	0x0000000104c5bb25 KisMainWindow::~KisMainWindow() + 21
5   libkritaui.15.dylib           	0x0000000104c73b9a KisPart::~KisPart() + 362
6   libkritaui.15.dylib           	0x0000000104c73c5e KisPart::~KisPart() + 14
7   libkritaui.15.dylib           	0x0000000104c761f6 0x104889000 + 4116982
8   libsystem_c.dylib             	0x00007fffbe248198 __cxa_finalize_ranges + 332
9   libsystem_c.dylib             	0x00007fffbe2484d2 exit + 55
10  kritaxcfimport.so             	0x0000000114fc37fe 0x114fb2000 + 71678
11  kritaxcfimport.so             	0x0000000114fc3a6f 0x114fb2000 + 72303
12  kritaxcfimport.so             	0x0000000114fc2c22 0x114fb2000 + 68642
13  kritaxcfimport.so             	0x0000000114fc2faf 0x114fb2000 + 69551
14  kritaxcfimport.so             	0x0000000114fbe0ce 0x114fb2000 + 49358
15  kritaxcfimport.so             	0x0000000114fbde62 0x114fb2000 + 48738
16  libkritaui.15.dylib           	0x0000000104c469d4 0x104889000 + 3922388
17  libkritaui.15.dylib           	0x0000000104c452b5 KisFilterChain::invokeChain() + 421
18  libkritaui.15.dylib           	0x0000000104c4cf76 KisImportExportManager::importDocument(QString const&, QString const&, KisImportExportFilter::ConversionStatus&) + 1382
19  libkritaui.15.dylib           	0x0000000104c2e2ce KisDocument::openFile() + 1390
20  libkritaui.15.dylib           	0x0000000104c393a4 0x104889000 + 3867556
21  libkritaui.15.dylib           	0x0000000104c38094 0x104889000 + 3862676
22  libkritaui.15.dylib           	0x0000000104c2dcd1 KisDocument::openUrlInternal(QUrl const&) + 385
23  libkritaui.15.dylib           	0x0000000104c2d2ba KisDocument::openUrl(QUrl const&, KisDocument::OpenUrlFlags) + 554
24  libkritaui.15.dylib           	0x0000000104c5dc70 KisMainWindow::openDocumentInternal(QUrl const&, KisDocument*) + 464
25  libkritaui.15.dylib           	0x0000000104c5d810 KisMainWindow::openDocument(QUrl const&) + 128
26  libkritaui.15.dylib           	0x0000000104c62d15 KisMainWindow::dropEvent(QDropEvent*) + 469
27  org.qt-project.QtWidgets      	0x000000010644c3a3 QWidget::event(QEvent*) + 2611
28  org.qt-project.QtWidgets      	0x000000010655e6da QMainWindow::event(QEvent*) + 1546
29  libkritawidgetutils.15.dylib  	0x000000010603389f KMainWindow::event(QEvent*) + 671
30  org.qt-project.QtWidgets      	0x000000010640ba7a QApplicationPrivate::notify_helper(QObject*, QEvent*) + 314
31  org.qt-project.QtWidgets      	0x000000010640d7c4 QApplication::notify(QObject*, QEvent*) + 2836
32  libkritaui.15.dylib           	0x0000000104c1f258 KisApplication::notify(QObject*, QEvent*) + 24
33  org.qt-project.QtCore         	0x0000000107267b14 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 164
34  org.qt-project.QtWidgets      	0x000000010646ea87 0x1063fa000 + 477831
35  org.qt-project.QtWidgets      	0x000000010646c41e 0x1063fa000 + 467998
36  org.qt-project.QtWidgets      	0x000000010640ba7a QApplicationPrivate::notify_helper(QObject*, QEvent*) + 314
37  org.qt-project.QtWidgets      	0x000000010640ceae QApplication::notify(QObject*, QEvent*) + 510
38  libkritaui.15.dylib           	0x0000000104c1f258 KisApplication::notify(QObject*, QEvent*) + 24
39  org.qt-project.QtCore         	0x0000000107267b14 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 164
40  org.qt-project.QtGui          	0x0000000106a88be0 QGuiApplicationPrivate::processDrop(QWindow*, QMimeData const*, QPoint const&, QFlags<Qt::DropAction>) + 96
41  org.qt-project.QtGui          	0x0000000106a6ca45 QWindowSystemInterface::handleDrop(QWindow*, QMimeData const*, QPoint const&, QFlags<Qt::DropAction>) + 213
42  libqcocoa.dylib               	0x0000000107f29edd 0x107f07000 + 143069
43  com.apple.AppKit              	0x00007fffa70ac2bd NSCoreDragReceiveMessageProc + 749
44  com.apple.HIServices          	0x00007fffa7ee23ae DoMultipartDropMessage + 328
45  com.apple.HIServices          	0x00007fffa7ee20b8 DoDropMessage + 41
46  com.apple.HIServices          	0x00007fffa7ee6ec7 CoreDragMessageHandler + 867
47  com.apple.CoreFoundation      	0x00007fffa9213b36 __CFMessagePortPerform + 598
48  com.apple.CoreFoundation      	0x00007fffa917c299 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
49  com.apple.CoreFoundation      	0x00007fffa917c211 __CFRunLoopDoSource1 + 465
50  com.apple.CoreFoundation      	0x00007fffa9174165 __CFRunLoopRun + 2389
51  com.apple.CoreFoundation      	0x00007fffa91735b4 CFRunLoopRunSpecific + 420
52  com.apple.HIToolbox           	0x00007fffa8714f6c RunCurrentEventLoopInMode + 240
53  com.apple.HIToolbox           	0x00007fffa8714da1 ReceiveNextEventCommon + 432
54  com.apple.HIToolbox           	0x00007fffa8714bd6 _BlockUntilNextEventMatchingListInModeWithFilter + 71
55  com.apple.AppKit              	0x00007fffa6e0b5f5 _DPSNextEvent + 1093
56  com.apple.AppKit              	0x00007fffa751b8eb -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1637
57  com.apple.AppKit              	0x00007fffa6dfffbd -[NSApplication run] + 926
58  libqcocoa.dylib               	0x0000000107f2d21f 0x107f07000 + 156191
59  org.qt-project.QtCore         	0x0000000107263d01 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 417
60  org.qt-project.QtCore         	0x0000000107268185 QCoreApplication::exec() + 341
61  org.krita                     	0x0000000104462f52 main + 6210
62  libdyld.dylib                 	0x00007fffbe1b3255 start + 1

Thread 1:
0   libsystem_kernel.dylib        	0x00007fffbe2e24e6 __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x00007fffbe3c97c5 _pthread_wqthread + 1426
2   libsystem_pthread.dylib       	0x00007fffbe3c9221 start_wqthread + 13

Thread 2:: com.apple.CFSocket.private
0   libsystem_kernel.dylib        	0x00007fffbe2e1f4e __select + 10
1   com.apple.CoreFoundation      	0x00007fffa91af72a __CFSocketManager + 682
2   libsystem_pthread.dylib       	0x00007fffbe3c9abb _pthread_body + 180
3   libsystem_pthread.dylib       	0x00007fffbe3c9a07 _pthread_start + 286
4   libsystem_pthread.dylib       	0x00007fffbe3c9231 thread_start + 13

Thread 3:: QFileInfoGatherer
0   libsystem_kernel.dylib        	0x00007fffbe2e1c8a __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fffbe3ca97a _pthread_cond_wait + 712
2   org.qt-project.QtCore         	0x00000001070a1f3b 0x107076000 + 180027
3   org.qt-project.QtCore         	0x00000001070a1df2 QWaitCondition::wait(QMutex*, unsigned long) + 162
4   org.qt-project.QtWidgets      	0x00000001066502c2 0x1063fa000 + 2450114
5   org.qt-project.QtCore         	0x00000001070a091a 0x107076000 + 174362
6   libsystem_pthread.dylib       	0x00007fffbe3c9abb _pthread_body + 180
7   libsystem_pthread.dylib       	0x00007fffbe3c9a07 _pthread_start + 286
8   libsystem_pthread.dylib       	0x00007fffbe3c9231 thread_start + 13

Thread 4:: com.apple.NSEventThread
0   libsystem_kernel.dylib        	0x00007fffbe2da41a mach_msg_trap + 10
1   libsystem_kernel.dylib        	0x00007fffbe2d9867 mach_msg + 55
2   com.apple.CoreFoundation      	0x00007fffa91748d4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation      	0x00007fffa9173d61 __CFRunLoopRun + 1361
4   com.apple.CoreFoundation      	0x00007fffa91735b4 CFRunLoopRunSpecific + 420
5   com.apple.AppKit              	0x00007fffa6f57e9e _NSEventThread + 205
6   libsystem_pthread.dylib       	0x00007fffbe3c9abb _pthread_body + 180
7   libsystem_pthread.dylib       	0x00007fffbe3c9a07 _pthread_start + 286
8   libsystem_pthread.dylib       	0x00007fffbe3c9231 thread_start + 13

Thread 5:
0   libsystem_pthread.dylib       	0x00007fffbe3c9214 start_wqthread + 0
1   ???                           	0x007865646e496d65 0 + 33888479226719589

Thread 6:
0   libsystem_kernel.dylib        	0x00007fffbe2e24e6 __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x00007fffbe3c97c5 _pthread_wqthread + 1426
2   libsystem_pthread.dylib       	0x00007fffbe3c9221 start_wqthread + 13

Thread 7:
0   libsystem_kernel.dylib        	0x00007fffbe2e24e6 __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x00007fffbe3c97c5 _pthread_wqthread + 1426
2   libsystem_pthread.dylib       	0x00007fffbe3c9221 start_wqthread + 13

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000608001a6c800  rcx: 0x00000000fffffffe  rdx: 0x000000000000000a
  rdi: 0x0000000000000000  rsi: 0x000000000000000a  rbp: 0x00007fff5b7a5020  rsp: 0x00007fff5b7a5020
   r8: 0x0000000104e70ef1   r9: 0x00007fdf149d8100  r10: 0x0000000109591100  r11: 0x000000010564cf70
  r12: 0x00006080002a0e50  r13: 0x00006080008f4280  r14: 0x0000000104e972e0  r15: 0x0000608000833280
  rip: 0x000000010564cf74  rfl: 0x0000000000010206  cr2: 0x0000000000000010
  
Logical CPU:     2
Error Code:      0x00000004
Trap Number:     14
Comment 1 Halla Rempt 2016-10-23 12:49:19 UTC
Hi,

Thanks for your report. The gimp xcf images I've tried do work. Which version of Gimp did you save the image with? And could you attach an image that causes the crash (or, if they're private, mail directly to boud@kde.org)?
Comment 2 Enzo_01 2016-10-23 12:53:46 UTC
Created attachment 101720 [details]
evrosportcom-logo.xcf

 Hi,  
  Crash happen everytime with the attached image. I have used Gimp-2.9cc not sure, but almost sure it's from Partha's builds.  
 -- Regards







 >-------- Оригинално писмо --------

 >От: Boudewijn Rempt via KDE Bugzilla bugzilla_noreply@kde.org

 >Относно: [krita] [Bug 371523] Crash when open xcf (gimp) files

 >До: Enzo_01@abv.bg

 >Изпратено на: 23.10.2016 15:49


 https://bugs.kde.org/show_bug.cgi?id=371523 



Boudewijn Rempt  boud@valdyas.org > changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

           Platform|Homebrew (Mac OS X)         |Mac OS X Disk Images

                 CC|                            |boud@valdyas.org



--- Comment #1 from Boudewijn Rempt  boud@valdyas.org > ---

Hi,



Thanks for your report. The gimp xcf images I've tried do work. Which version

of Gimp did you save the image with? And could you attach an image that causes

the crash (or, if they're private, mail directly to boud@kde.org)?
Comment 3 Halla Rempt 2016-10-23 13:40:48 UTC
Thanks! That's a version 8 image, so Krita cannot load it -- gimp's updated file format is even more undocumented than the older one -- but Krita shouldn't abort on loading it, of course.
Comment 4 Halla Rempt 2016-10-23 14:25:23 UTC
Git commit adf8f6ee59820f5147a60af82bc3ff7e2f873153 by Boudewijn Rempt.
Committed on 23/10/2016 at 14:25.
Pushed by rempt into branch 'master'.
Related: bug 2, bug 9

Krita cannot load Gimp 2.9 files (and never will be, probably,
because xcf-tools isn't maintained anymore and the file format
is un(der)documented). But we shouldn't crash and burn trying
to load them anyway.

This adds two new strings for translation, I'm afraid :-(

CCMAIL:kde-i18n-doc@kde.org

M  +5    -0    libs/ui/KisImportExportFilter.cpp
M  +1    -0    libs/ui/KisImportExportFilter.h
M  +9    -11   plugins/impex/xcf/3rdparty/xcftools/xcf-general.c
M  +6    -0    plugins/impex/xcf/kis_xcf_import.cpp

http://commits.kde.org/krita/adf8f6ee59820f5147a60af82bc3ff7e2f873153