Bug 400271 - Need way to allow applications to handle invalid XML without crashing.
Summary: Need way to allow applications to handle invalid XML without crashing.
Status: CONFIRMED
Alias: None
Product: frameworks-kxmlgui
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
: 400093 414392 428659 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-10-25 02:11 UTC by Abscissa
Modified: 2020-11-12 23:09 UTC (History)
5 users (show)

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


Attachments
Invalid XML in dolphinui.rc (5.25 KB, application/xml)
2020-11-12 19:43 UTC, Juanma
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Abscissa 2018-10-25 02:11:11 UTC
According to Elvis Angelaccio over at Bug 400093, "There is an abort() in kxmlgui if the xml file has a wrong syntax." As a result, Dolphin crashes upon startup if its config has become messed up, and is unable to perform any actions such as informing the user of what went wrong, loading a default configurations instead, etc. If both my understanding and Elvis's analysis of kxmlgui correct, then this means ANY application using kxmlgui is doomed to the same crash behaviour, with no option for graceful handling.

What is needed is a mechanism, possibly opt-in, for an application using kxmlgui to be told of an error in the XML, leaving it up to the application to determine how to proceed.
Comment 1 Nate Graham 2018-10-25 02:14:33 UTC
This seems reasonable to me.
Comment 2 Elvis Angelaccio 2018-10-27 10:46:34 UTC
My point was we shouldn't handle this from the dolphin side or on a per-app basis.

Of course we can improve kxmlgui to better handle invalid input.

But I think our time would be best spent to prevent invalid input in the first place.
Comment 3 Nate Graham 2019-11-22 16:49:22 UTC
*** Bug 414392 has been marked as a duplicate of this bug. ***
Comment 4 Nate Graham 2019-11-22 16:51:37 UTC
*** Bug 400093 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2019-11-22 16:52:29 UTC
Preventing the situation from happening would be ideal, but KXMLGui should also be more robust when it does happen. Crashing is a really bad user experience. We could at the minimum remove the malformed file so that the app at least launches.
Comment 6 Nate Graham 2020-11-11 19:49:59 UTC
*** Bug 428659 has been marked as a duplicate of this bug. ***
Comment 7 Juanma 2020-11-12 19:43:18 UTC
Created attachment 133267 [details]
Invalid XML in dolphinui.rc

I see 2 problems here:
1. Something has broken this file. I don't know if it was a Debian APT script during an update, or Dolphin itself, or what.
2. Most definitely, no program should crash when reading wrong XML.

I guess the latter point is what this bug is about. I would like to help, but I have never installed sources of any KDE app for such purpose. Could you give me some hints or point me to some tutorial so that I could debug it myself?
Comment 8 Nate Graham 2020-11-12 23:09:44 UTC
Here is some documentation for how to build our software from source: https://community.kde.org/Get_Involved/development

Feel free to give it a try!