Bug 331702 - PSD filter crashes on saving a 16 bit image
Summary: PSD filter crashes on saving a 16 bit image
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2014-03-03 14:22 UTC by Halla Rempt
Modified: 2014-03-05 15:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Halla Rempt 2014-03-03 14:22:44 UTC
Application: krita (2.9 Pre-Alpha (git e573728))
KDE Platform Version: 4.11.5
Qt Version: 4.8.5
Operating System: Linux 3.11.6-4-desktop x86_64
Distribution: "openSUSE 13.1 (Bottle) (x86_64)"

-- Information about the crash:
Create a 16 bit integer rgb image, add a layer. Fill the layer with someting, save as PSD,

The crash can be reproduced every time.

-- Backtrace:
Application: Krita (krita), signal: Aborted
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f58ba25e880 (LWP 16662))]

Thread 8 (Thread 0x7f588f360700 (LWP 16663)):
#0  0x00007f58b267f0af in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f58b2912b66 in wait (time=18446744073709551615, this=0x2837f70) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=<optimized out>, mutex=mutex@entry=0x2837f00, time=time@entry=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00007f58b290ecfb in QSemaphore::acquire (this=this@entry=0x2837c20, n=n@entry=1) at thread/qsemaphore.cpp:144
#4  0x00007f58b91ebacc in waitForWork (this=0x2837c10) at /home/boud/kde/src/calligra/krita/image/tiles3/kis_tile_data_pooler.cc:162
#5  KisTileDataPooler::run (this=0x2837c10) at /home/boud/kde/src/calligra/krita/image/tiles3/kis_tile_data_pooler.cc:184
#6  0x00007f58b291268f in QThreadPrivate::start (arg=0x2837c10) at thread/qthread_unix.cpp:338
#7  0x00007f58b267b0db in start_thread () from /lib64/libpthread.so.0
#8  0x00007f58b193190d in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x7f588eb5f700 (LWP 16664)):
#0  0x00007f58b267f0af in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f58b2912b66 in wait (time=18446744073709551615, this=0x2804870) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=<optimized out>, mutex=mutex@entry=0x2804840, time=time@entry=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00007f58b290f103 in QSemaphore::tryAcquire (this=0x28047f0, n=n@entry=1, timeout=timeout@entry=-1) at thread/qsemaphore.cpp:221
#4  0x00007f58b9216c33 in KisTileDataSwapper::waitForWork (this=this@entry=0x2837c48) at /home/boud/kde/src/calligra/krita/image/tiles3/swap/kis_tile_data_swapper.cpp:86
#5  0x00007f58b9216e5a in KisTileDataSwapper::run (this=0x2837c48) at /home/boud/kde/src/calligra/krita/image/tiles3/swap/kis_tile_data_swapper.cpp:92
#6  0x00007f58b291268f in QThreadPrivate::start (arg=0x2837c48) at thread/qthread_unix.cpp:338
#7  0x00007f58b267b0db in start_thread () from /lib64/libpthread.so.0
#8  0x00007f58b193190d in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7f588cce9700 (LWP 16671)):
#0  0x00007f58b192a913 in select () from /lib64/libc.so.6
#1  0x00007f58b2a3c6fb in qt_safe_select (nfds=26, fdread=0x44e75b8, fdwrite=0x44e7850, fdexcept=0x44e7ae8, orig_timeout=0x0) at kernel/qcore_unix.cpp:83
#2  0x00007f58b2a42374 in QEventDispatcherUNIXPrivate::doSelect (this=this@entry=0x44e7400, flags=..., timeout=0x0) at kernel/qeventdispatcher_unix.cpp:223
#3  0x00007f58b2a427d2 in QEventDispatcherUNIX::processEvents (this=0x44ed720, flags=...) at kernel/qeventdispatcher_unix.cpp:951
#4  0x00007f58b2a10d0f in QEventLoop::processEvents (this=this@entry=0x7f588cce8d20, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f58b2a11005 in QEventLoop::exec (this=this@entry=0x7f588cce8d20, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f58b290ffef in QThread::exec (this=this@entry=0x44eb900) at thread/qthread.cpp:536
#7  0x00007f58b29f2513 in QInotifyFileSystemWatcherEngine::run (this=0x44eb900) at io/qfilesystemwatcher_inotify.cpp:256
#8  0x00007f58b291268f in QThreadPrivate::start (arg=0x44eb900) at thread/qthread_unix.cpp:338
#9  0x00007f58b267b0db in start_thread () from /lib64/libpthread.so.0
#10 0x00007f58b193190d in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7f587f944700 (LWP 16692)):
#0  0x00007f58b267f0af in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f58b2912b66 in wait (time=18446744073709551615, this=0x6069da0) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=this@entry=0x60698c8, mutex=mutex@entry=0x60698c0, time=time@entry=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00007f58b3b78ac6 in QFileInfoGatherer::run (this=0x60698b0) at dialogs/qfileinfogatherer.cpp:214
#4  0x00007f58b291268f in QThreadPrivate::start (arg=0x60698b0) at thread/qthread_unix.cpp:338
#5  0x00007f58b267b0db in start_thread () from /lib64/libpthread.so.0
#6  0x00007f58b193190d in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7f587f143700 (LWP 16693)):
#0  0x00007f58b192a913 in select () from /lib64/libc.so.6
#1  0x00007f58b2a3c6fb in qt_safe_select (nfds=39, fdread=0x6073628, fdwrite=0x60738c0, fdexcept=0x6073b58, orig_timeout=0x0) at kernel/qcore_unix.cpp:83
#2  0x00007f58b2a42374 in QEventDispatcherUNIXPrivate::doSelect (this=this@entry=0x6073470, flags=..., timeout=0x0) at kernel/qeventdispatcher_unix.cpp:223
#3  0x00007f58b2a427d2 in QEventDispatcherUNIX::processEvents (this=0x4178770, flags=...) at kernel/qeventdispatcher_unix.cpp:951
#4  0x00007f58b2a10d0f in QEventLoop::processEvents (this=this@entry=0x7f587f142d20, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f58b2a11005 in QEventLoop::exec (this=this@entry=0x7f587f142d20, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f58b290ffef in QThread::exec (this=this@entry=0x6069f60) at thread/qthread.cpp:536
#7  0x00007f58b29f2513 in QInotifyFileSystemWatcherEngine::run (this=0x6069f60) at io/qfilesystemwatcher_inotify.cpp:256
#8  0x00007f58b291268f in QThreadPrivate::start (arg=0x6069f60) at thread/qthread_unix.cpp:338
#9  0x00007f58b267b0db in start_thread () from /lib64/libpthread.so.0
#10 0x00007f58b193190d in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7f58724ec700 (LWP 16705)):
#0  0x00007f58b192a913 in select () from /lib64/libc.so.6
#1  0x00007f58b2a3c6fb in qt_safe_select (nfds=50, fdread=0x4b9f888, fdwrite=0x4b9fb20, fdexcept=0x4b9fdb8, orig_timeout=0x0) at kernel/qcore_unix.cpp:83
#2  0x00007f58b2a42374 in QEventDispatcherUNIXPrivate::doSelect (this=this@entry=0x4b9f6d0, flags=..., timeout=0x0) at kernel/qeventdispatcher_unix.cpp:223
#3  0x00007f58b2a427d2 in QEventDispatcherUNIX::processEvents (this=0x6ec8180, flags=...) at kernel/qeventdispatcher_unix.cpp:951
#4  0x00007f58b2a10d0f in QEventLoop::processEvents (this=this@entry=0x7f58724ebd20, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f58b2a11005 in QEventLoop::exec (this=this@entry=0x7f58724ebd20, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f58b290ffef in QThread::exec (this=this@entry=0x4b9cb10) at thread/qthread.cpp:536
#7  0x00007f58b29f2513 in QInotifyFileSystemWatcherEngine::run (this=0x4b9cb10) at io/qfilesystemwatcher_inotify.cpp:256
#8  0x00007f58b291268f in QThreadPrivate::start (arg=0x4b9cb10) at thread/qthread_unix.cpp:338
#9  0x00007f58b267b0db in start_thread () from /lib64/libpthread.so.0
#10 0x00007f58b193190d in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7f5871b95700 (LWP 16711)):
#0  0x00007f58b192a913 in select () from /lib64/libc.so.6
#1  0x00007f58b29ef261 in QProcessManager::run (this=0x7f58b2d78520 <processManager()::processManager>) at io/qprocess_unix.cpp:247
#2  0x00007f58b291268f in QThreadPrivate::start (arg=0x7f58b2d78520 <processManager()::processManager>) at thread/qthread_unix.cpp:338
#3  0x00007f58b267b0db in start_thread () from /lib64/libpthread.so.0
#4  0x00007f58b193190d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f58ba25e880 (LWP 16662)):
[KCrash Handler]
#6  0x00007f58b187f849 in raise () from /lib64/libc.so.6
#7  0x00007f58b1880cd8 in abort () from /lib64/libc.so.6
#8  0x00007f58b2908204 in qt_message_output (msgType=msgType@entry=QtFatalMsg, buf=<optimized out>) at global/qglobal.cpp:2323
#9  0x00007f58b2908389 in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=msgType@entry=QtFatalMsg, msg=msg@entry=0x7f58b2a73540 "ASSERT failure in %s: \"%s\", file %s, line %d", ap=ap@entry=0x7ffff726e188) at global/qglobal.cpp:2369
#10 0x00007f58b2908b94 in qFatal (msg=msg@entry=0x7f58b2a73540 "ASSERT failure in %s: \"%s\", file %s, line %d") at global/qglobal.cpp:2552
#11 0x00007f58b2908bfe in qt_assert_x (where=where@entry=0x7f5870b5afaf "QVector<T>::operator[]", what=what@entry=0x7f5870b5a802 "index out of range", file=file@entry=0x7f5870b5a700 "/usr/include/QtCore/qvector.h", line=line@entry=359) at global/qglobal.cpp:2026
#12 0x00007f5870b42aed in operator[] (i=4, this=0x7ffff726e330) at /usr/include/QtCore/qvector.h:359
#13 PSDLayerRecord::writePixelData (this=this@entry=0x415c9b0, io=io@entry=0x7ffff726ec50) at /home/boud/kde/src/calligra/krita/plugins/formats/psd/psd_layer_record.cpp:644
#14 0x00007f5870b3c5d1 in PSDLayerSection::write (this=this@entry=0x7ffff726ed50, io=io@entry=0x7ffff726ec50, rootLayer=...) at /home/boud/kde/src/calligra/krita/plugins/formats/psd/psd_layer_section.cpp:347
#15 0x00007f5870b2b40a in PSDSaver::buildFile (this=this@entry=0x7ffff726efc0, uri=...) at /home/boud/kde/src/calligra/krita/plugins/formats/psd/psd_saver.cpp:195
#16 0x00007f5870b27f8d in psdExport::convert (this=<optimized out>, from=..., to=...) at /home/boud/kde/src/calligra/krita/plugins/formats/psd/psd_export.cc:89
#17 0x00007f58b8eae8af in CalligraFilter::ChainLink::invokeFilter (this=0xa966af0, parentChainLink=parentChainLink@entry=0x0) at /home/boud/kde/src/calligra/libs/main/KoFilterChainLink.cpp:90
#18 0x00007f58b8ea5aa2 in KoFilterChain::invokeChain (this=0xa9ebb10) at /home/boud/kde/src/calligra/libs/main/KoFilterChain.cpp:95
#19 0x00007f58b8ea0c16 in KoFilterManager::exportDocument (this=0xab34320, url=..., mimeType=...) at /home/boud/kde/src/calligra/libs/main/KoFilterManager.cpp:243
#20 0x00007f58b8e26a5e in KoDocument::saveFile (this=0x3e94c40) at /home/boud/kde/src/calligra/libs/main/KoDocument.cpp:590
#21 0x00007f58b8e31b2d in KoDocument::save (this=0x3e94c40) at /home/boud/kde/src/calligra/libs/main/KoDocument.cpp:2521
#22 0x00007f58b8e335ff in KoDocument::saveAs (this=0x3e94c40, kurl=...) at /home/boud/kde/src/calligra/libs/main/KoDocument.cpp:2487
#23 0x00007f58b8e59b08 in KoMainWindow::saveDocument (this=this@entry=0x3fc6170, saveas=<optimized out>, saveas@entry=true, silent=silent@entry=false, specialOutputFlag=specialOutputFlag@entry=0) at /home/boud/kde/src/calligra/libs/main/KoMainWindow.cpp:1082
#24 0x00007f58b8e5af92 in KoMainWindow::slotFileSaveAs (this=this@entry=0x3fc6170) at /home/boud/kde/src/calligra/libs/main/KoMainWindow.cpp:1355
#25 0x00007f58b8e6763d in KoMainWindow::qt_static_metacall (_o=0x3fc6170, _c=<optimized out>, _id=9, _a=0x7ffff726fd10) at /home/boud/kde/build/calligra/libs/main/KoMainWindow.moc:134
#26 0x00007f58b2a25d68 in QMetaObject::activate (sender=sender@entry=0x4010850, m=m@entry=0x7f58b41422a0 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffff726fd10) at kernel/qobject.cpp:3556
#27 0x00007f58b369a752 in QAction::triggered (this=this@entry=0x4010850, _t1=false) at .moc/release-shared/moc_qaction.cpp:276
#28 0x00007f58b369c123 in QAction::activate (this=this@entry=0x4010850, event=event@entry=QAction::Trigger) at kernel/qaction.cpp:1257
#29 0x00007f58b3ac50e9 in QMenuPrivate::activateCausedStack (this=this@entry=0x40a2f60, causedStack=..., action=action@entry=0x4010850, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1038
#30 0x00007f58b3ac9619 in QMenuPrivate::activateAction (this=0x40a2f60, action=0x4010850, action_e=QAction::Trigger, self=<optimized out>) at widgets/qmenu.cpp:1130
#31 0x00007f58b3acb8a7 in QMenu::keyPressEvent (this=this@entry=0x3ec4490, e=e@entry=0x7ffff72703a0) at widgets/qmenu.cpp:2826
#32 0x00007f58b446d3f0 in KMenu::keyPressEvent (this=0x3ec4490, e=0x7ffff72703a0) at /usr/src/debug/kdelibs-4.11.5/kdeui/widgets/kmenu.cpp:224
#33 0x00007f58b36efcca in QWidget::event (this=this@entry=0x3ec4490, event=event@entry=0x7ffff72703a0) at kernel/qwidget.cpp:8422
#34 0x00007f58b3acd3eb in QMenu::event (this=0x3ec4490, e=0x7ffff72703a0) at widgets/qmenu.cpp:2481
#35 0x00007f58b36a08ac in QApplicationPrivate::notify_helper (this=this@entry=0x2093a70, receiver=receiver@entry=0x3ec4490, e=e@entry=0x7ffff72703a0) at kernel/qapplication.cpp:4562
#36 0x00007f58b36a80c1 in QApplication::notify (this=<optimized out>, receiver=receiver@entry=0x3ec4490, e=e@entry=0x7ffff72703a0) at kernel/qapplication.cpp:4003
#37 0x00007f58b8e203e7 in KoApplication::notify (this=<optimized out>, receiver=0x3ec4490, event=0x7ffff72703a0) at /home/boud/kde/src/calligra/libs/main/KoApplication.cpp:595
#38 0x00007f58b2a120ad in QCoreApplication::notifyInternal (this=0x7ffff7270cb0, receiver=receiver@entry=0x3ec4490, event=event@entry=0x7ffff72703a0) at kernel/qcoreapplication.cpp:949
#39 0x00007f58b369f246 in sendSpontaneousEvent (event=event@entry=0x7ffff72703a0, receiver=receiver@entry=0x3ec4490) at ../../src/corelib/kernel/qcoreapplication.h:234
#40 qt_sendSpontaneousEvent (receiver=receiver@entry=0x3ec4490, event=event@entry=0x7ffff72703a0) at kernel/qapplication.cpp:5560
#41 0x00007f58b373ad79 in QKeyMapper::sendKeyEvent (keyWidget=keyWidget@entry=0x3ec4490, grab=grab@entry=false, type=QEvent::KeyPress, code=65, modifiers=..., text=..., autorepeat=autorepeat@entry=false, count=1, nativeScanCode=38, nativeVirtualKey=97, nativeModifiers=0) at kernel/qkeymapper_x11.cpp:1866
#42 0x00007f58b373b119 in QKeyMapperPrivate::translateKeyEvent (this=0x20eda70, keyWidget=keyWidget@entry=0x3ec4490, event=event@entry=0x7ffff7270930, grab=grab@entry=false) at kernel/qkeymapper_x11.cpp:1836
#43 0x00007f58b3716d3f in QApplication::x11ProcessEvent (this=0x7ffff7270cb0, event=event@entry=0x7ffff7270930) at kernel/qapplication_x11.cpp:3544
#44 0x00007f58b373e1f0 in QEventDispatcherX11::processEvents (this=0x1f77790, flags=...) at kernel/qeventdispatcher_x11.cpp:132
#45 0x00007f58b2a10d0f in QEventLoop::processEvents (this=this@entry=0x7ffff7270b90, flags=...) at kernel/qeventloop.cpp:149
#46 0x00007f58b2a11005 in QEventLoop::exec (this=this@entry=0x7ffff7270b90, flags=...) at kernel/qeventloop.cpp:204
#47 0x00007f58b2a1613b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1221
#48 0x00007f58b369f06c in QApplication::exec () at kernel/qapplication.cpp:3823
#49 0x00007f58b9e5fd5c in kdemain (argc=<optimized out>, argv=<optimized out>) at /home/boud/kde/src/calligra/krita/main.cc:108
#50 0x00007f58b186bbe5 in __libc_start_main () from /lib64/libc.so.6
#51 0x00000000004009e1 in _start () at ../sysdeps/x86_64/start.S:122

