Bug 440215 - In the "Manage Resources" dialog, creating a new duplicate tag with different letter Capitalization causes Krita to crash
Summary: In the "Manage Resources" dialog, creating a new duplicate tag with different...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Resource Management (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Other Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-24 04:19 UTC by fizzyflower
Modified: 2021-07-25 09:42 UTC (History)
1 user (show)

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


Attachments
gif that shows the crash in action (673.72 KB, image/gif)
2021-07-24 04:19 UTC, fizzyflower
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fizzyflower 2021-07-24 04:19:37 UTC
Created attachment 140294 [details]
gif that shows the crash in action

SUMMARY
New duplicate tags that contains any letters with a different capitalization causes Krita to crash when it's created through the manage resources dialog. For example. if I create a tag named "test" and then create a duplicate tag with different capitalization named, "Test", Krita will crash. The same thing will happen if I create a tag name "TEst", and then a duplicate tag named "Test".  

If I create a tag named "Test" and then a duplicate tag named "Test" which has the same capitalization as the previous tag, Krita will not crash.   

Krita does not crash if I create duplicate tags with different capitalization anywhere else that allows the creation of tags, such as the brush present docker, patterns dialog, Seexpr dialog, etc. If a duplicate tag is created with different capitalization, Krita will just continue using the capitalization of the previous tag. 

STEPS TO REPRODUCE
1. Open "Manage Resources"
2. Select any resource and create a new tag 
3. Create a duplicate tag with the same name that has a different capitalization  

OBSERVED RESULT
Krita freezes for a few seconds than crashes
Happens in windows and linux

EXPECTED RESULT
No crash. 

SOFTWARE/OS VERSIONS
krita-nightly-x64-5.0.0-prealpha-672de3752b 
Windows:Windows 10 
Linux
Comment 1 Lynx3d 2021-07-24 20:31:38 UTC
It appears to be a "safe assert" that doesn't account for the fact that tag URLs are case insensitive. With a development build I can actually ignore the error (pops up a few times in a row) and continue without crash.

KisTagModel.cpp: KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(tagUrl == tag->url(), KisTagSP());
Comment 2 Halla Rempt 2021-07-25 09:42:04 UTC
Git commit 044e296572b8e9149d76210906ed9dadd868b65e by Halla Rempt.
Committed on 25/07/2021 at 09:41.
Pushed by rempt into branch 'master'.

Compare tags case-insensitive.

M  +1    -1    libs/resources/KisTagModel.cpp

https://invent.kde.org/graphics/krita/commit/044e296572b8e9149d76210906ed9dadd868b65e