Bug 445581 - Krita crashes when selecting a brush
Summary: Krita crashes when selecting a brush
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Resource Management (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-16 12:29 UTC by Andreas Resch
Modified: 2021-11-19 03:53 UTC (History)
2 users (show)

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


Attachments
Crash Log (51.90 KB, text/plain)
2021-11-16 12:29 UTC, Andreas Resch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Resch 2021-11-16 12:29:40 UTC
Created attachment 143619 [details]
Crash Log

After importing my backed up brush bundle (with obviously missing brush tips now - not sure how that happened), Krita crashes after selecting one of those brushes. I have imported some brush tips from my Photoshop export file like I did before, but I can't verify if the crash-causing brush uses one of those tips. It crashed immediately when I select it.

Attached is the crash log.

SOFTWARE/OS VERSIONS
Windows: 10 64-Bit
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Eoin O'Neill 2021-11-17 03:13:11 UTC
Hi Andreas Resch,

Regarding your bundle -- does it normally include the brush tips within the zip contents? The bug here could be related to how Krita loads that initial resource bundle, as trying to import a brush tip on it's own w/ a fresh version of Krita 5 works as expected on my end.

Thanks,
Eoin.
Comment 2 Andreas Resch 2021-11-17 08:08:45 UTC
(In reply to Eoin O'Neill from comment #1)
> Hi Andreas Resch,
> 
> Regarding your bundle -- does it normally include the brush tips within the
> zip contents? The bug here could be related to how Krita loads that initial
> resource bundle, as trying to import a brush tip on it's own w/ a fresh
> version of Krita 5 works as expected on my end.
> 
> Thanks,
> Eoin.

There is an issue with creating bundles and brush tips in ABR files that I've already filed. This might helps to solve this problem. However I've gone through the whole process again (export bundle, import bundle, add the ABR brush tips manually) and now the brush can be selected. So that bug might have some other reason as well. You would have to rely on the crash log to find out what it could be. I have no clue.
Comment 3 Bug Janitor Service 2021-11-18 04:38:54 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 4 Eoin O'Neill 2021-11-19 03:06:44 UTC
Git commit 103fb3f29ae2600d6bc1192833278ea56dc80c28 by Eoin O'Neill.
Committed on 19/11/2021 at 03:04.
Pushed by eoinoneill into branch 'master'.

Fix nullptr crash associated with invalid access on `addResourceOrWarnIfNotLoaded`

Since this method is supposed to warn the user, we shouldn't be risking a segfault
on invalid function calls to null pointers!

M  +4    -3    libs/resources/KisRequiredResourcesOperators.cpp

https://invent.kde.org/graphics/krita/commit/103fb3f29ae2600d6bc1192833278ea56dc80c28
Comment 5 Eoin O'Neill 2021-11-19 03:26:24 UTC
Git commit 4b4f4d429fb7a7c835dc15fd5bb8c3f4339a69af by Eoin O'Neill.
Committed on 19/11/2021 at 03:26.
Pushed by eoinoneill into branch 'krita/5.0'.

Fix nullptr crash associated with invalid access on `addResourceOrWarnIfNotLoaded`

Since this method is supposed to warn the user, we shouldn't be risking a segfault
on invalid function calls to null pointers!
(cherry picked from commit 103fb3f29ae2600d6bc1192833278ea56dc80c28)

M  +4    -3    libs/resources/KisRequiredResourcesOperators.cpp

https://invent.kde.org/graphics/krita/commit/4b4f4d429fb7a7c835dc15fd5bb8c3f4339a69af
Comment 6 Eoin O'Neill 2021-11-19 03:28:12 UTC
Andreas Resch,

I've at least solved the crash here. If you are having difficulties importing resources, however, please let us know with another bug report.

Thanks for taking the time to file a bug report!,
Eoin.
Comment 7 Tiar 2021-11-19 03:53:36 UTC
@Andreas the ABR issue is tracked here: bug 398685. I would mark this bug as "duplicate" but it got its own commit for the crash so I guess I'm going to leave it as "resolved" to show that there was something done. But you can subscribe to that other bug report to get updates.