Bug 420626 - Crash if brush settings editor used before files open
Summary: Crash if brush settings editor used before files open
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (other bugs)
Version First Reported In: 4.2.9
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2020-04-26 16:36 UTC by kritabugthrowaway
Modified: 2020-05-04 09:18 UTC (History)
3 users (show)

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


Attachments
Crash log (23.08 KB, text/plain)
2020-04-26 16:36 UTC, kritabugthrowaway
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kritabugthrowaway 2020-04-26 16:36:53 UTC
Created attachment 127897 [details]
Crash log

SUMMARY
Brush settings editor does not work correctly and crashes the application if used before any files have been opened.

STEPS TO REPRODUCE
1. Open up Krita, but *do not* open a file
2. Press F5 to open the brush settings editor
3. Click scratchpad area

OBSERVED RESULT
Editor dialog is missing most elements. Clicking on scratchpad crashes the application.

EXPECTED RESULT
Brush presets can be managed without files open. No crashes.

SOFTWARE/OS VERSIONS
Windows: 10.0.18362 Build 18362
Krita: 4.2.9 (latest from Steam)

OTHER NOTES
Not sure if the brush editor should work before files are opened, or if the shortcut to open it should be disabled at that point.
Comment 1 vanyossi 2020-04-27 04:07:46 UTC
Setting to confirmed on Win.

The crash does not happen on macos.
Comment 2 Ahab Greybeard 2020-04-27 15:32:34 UTC
With appimages, you can use F5 (but not the Toolbar icon) to open the brush editor, paint in the scratchpad area and make changes which are then saved.
Comment 3 Halla Rempt 2020-05-04 09:14:25 UTC
I'm sorry, but with 4.3.0, I cannot reproduce this on Windows either, not with the 4.3.0 beta 1, and not with the steam version :-( But I can see from the backtrace where the crash might happen, so I can mitigate that.
Comment 4 Halla Rempt 2020-05-04 09:16:58 UTC
Git commit 3ca93708da557b034b706340d2b5bf5b2e4c3be0 by Boudewijn Rempt.
Committed on 04/05/2020 at 09:16.
Pushed by rempt into branch 'krita/4.3'.

Check pointers before dereferencing

It shouldn't be possible, but bug 420626 shows that the settings
object can be zero under some circumstances.

M  +9    -3    libs/ui/tool/kis_resources_snapshot.cpp

https://invent.kde.org/kde/krita/commit/3ca93708da557b034b706340d2b5bf5b2e4c3be0
Comment 5 Halla Rempt 2020-05-04 09:18:41 UTC
Git commit 98f1288039f9f2f96ce48b85e4dae4164d8364ea by Boudewijn Rempt.
Committed on 04/05/2020 at 09:18.
Pushed by rempt into branch 'master'.

Check pointers before dereferencing

It shouldn't be possible, but bug 420626 shows that the settings
object can be zero under some circumstances.
(cherry picked from commit 3ca93708da557b034b706340d2b5bf5b2e4c3be0)

M  +9    -3    libs/ui/tool/kis_resources_snapshot.cpp

https://invent.kde.org/kde/krita/commit/98f1288039f9f2f96ce48b85e4dae4164d8364ea