Bug 350714 - Crash when trying to merge layer with metadata
Summary: Crash when trying to merge layer with metadata
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (other bugs)
Version First Reported In: 2.9.2
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2015-07-28 17:37 UTC by Aurélien Léger
Modified: 2016-06-16 10:04 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Test file provided to fix the bug (2.91 MB, application/x-krita)
2015-08-03 19:08 UTC, Aurélien Léger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aurélien Léger 2015-07-28 17:37:21 UTC
Application: krita (2.9.2)
KDE Platform Version: 4.14.6
Qt Version: 4.8.6
Operating System: Linux 3.19.0-23-generic x86_64
Distribution: Ubuntu 15.04

-- Information about the crash:
- What I was doing when the application crashed:
Saving document (as .jpeg) with multiple layers with metadata using the smart option to merge metadata informations.

One layer was a image imported as layer while two others was added when document created.

-- 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 0x7f1d7fd497c0 (LWP 22812))]

Thread 8 (Thread 0x7f1d624dc700 (LWP 22815)):
#0  0x00007f1d7d0448dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f1d7703cebc in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f1d7703d242 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f1d6a96daf6 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007f1d77063955 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f1d775226aa in start_thread (arg=0x7f1d624dc700) at pthread_create.c:333
#6  0x00007f1d7d04feed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 7 (Thread 0x7f1d6135d700 (LWP 22816)):
#0  0x00007f1d7d0448dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f1d7703cebc in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f1d7703cfcc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f1d7703d009 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f1d77063955 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f1d775226aa in start_thread (arg=0x7f1d6135d700) at pthread_create.c:333
#6  0x00007f1d7d04feed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 6 (Thread 0x7f1d5bfff700 (LWP 22875)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f1d7d8b4c56 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007f1d7d8b0a7b in QSemaphore::acquire(int) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#3  0x00007f1d7bf2c01e in waitForWork (this=0x25c3370) at /build/buildd/krita-testing-2+git20150423+r73162-51/krita/image/tiles3/kis_tile_data_pooler.cc:162
#4  KisTileDataPooler::run (this=0x25c3370) at /build/buildd/krita-testing-2+git20150423+r73162-51/krita/image/tiles3/kis_tile_data_pooler.cc:184
#5  0x00007f1d7d8b46ff in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#6  0x00007f1d775226aa in start_thread (arg=0x7f1d5bfff700) at pthread_create.c:333
#7  0x00007f1d7d04feed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 5 (Thread 0x7f1d60b5c700 (LWP 22876)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
#1  0x00007f1d7d8b31da in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007f1d7d8b3a9d in QThread::msleep(unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#3  0x00007f1d7bf5618a in KisTileDataSwapper::run (this=0x25c33a8) at /build/buildd/krita-testing-2+git20150423+r73162-51/krita/image/tiles3/swap/kis_tile_data_swapper.cpp:97
#4  0x00007f1d7d8b46ff in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#5  0x00007f1d775226aa in start_thread (arg=0x7f1d60b5c700) at pthread_create.c:333
#6  0x00007f1d7d04feed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 4 (Thread 0x7f1d3ecd1700 (LWP 22877)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f1d7d8b4c56 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007f1d7e8dd91d in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#3  0x00007f1d7d8b46ff in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#4  0x00007f1d775226aa in start_thread (arg=0x7f1d3ecd1700) at pthread_create.c:333
#5  0x00007f1d7d04feed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7f1d3d4ce700 (LWP 22878)):
#0  0x00007f1d7d0448dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f1d7703cebc in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f1d7703cfcc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f1d7d9ee87e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#4  0x00007f1d7d9bdd21 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#5  0x00007f1d7d9be085 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#6  0x00007f1d7d8b1e89 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7  0x00007f1d7d99e493 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8  0x00007f1d7d8b46ff in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x00007f1d775226aa in start_thread (arg=0x7f1d3d4ce700) at pthread_create.c:333
#10 0x00007f1d7d04feed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7f1d3cccd700 (LWP 23455)):
#0  0x00007f1d7d046743 in select () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f1d7d99ac0f in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007f1d7d8b46ff in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#3  0x00007f1d775226aa in start_thread (arg=0x7f1d3cccd700) at pthread_create.c:333
#4  0x00007f1d7d04feed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7f1d7fd497c0 (LWP 22812)):
[KCrash Handler]
#6  0x00007f1d7cf7e267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#7  0x00007f1d7cf7feca in __GI_abort () at abort.c:89
#8  0x00007f1d7d8a9a8a in qt_message_output(QtMsgType, char const*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x00007f1d7d8a9df9 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#10 0x00007f1d7d8aa6e1 in qFatal(char const*, ...) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#11 0x00007f1d7c1e117a in KisMetaData::Value::operator= (this=0x165b0b80, v=...) at /build/buildd/krita-testing-2+git20150423+r73162-51/krita/image/metadata/kis_meta_data_value.cc:85
#12 0x00007f1d7c1c5af1 in KisMetaData::SmartMergeStrategy::mergeEntry (this=this@entry=0x1cf1480, dst=dst@entry=0x13b68310, srcs=..., schema=schema@entry=0x585b250, identifier=...) at /build/buildd/krita-testing-2+git20150423+r73162-51/krita/image/metadata/kis_meta_data_merge_strategy_p.cc:238
#13 0x00007f1d7c1c7729 in KisMetaData::SmartMergeStrategy::merge (this=this@entry=0x1cf1480, dst=0x13b68310, srcs=..., scores=...) at /build/buildd/krita-testing-2+git20150423+r73162-51/krita/image/metadata/kis_meta_data_merge_strategy_p.cc:300
#14 0x00007f1d7c0bc7f2 in KisImage::mergeDown (this=0x46fd900, layer=..., strategy=strategy@entry=0x1cf1480) at /build/buildd/krita-testing-2+git20150423+r73162-51/krita/image/kis_image.cc:968
#15 0x00007f1d7f333196 in KisLayerManager::mergeLayer (this=this@entry=0x23a3890) at /build/buildd/krita-testing-2+git20150423+r73162-51/krita/ui/kis_layer_manager.cc:779
#16 0x00007f1d7f33a388 in KisLayerManager::qt_static_metacall (_o=0x23a3890, _c=<optimized out>, _id=1, _a=0x7ffe8e5b4bd0) at /build/buildd/krita-testing-2+git20150423+r73162-51/obj-x86_64-linux-gnu/krita/ui/kis_layer_manager.moc:94
#17 0x00007f1d7d9d41ec in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#18 0x00007f1d7e3c4fd2 in QAction::triggered(bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#19 0x00007f1d7e3c6b57 in QAction::activate(QAction::ActionEvent) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#20 0x00007f1d7e3c70cc in QAction::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#21 0x00007f1d78048fa2 in KAction::event(QEvent*) () from /usr/lib/libkdeui.so.5
#22 0x00007f1d7e3cb9bc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#23 0x00007f1d7e3d24d8 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#24 0x00007f1d7f5a3557 in KisApplication::notify (this=<optimized out>, receiver=0x23a4c60, event=0x7ffe8e5b4fc0) at /build/buildd/krita-testing-2+git20150423+r73162-51/krita/ui/KisApplication.cpp:488
#25 0x00007f1d7d9bf1cd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#26 0x00007f1d7e3ff6ab in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#27 0x00007f1d7e3ff814 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#28 0x00007f1d7e3d3956 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#29 0x00007f1d7f5a3557 in KisApplication::notify (this=<optimized out>, receiver=0x12c2c700, event=0x7ffe8e5b5320) at /build/buildd/krita-testing-2+git20150423+r73162-51/krita/ui/KisApplication.cpp:488
#30 0x00007f1d7d9bf1cd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#31 0x00007f1d7e471023 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#32 0x00007f1d7e4714c2 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#33 0x00007f1d7e44a316 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#34 0x00007f1d7e473ba2 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#35 0x00007f1d7703cc3d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#36 0x00007f1d7703cf20 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#37 0x00007f1d7703cfcc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#38 0x00007f1d7d9ee85e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#39 0x00007f1d7e473c66 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#40 0x00007f1d7d9bdd21 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#41 0x00007f1d7d9be085 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#42 0x00007f1d7d9c3b09 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#43 0x000000000040272c in main (argc=<optimized out>, argv=<optimized out>) at /build/buildd/krita-testing-2+git20150423+r73162-51/krita/main.cc:179