Reported using DrKonqi
Comment 1 Halla Rempt 2014-03-03 14:24:00 UTC
See also http://krita-breakpad.kogmbh.net:1127/view/d13c2201-2a16-4e66-ab3b-73e2cfea3069:

Thread 0 (crashed)
 0  kritapsdexport.dll!PSDLayerRecord::writePixelData(QIODevice *) [psd_layer_record.cpp : 669 + 0x0]
    rbx = 0x0000000000000000   r12 = 0x0000000000000700
    r13 = 0x0000001427cfcaa0   r14 = 0x000000145834a750
    r15 = 0x0000000000000000   rip = 0x000007fd1adb505f
    rsp = 0x000000145834a2d0   rbp = 0x000000145834a3d0
    Found by: given as instruction pointer in context
 1  QtCore4.dll + 0x2bfb68
    rip = 0x0000000075e7fb68   rsp = 0x000000145834a320
    rbp = 0x000000145834a3d0
    Found by: stack scanning
 2  QtCore4.dll + 0x2bfb68
    rip = 0x0000000075e7fb68   rsp = 0x000000145834a348
    rbp = 0x000000145834a3d0
    Found by: stack scanning
 3  QtCore4.dll + 0xaec1b
    rip = 0x0000000075c6ec1b   rsp = 0x000000145834a350
    rbp = 0x000000145834a3d0
    Found by: stack scanning
 4  kritapsdexport.dll!PSDLayerRecord::write(QIODevice *,KisSharedPtr<KisNode>) [psd_layer_record.cpp : 615 + 0x13]
    rip = 0x000007fd1adb463c   rsp = 0x000000145834a390
    rbp = 0x000000145834a3d0
    Found by: stack scanning
 5  kowidgets.dll + 0xc0001
    rip = 0x000007fd00000001   rsp = 0x000000145834a3c0
    rbp = 0x000000145834a3d0
    Found by: stack scanning
 6  kowidgetutils.dll!KoProperties::property(QString const &) [koproperties.cpp : 143 + 0x30]
    rip = 0x000007fd0808921e   rsp = 0x000000145834a400
    Found by: stack scanning
 7  kritaimage.dll + 0xe9feb
    rip = 0x000007fd00309feb   rsp = 0x000000145834a460
    Found by: stack scanning
 8  msvcr110.dll + 0x66388
    rip = 0x000007fd04706388   rsp = 0x000000145834a470
    Found by: stack scanning
 9  kritapsdexport.dll!PSDLayerSection::write(QIODevice *,KisSharedPtr<KisNode>) [psd_layer_section.cpp : 347 + 0xb]
    rip = 0x000007fd1ada90eb   rsp = 0x000000145834a4f0
    Found by: stack scanning
