Bug 414818 - Krita crashes when loading files containing colorize mask
Summary: Krita crashes when loading files containing colorize mask
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Colorize (show other bugs)
Version: 4.2.8
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression, release_blocker
: 414950 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-12-04 11:26 UTC by Regis
Modified: 2020-04-09 13:16 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Example file causing crash (2.59 MB, application/x-krita)
2019-12-04 11:47 UTC, Regis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regis 2019-12-04 11:26:46 UTC
Hi, 

Krita on Windows crashes when trying to load a KRA file with a layer containing a colorize mask.

I tested it on two separate computers (both running Windows 10), with the last Krita release, and both daily builds (stable and nightly).

The only version I could find that can load a similar file was Krita 4.1.7

To reproduce:
1. Simply create a new file, add a colorize mask to a layer.
2. Save the document as .kra, and close it.
3. Try to load that file, it crashes every time.



Here's the info from my last attempt with the stable daily build:

Krita

 Version: 4.2.9-alpha (git 641f066)
 Languages: en_US, en_US
 Hidpi: true

Qt

  Version (compiled): 5.12.5
  Version (loaded): 5.12.5

OS Information

  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.18362
  Pretty Productname: Windows 10 (10.0)
  Product Type: windows
  Product Version: 10

OpenGL Info
 
  Vendor:  "NVIDIA Corporation" 
  Renderer:  "GeForce GTX 1080 Ti/PCIe/SSE2" 
  Version:  "4.6.0 NVIDIA 431.86" 
  Shading language:  "4.60 NVIDIA" 
  Requested format:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
  Current format:    QSurfaceFormat(version 4.6, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::sRGBColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
     Version: 4.6
     Supports deprecated functions true 
     is OpenGL ES: false 

QPA OpenGL Detection Info 
  supportsDesktopGL: true 
  supportsAngleD3D11: true 
  isQtPreferAngle: false 

Hardware Information

  GPU Acceleration: auto
  Memory: 32449 Mb
  Number of Cores: 16
  Swap Location: C:/Users/regis/AppData/Local/Temp
Comment 1 Halla Rempt 2019-12-04 11:38:12 UTC
Hi,

Could you make available one of the files that crashes for you? I cannot reproduce a crash with a test file I've made myself. It might also be useful to add the kritacrash.log which you can find in %LOCALAPPDATA%.
Comment 2 Regis 2019-12-04 11:47:21 UTC
Created attachment 124305 [details]
Example file causing crash
Comment 3 Halla Rempt 2019-12-04 11:52:41 UTC
Thanks! With this file, I can confirm the issue. It's an infinite loop in 

#7710 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x5555673c2bd0, mask=0x5555673b0f90, undoAdapter=0x5555673b2cf0) at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
Comment 4 Halla Rempt 2019-12-04 11:54:39 UTC
Thread 22 "Thread (pooled)" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffbcff9700 (LWP 30410)]
0x00007ffff41d6cdf in __tzstring (s=0x555557004325 "CET") at tzset.c:121
121     tzset.c: No such file or directory.
(gdb) bt
#0  0x00007ffff41d6cdf in __tzstring (s=0x555557004325 "CET") at tzset.c:121
#1  0x00007ffff41d8cd0 in __tzfile_compute (timer=timer@entry=1575460458, use_localtime=use_localtime@entry=1, leap_correct=leap_correct@entry=0x7fffbc7fa0a0, leap_hit=leap_hit@entry=0x7fffbc7fa09c, tp=tp@entry=0x7fffbc7fa200)
at tzfile.c:707
#2  0x00007ffff41d7aa1 in __tz_convert (timer=1575460458, use_localtime=1, tp=0x7fffbc7fa200) at tzset.c:580
#3  0x00007ffff41d5541 in convert_time (tm=0x7fffbc7fa200, t=1575460458, convert=0x7ffff41d54c0 <__localtime_r>) at mktime.c:261
#4  ranged_convert (convert=convert@entry=0x7ffff41d54c0 <__localtime_r>, t=t@entry=0x7fffbc7fa1e8, tp=tp@entry=0x7fffbc7fa200) at mktime.c:275
#5  0x00007ffff41d5942 in __mktime_internal (tp=0x7fffbc7fa300, convert=0x7ffff41d54c0 <__localtime_r>, offset=0x7ffff42efdd8 <localtime_offset>) at mktime.c:392
#6  0x00007ffff45fe9f8 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff45ff0c8 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007ffff45ff1d6 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007ffff45ff6e8 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007ffff4600d45 in QDateTime::setMSecsSinceEpoch(long long) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007ffff4602733 in QDateTime::fromMSecsSinceEpoch(long long, Qt::TimeSpec, int) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007ffff4602b21 in QDateTime::currentDateTime() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff4602bd6 in QTime::currentTime() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff304c53d in KUndo2Command::setTime (this=this@entry=0x7fff95a84350) at /home/boud/dev/krita/libs/command/kundo2stack.cpp:358
#15 0x00007ffff304ee1a in KUndo2Command::KUndo2Command (this=0x7fff95a84350, parent=0x7fff95a843a0) at /home/boud/dev/krita/libs/command/kundo2stack.cpp:164
#16 0x00007ffff5d41e3f in KisPaintDevice::Private::DeviceChangeProfileCommand::DeviceChangeProfileCommand (parent=0x7fff95a843a0, device=..., this=0x7fff95a84350) at /home/boud/dev/krita/libs/image/kis_paint_device.cc:913
#17 KisPaintDevice::Private::DeviceChangeColorSpaceCommand::DeviceChangeColorSpaceCommand (parent=0x7fff95a843a0, device=..., this=0x7fff95a84350) at /home/boud/dev/krita/libs/image/kis_paint_device.cc:953
#18 KisPaintDevice::Private::assignProfile (this=<optimized out>, profile=<optimized out>, parentCommand=0x7fff95a843a0) at /home/boud/dev/krita/libs/image/kis_paint_device.cc:989
#19 0x00007ffff5bce6ec in KisColorizeMask::setProfile (this=this@entry=0x5555673ae020, profile=0x55556734ca60, parentCommand=parentCommand@entry=0x7fff95a843a0)
at /home/boud/dev/krita/libs/image/lazybrush/kis_colorize_mask.cpp:262
#20 0x00007ffff5b7492b in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:82
#21 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#22 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#23 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#24 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#25 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#26 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#27 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#28 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#29 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#30 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#31 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#32 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#33 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#34 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#35 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#36 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#37 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
at /home/boud/dev/krita/libs/image/processing/kis_assign_profile_processing_visitor.cpp:87
#38 0x00007ffff5b74979 in KisAssignProfileProcessingVisitor::visitColorizeMask (this=0x55556740db90, mask=0x5555673ae020, undoAdapter=0x5555673afd80)
--Type <RET> for more, q to quit, c to continue without paging--
Comment 5 Tiar 2019-12-10 17:59:01 UTC
*** Bug 414950 has been marked as a duplicate of this bug. ***
Comment 6 Mikhail 2020-01-02 12:24:48 UTC
Hi there,

