Bug 427866 - Crash on loading a file with Fill Layer (crash on pattern->name())
Summary: Crash on loading a file with Fill Layer (crash on pattern->name())
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (show other bugs)
Version: 4.4.0
Platform: Mint (Ubuntu based) Linux
: NOR crash
Target Milestone: ---
Assignee: wolthera
URL:
Keywords: regression
: 429836 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-10-17 14:25 UTC by Tiar
Modified: 2020-12-13 23:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
File that crashes Krita (71.32 KB, application/zip)
2020-10-17 14:25 UTC, Tiar
Details
Fuller crash log, showing that the file is now loading in other thread (12.84 KB, text/plain)
2020-10-17 14:27 UTC, Tiar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tiar 2020-10-17 14:25:30 UTC
Created attachment 132474 [details]
File that crashes Krita

SUMMARY
Trying to open the attached file in 4.4.0 results in a crash.
Git blame gave me this:

ef2d269778b3da7a4950183de4a1e65dcd865afd is the first bad commit
commit ef2d269778b3da7a4950183de4a1e65dcd865afd
Author: Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
Date:   Thu May 21 13:33:50 2020 +0200

    Implement transformed patterns and a rotation slider in the pattern fill layer.
    
    First part of a set of experiments to allow transforms on patterned areas.

:040000 040000 5944cfce5d7026d51de2dc0970791b551b97e5c0 7ff7c8e353853a778913abff443fff936298613e M	libs
:040000 040000 502d300963852a678a0a0d5a051bc2184f14f27f 25563900ee7099257bb740db689fb11aeced2cbc M	plugins


STEPS TO REPRODUCE
1. Open Krita.
2. Try to open the file attached to this bug report.

OBSERVED RESULT
Crash

EXPECTED RESULT
No crash

SOFTWARE/OS VERSIONS
Krita

 Version: 4.3.1-alpha (git cc94dd5)
 Languages: en_US, en, en_US, en, en_US, en, pl_PL, pl, pl_PL, pl
 Hidpi: true

Qt

  Version (compiled): 5.11.1
  Version (loaded): 5.11.1

ADDITIONAL INFORMATION
Short backtrace: 
Thread 34 "Thread (pooled)" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff967f8700 (LWP 25036)]
0x00007ffff2bdfca4 in KoResource::name() const () at /media/tymon/Dane/Development/devsec/krita/libs/pigment/resources/KoResource.cpp:127
127	    return d->name;
(gdb) bt
#0  0x00007ffff2bdfca4 in KoResource::name() const (this=0x0) at /media/tymon/Dane/Development/devsec/krita/libs/pigment/resources/KoResource.cpp:127
#1  0x00007ffff5be8158 in KisFillPainter::fillRectNoCompose(QRect const&, KoPattern const*, QTransform) (this=0x7fff967f7ab0, rc=..., pattern=0x0, transform=...)
    at /media/tymon/Dane/Development/devsec/krita/libs/global/kis_shared_ptr.h:179
#2  0x00007fffcc6ad90e in KoPatternGenerator::generate(KisProcessingInformation, QSize const&, KisPinnedSharedPtr<KisFilterConfiguration>, KoUpdater*) const (this=<optimized out>, dstInfo=..., size=..., config=..., progressUpdater=0x55556710a780) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsize.h:134
#3  0x00007ffff5b3ac3d in KisGeneratorStrokeStrategy::<lambda()>::operator() (__closure=0x5555676f8740) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsize.h:119
#4  0x00007ffff5b3ac3d in std::_Function_handler<void (), KisGeneratorStrokeStrategy::createJobsData(KisSharedPtr<KisGeneratorLayer>, QSharedPointer<bool>, KisSharedPtr<KisGenerator>, KisSharedPtr<KisPaintDevice>, QRegion const&, KisPinnedSharedPtr<KisFilterConfiguration>)::{lambda()#2}>::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/include/c++/8/bits/std_function.h:297
#5  0x00007ffff5e4635c in non-virtual thunk to KisUpdateJobItem::run() () at /media/tymon/Dane/Development/devsec/install/lib/x86_64-linux-gnu/libkritaimage.so.20
#6  0x00007ffff45cbf71 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff45d3c87 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007ffff1ba3182 in start_thread (arg=<optimized out>) at pthread_create.c:486
#9  0x00007ffff3ea0b1f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Comment 1 Tiar 2020-10-17 14:27:07 UTC
Created attachment 132475 [details]
Fuller crash log, showing that the file is now loading in other thread
Comment 2 wolthera 2020-10-25 16:51:42 UTC
Git commit c0bb351ef0c4efc11b2a3cfd30168ed36f159ed1 by Wolthera van Hövell tot Westerflier.
Committed on 25/10/2020 at 16:50.
Pushed by woltherav into branch 'krita/4.3'.

Avoid crash by checking for pattern.

M  +2    -0    libs/image/kis_fill_painter.cc

https://invent.kde.org/graphics/krita/commit/c0bb351ef0c4efc11b2a3cfd30168ed36f159ed1
Comment 3 wolthera 2020-10-25 16:54:00 UTC
The crash is fixed, but given how weird the resulting kra file is, I am somewhat skeptical all of the bug is fixed. However, the bug that the file loading isn't working should probably be reported as a separate bug...
Comment 4 Tiar 2020-10-27 22:37:11 UTC
Git commit eb14cc59326bdba2b786d6b813d132244a4a6874 by Agata Cacko, on behalf of Wolthera van Hövell tot Westerflier.
Committed on 27/10/2020 at 22:37.
Pushed by tymond into branch 'krita/4.4.0'.

Avoid crash by checking for pattern.


(cherry picked from commit c0bb351ef0c4efc11b2a3cfd30168ed36f159ed1)

M  +2    -0    libs/image/kis_fill_painter.cc

https://invent.kde.org/graphics/krita/commit/eb14cc59326bdba2b786d6b813d132244a4a6874
Comment 5 Tiar 2020-12-13 23:50:39 UTC
*** Bug 429836 has been marked as a duplicate of this bug. ***