10  QtCore4.dll + 0x2bfae0
    rip = 0x0000000075e7fae0   rsp = 0x000000145834a5e0
    Found by: stack scanning
11  msvcr110.dll + 0x66388
    rip = 0x000007fd04706388   rsp = 0x000000145834a650
    Found by: stack scanning
12  kritapsdexport.dll!PSDResourceSection::write(QIODevice *) [psd_resource_section.cpp : 102 + 0x30]
    rip = 0x000007fd1ad9dcd3   rsp = 0x000000145834a680
    Found by: stack scanning
13  kdecore.dll + 0xacfaf
    rip = 0x000007fd0071cfaf   rsp = 0x000000145834a6d0
    Found by: stack scanning
14  kritapsdexport.dll!PSDSaver::buildFile(KUrl const &) [psd_saver.cpp : 195 + 0x39]
Comment 2 Halla Rempt 2014-03-03 16:16:07 UTC
Git commit 04700d2c12458694a21b3aa3ea000ca62ec82e08 by Boudewijn Rempt.
Committed on 03/03/2014 at 16:15.
Pushed by rempt into branch 'calligra/2.8'.
Related: bug 16

We need to order channels by display position, not byte position...

M  +3    -2    krita/plugins/formats/psd/psd_layer_record.cpp

http://commits.kde.org/calligra/04700d2c12458694a21b3aa3ea000ca62ec82e08
Comment 3 Halla Rempt 2014-03-05 15:57:13 UTC
Git commit a09d09c32f6cbaf67a70c0e51b757a1e9f4b7a95 by Boudewijn Rempt.
Committed on 03/03/2014 at 16:15.
Pushed by rempt into branch 'master'.
Related: bug 16

We need to order channels by display position, not byte position...

M  +3    -2    krita/plugins/formats/psd/psd_layer_record.cpp

http://commits.kde.org/calligra/a09d09c32f6cbaf67a70c0e51b757a1e9f4b7a95