To solve this problem, you should open the .kra file with any archiver and delete the “annotations” folder.

Example: filename.kra\filename\annotations.

After that the file will open, but to avoid doing this action every time, remember to convert your colorizing mask to Paint Layer before saving.
------------------------------------------------------------------------
My system:
Radeon Software Version - 19.9.2
Radeon Software release - Adrenalin 2019
Graphic Chipset - AMD Radeon R7 200 Series
The memory capacity is 2048 MB
Memory Type - DDR3
Core frequency - 1110 MHz
Windows Version - Windows 10 (64 bit)
System memory - 8 GB
CPU type - AMD A10-7850K Radeon R7, 12 Compute Cores 4C+8G

Kritacrashlog (Krita version 4.2.8)
Error occurred on Wednesday, January 1, 2020 at 17:57:34.

krita.exe caused a Stack Overflow at location 00007FFEAE3A8763 in module ntdll.dll.

AddrPC Params
Comment 7 Halla Rempt 2020-01-08 09:53:44 UTC
Git commit 478a8be4ef0c9d5ad073e37696e71737f7eb4282 by Boudewijn Rempt.
Committed on 08/01/2020 at 09:52.
Pushed by rempt into branch 'master'.

Fix endless recursion in KisAssignProfileProcessingVisitor::visitColorizeMask

M  +0    -1    libs/image/processing/kis_assign_profile_processing_visitor.cpp

https://invent.kde.org/kde/krita/commit/478a8be4ef0c9d5ad073e37696e71737f7eb4282
Comment 8 Regis 2020-01-08 10:25:58 UTC
Cool!
Thanks a lot :)
Comment 9 Halla Rempt 2020-01-08 13:56:23 UTC
Git commit fef559371da1cbd9c20814938620823d89ed9830 by Boudewijn Rempt.
Committed on 08/01/2020 at 13:34.
Pushed by rempt into branch 'krita/4.2'.

Fix endless recursion in KisAssignProfileProcessingVisitor::visitColorizeMask
(cherry picked from commit 478a8be4ef0c9d5ad073e37696e71737f7eb4282)

M  +0    -1    libs/image/processing/kis_assign_profile_processing_visitor.cpp

https://invent.kde.org/kde/krita/commit/fef559371da1cbd9c20814938620823d89ed9830