Bug 389877

Summary: Trying to "Add contact info" crashes Krita and corrupts Author profile
Product: [Applications] krita Reporter: Storm Engineer <storm.anthro>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version First Reported In: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Console output

Description Storm Engineer 2018-02-04 14:49:21 UTC
Clicking the "Add contact info" button results in Krita insta-crashing to the desktop and also corrupts the author profile - or more precisely it seems the database storing author profiles is mismatched.

Steps to reproduce:
1; Create two profiles: Test1 and Test2, and populate the default fields
2; In Test2, click "Add contact info" -y Krita crashes instantly to desktop
3; Restart Krita. Try to edit fields of Test2 then hit OK.
4; Go to profiles again -> Test2 shows empty, trying to repopulate fields does not work.
5; Delete Test2 -> The disappeared field values from Test1 now show up in Test2 instead

Built yesterday early afternoon (forgot to write down commit ID before I pulled again).
Comment 1 Storm Engineer 2018-02-04 14:52:59 UTC
Addendum:

Trying to edit fields in Test2 crashed Krita once again.
Comment 2 Storm Engineer 2018-02-04 14:55:27 UTC
Created attachment 110333 [details]
Console output
Comment 3 Storm Engineer 2018-02-05 13:25:54 UTC
I discovered several more anomalies, and there seem to be some randomness to them.

 - Creating and editing profiles may result in a profile file (at .local/share/krita/authorinfo ) with empty XML tags, while the field contents are still saved somewhere as Krita retains them.

 - Editing profiles may result in field data apparently disappearing (combined with a crash) and later reappearing, or appearing under a different profile

 - Deleted profiles may randomly re-appear, including removed profile files getting recreated and fields may or may not contain the correct data

 - Various actions may result in a crash:
 --- Clicking "Add contact info" (100% crash)
 --- Saving a profile
 --- Creating a profile
 --- Deleting a profile
 --- Saving an image while "sign with author profile" is ticked
Comment 4 wolthera 2018-02-05 14:03:52 UTC
Git commit dc7d04685c888606d84b0b0f04d3141ef51fe6bf by Wolthera van Hövell tot Westerflier.
Committed on 05/02/2018 at 14:03.
Pushed by woltherav into branch 'master'.

Fix crash when saving authorinfo that has no contact info.
Related: bug 389720

M  +5    -3    libs/ui/kis_png_converter.cpp
M  +5    -3    plugins/impex/jpeg/kis_jpeg_export.cc

https://commits.kde.org/krita/dc7d04685c888606d84b0b0f04d3141ef51fe6bf
Comment 5 wolthera 2018-02-14 15:35:50 UTC
Git commit d464668dc11e3769aff8e9bad0ded824dc3324fe by Wolthera van Hövell tot Westerflier.
Committed on 14/02/2018 at 15:33.
Pushed by woltherav into branch 'master'.
Related: bug 0

Otherwise it'll end up saving the wrong data to the wrong profile.

M  +4    -2    libs/widgets/KoConfigAuthorPage.cpp

https://commits.kde.org/krita/d464668dc11e3769aff8e9bad0ded824dc3324fe