Bug 398826 - On 16bits images, applying "w)_Texture_normal_map" make crash Krita
Summary: On 16bits images, applying "w)_Texture_normal_map" make crash Krita
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Brush Engine/Shape (show other bugs)
Version: 4.1.1
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Eoin O'Neill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-19 00:53 UTC by Rafael Linux User
Modified: 2018-10-11 08:28 UTC (History)
2 users (show)

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 Rafael Linux User 2018-09-19 00:53:20 UTC
When trying to apply brush "w)_Texture_normal_map" on some images (AdobeRGB color profile, 16bits depth) Krita crashes.
Comment 1 Halla Rempt 2018-09-19 07:41:07 UTC
I can confirm the crash:

Thread 33 "Thread (pooled)" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fff73fc7700 (LWP 10399)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff4059801 in __GI_abort () at abort.c:79
#2  0x00007ffff40a2897 in __libc_message (action=action@entry=do_abort, 
    fmt=fmt@entry=0x7ffff41cf988 "*** %s ***: %s terminated\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff414dcd1 in __GI___fortify_fail_abort (need_backtrace=need_backtrace@entry=false, 
    msg=msg@entry=0x7ffff41cf966 "stack smashing detected") at fortify_fail.c:33
#4  0x00007ffff414dc92 in __stack_chk_fail () at stack_chk_fail.c:29
#5  0x00007fffbc644492 in KisTangentNormalPaintOp::paintAt (this=0x7fff80015420, info=...)
    at /home/boud/dev/krita/plugins/paintops/tangentnormal/kis_tangent_normal_paintop.cpp:172
#6  0x00007ffff1b33902 in KisPaintInformation::paintAt<KisPaintOp> (distanceInfo=0x55555f5a3840, op=..., 
    this=0x7fff73fc6840) at /home/boud/dev/krita/libs/image/brushengine/kis_paint_information.h:117
#7  KisPaintOp::paintAt (this=0x7fff80015420, info=..., currentDistance=0x55555f5a3840)
    at /home/boud/dev/krita/libs/image/brushengine/kis_paintop.cc:166
#8  0x00007ffff1b08ec5 in KisPainter::paintAt (this=<optimized out>, pi=..., savedDist=<optimized out>)
    at /home/boud/dev/krita/libs/image/kis_painter.cc:1239
#9  0x00007ffff7290133 in KisMaskedFreehandStrokePainter::<lambda(KisFreehandStrokeInfo*)>::operator() (
    data=<optimized out>, data=<optimized out>, __closure=<synthetic pointer>)
    at /home/boud/dev/krita/libs/ui/tool/strokes/KisMaskedFreehandStrokePainter.cpp:53
#10 KisMaskedFreehandStrokePainter::applyToAllPainters<KisMaskedFreehandStrokePainter::paintAt(const KisPaintInformation&)::<lambda(KisFreehandStrokeInfo*)> > (func=..., this=this@entry=0x7fff8004e6b0)
    at /home/boud/dev/krita/libs/ui/tool/strokes/KisMaskedFreehandStrokePainter.cpp:43
#11 KisMaskedFreehandStrokePainter::paintAt (this=this@entry=0x7fff8004e6b0, pi=...)
    at /home/boud/dev/krita/libs/ui/tool/strokes/KisMaskedFreehandStrokePainter.cpp:52
#12 0x00007ffff7280ceb in FreehandStrokeStrategy::doStrokeCallback (this=0x555562094c20, data=<optimized out>)
    at /home/boud/dev/krita/libs/ui/tool/strokes/freehand_stroke.cpp:163
#13 0x00007ffff1ea8613 in non-virtual thunk to KisUpdateJobItem::run() ()
   from /home/boud/dev/i-krita/lib/x86_64-linux-gnu/libkritaimage.so.18
#14 0x00007ffff4a56fd2 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007ffff4a5faab in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007fffed7a86db in start_thread (arg=0x7fff73fc7700) at pthread_create.c:463
#17 0x00007ffff413a88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Comment 2 Eoin O'Neill 2018-10-10 09:37:48 UTC
Git commit f7e40ac3580422e81ca341c127aa0b4831f495f8 by Eoin O'Neill.
Committed on 10/10/2018 at 09:37.
Pushed by eoinoneill into branch 'master'.

Kis Tangent Normal Paintop Now Works in 16-Bit and 32-Bit Image Modes.

This updates the normal paint-top to work properly in non-8bit image modes. I believe that most
normal maps are usually 8bit, but this will at least prevent a crash and produce the expected
behavior regardless of image mode.

M  +1    -1    plugins/paintops/tangentnormal/kis_tangent_normal_paintop.cpp

https://commits.kde.org/krita/f7e40ac3580422e81ca341c127aa0b4831f495f8
Comment 3 Halla Rempt 2018-10-11 08:23:20 UTC
Git commit a03374d83dfbab152528b9cae2626c414e6c5e23 by Boudewijn Rempt, on behalf of Eoin O'Neill.
Committed on 11/10/2018 at 07:52.
Pushed by rempt into branch 'krita/4.1'.

Kis Tangent Normal Paintop Now Works in 16-Bit and 32-Bit Image Modes.

This updates the normal paint-top to work properly in non-8bit image modes. I believe that most
normal maps are usually 8bit, but this will at least prevent a crash and produce the expected
behavior regardless of image mode.

(cherry picked from commit f7e40ac3580422e81ca341c127aa0b4831f495f8)

M  +1    -1    plugins/paintops/tangentnormal/kis_tangent_normal_paintop.cpp

https://commits.kde.org/krita/a03374d83dfbab152528b9cae2626c414e6c5e23
Comment 4 Rafael Linux User 2018-10-11 08:28:22 UTC
Thank your for the quick fix!