Bug 342749 - Crash upon using source:pattern in pixelbrush engine
Summary: Crash upon using source:pattern in pixelbrush engine
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: 2.9 Beta
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
: 343062 343171 (view as bug list)
Depends on:
Reported: 2015-01-11 21:28 UTC by wolthera
Modified: 2015-08-25 14:47 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:

terminal output with gdb (15.22 KB, text/plain)
2015-01-14 16:04 UTC, wolthera
backtrace pattern as source (7.86 KB, text/plain)
2015-01-19 06:44 UTC, wolthera

Note You need to log in before you can comment on or make changes to this bug.
Description wolthera 2015-01-11 21:28:35 UTC
For some reason Krita can't start Konqi, so this terminal output will have to do:

krita: Fatal IO error 9 (Bad file descriptor) on X server :0.
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
CRITICAL: According to statistics of the KisTileDataStore some tiles have leaked from the Krita control! 
CRITICAL: Tiles in memory: 3244 Total tiles: 3244 
QFile::at: Cannot set file position 0 
Fatal Error: Accessed global static 'KoToolManager *s_instance()' after destruction. Defined at /home/wolthera/kde4/src/calligra/libs/flake/KoToolManager.cpp:1034
Unable to start Dr. Konqi
wolthera@Thesis:~/kde4/build$ drkonqi(12421): The specified process does not exist. 

Reproducible: Always
Comment 1 Halla Rempt 2015-01-14 09:55:04 UTC
Hm, I did change the way the pattern chooser failed to initialize correctly recently. Can you still reproduce it? I can't... If you can, please run krita inside gdb to get the full backtrace.
Comment 2 wolthera 2015-01-14 16:04:41 UTC
Created attachment 90403 [details]
terminal output with gdb

I checked yesterday, because I suspected the same thing, but it still happened. Perhaps the pattern crash isn't resolved yet after all, because choosing a different pattern before painting does indeed prevent it crashing.
Comment 3 Halla Rempt 2015-01-15 08:41:59 UTC
Bah... I don't get this at the moment. I do:

* create new image
* open brush editor
* select Source entry
* select pattern
* paint in the preview area

And I get a nice patterned stroke.
Comment 4 wolthera 2015-01-19 06:44:07 UTC
Created attachment 90505 [details]
backtrace pattern as source

 * create new image
* open brush editor
* select Source entry
* select pattern
* paint in the preview area

Okay, that tells me something, namely: don't select a a pattern. if I select a pattern, Krita works fine.
Also, I paint on the canvas directly, because my scratchpad randomly doesn't work.(I think that's a local issue though)
Anyway, just tested it again, and I am getting a backtrace.
Comment 5 Halla Rempt 2015-01-20 10:01:27 UTC
*** Bug 343062 has been marked as a duplicate of this bug. ***
Comment 6 Storm Engineer 2015-01-20 10:43:58 UTC
(In reply to Boudewijn Rempt from comment #5)
> *** Bug 343062 has been marked as a duplicate of this bug. ***

For me, crash happens the instant I select Pattern option, so I never get to actually attempt painting with it. However, it doesn't always happen and not with all brushes. If it doesn't crash when selecting, then it won't crash afterwards.

The only reliable way I found to reproduce it every time is by using specifically the preset called "Screentones_Eraser", and right after opening Krita and creating a fresh document:

1. Open Krita, create new document.
2. Chose the brush Screentones_Eraser
3. Go into brush engine settings and click on the Pattern option
 - Krita crashes instantly.
Comment 7 Halla Rempt 2015-01-27 10:24:59 UTC
*** Bug 343171 has been marked as a duplicate of this bug. ***
Comment 8 Halla Rempt 2015-01-27 14:11:09 UTC
Ack, yes, I've reproduced now.
Comment 9 Halla Rempt 2015-01-27 14:31:31 UTC
Git commit bd80195450550b5591450c6cb69a4ccee65f077e by Boudewijn Rempt.
Committed on 27/01/2015 at 14:30.
Pushed by rempt into branch 'calligra/2.9'.

If colorsource=pattern or colorsource=locked pattern, the pattern must
be set before the paintop, because the colorsource needs to access the

This is non-obvious and probably needs refactoring.

M  +4    -3    krita/image/recorder/kis_recorded_paint_action.cpp

Comment 10 mvowada 2015-02-01 15:22:29 UTC
After Krita restart I get an error by activating "pattern" for the Layout_pen brush. To reproduce:

1. Close and restart Krita
2. create a new document
3. Switch to "Layout_pen" brush
4. toolbar > "Edit brush settings" > "Texture" > click to activate the checkbox "Pattern"
Comment 11 Halla Rempt 2015-08-25 14:47:14 UTC
I'm pretty sure I fixed this in the meantime, and I cannot reproduce anymore in any case.