Reported using DrKonqi
Comment 1 Aurélien Léger 2015-07-29 16:01:19 UTC
Having this crash a new time and it was not during the save but during the merge , after using CTRL+E and confirming it with the smart option.
Comment 2 wolthera 2015-08-02 13:39:26 UTC
Hm... Could you provide a test file? (This can be the original file, but at the very least a file on which this can be reproduced)

Having a test-file would make it much easier to fix. You can attach with with the 'add attachment' link, or if you don't want to have this file public, you can sent it to foundation@krita.org with 'File for Bug 350714' as the subject.
Comment 3 Aurélien Léger 2015-08-03 19:08:05 UTC
Created attachment 93868 [details]
Test file provided to fix the bug

One layer (the photo) was imported inside the document as a layer after created the document with 2 layers.

Then some metadata was added via the menu "Layer > Edit metadata" (Layer 2 selected, Layer 1 is the background layer so nothing done on it).

Trying to merge the photo with Layer 2 with the smart option but it crashed.

If I re-open the document after re-launch krita and try to merge again, it seems to work fine.
So I don't understand plainly why it crash only the first time (and so maybe by trying the file yourself it can be not working).

Note: Maybe you will need to re-add the metadata.
Comment 4 wolthera 2015-08-03 19:57:37 UTC
Thanks for the file!

Sometimes bugs happen because two parts of your computer are trying to process similar information, but one happens to be faster at it than the other, and that messes up the process, confusing Krita and causing it to crash. We call this a 'race bug' because it happens due to one of the parts winning a race. There's a chance it may be a bug like that, in which case sometimes it doesn't happen because the race isn't won. This makes them difficult to reproduce.

What could also be the case is that there's some data lying around that confuses Krita. Maybe it happened because you merged down after importing the image? Then we know something's up in the importing code.
Comment 5 Aurélien Léger 2015-08-03 20:18:10 UTC
Thanks for your answer @wolthera.

I proceed like this for the file provided :

1. Create a document with 2 layers (with one as a background with color) [bottom layer]
2. Import the picture as a new layer [top layer]
3. Add some metadata on the second layer [middle layer]
4. Save the document to not lose the stuff if re-testing is needed
5. Try to merge the picture [top layer] with the second [middle] layer with CTRL+E, with the smart option then validate.
6. Then crash!

Note: I tried options others than the smart one but the result was the same.
Comment 6 Halla Rempt 2016-06-16 10:04:17 UTC
Git commit e94555f0c2a28f43c1ebd2fe2fd4cbc57dde9477 by Boudewijn Rempt.
Committed on 16/06/2016 at 10:04.
Pushed by rempt into branch 'krita/3.0'.

M  +0    -1    libs/image/metadata/kis_meta_data_value.cc

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