Bug 400228 - Config file sometimes becomes corrupted after customizing toolbar items
Summary: Config file sometimes becomes corrupted after customizing toolbar items
Status: REPORTED
Alias: None
Product: frameworks-kxmlgui
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.51.0
Platform: Manjaro Linux
: NOR major
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-24 05:19 UTC by Abscissa
Modified: 2022-02-13 20:05 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Abscissa 2018-10-24 05:19:31 UTC
As noted in Issue #400093 ("Dolphin crashes on startup on invalid XML config file."), my ~/.local/share/kxmlgui5/dolphin/dolphinui.rc has become corrupted (thus leading to an initially-mysterious inability to start Dolphin without it immediately crashing) even though I have not made any edits to the file.

I am aware there are other potential and theoretical causes for this. However, when an application-specific config file is corrupted, it's usually (even if not always) the application itself that corrupted it, since after all, that's the software that's most likely to touch the given file the most often.

Therefore, I am reporting it here so the developers are aware and can be on the lookout for anything suspect in the code.

As in the other issue (#400093), I am pasting the corrupted file contents below.

I looks to me like something must have done the following:

1. Loaded the file into a buffer.
2. Wrote a shorter version of the data into the same buffer.
3. Failed to correctly set the new shorter length of the buffer.
4. Wrote the newly-garbled buffer back out to disk.

----------------------------
<!DOCTYPE kpartgui SYSTEM 'kpartgui.dtd'>
<kpartgui name="dolphin" version="21">
 <MenuBar>
  <Menu name="file">
   <Action name="new_menu"/>
   <Action name="file_new"/>
   <Action name="new_tab"/>
   <Action name="file_close"/>
   <Action name="undo_close_tab"/>
   <Separator/>
   <Action name="renamefile"/>
   <Action name="movetotrash"/>
   <Action name="deletefile"/>
   <Separator/>
   <Action name="show_target"/>
   <Separator/>
   <Action name="properties"/>
  </Menu>
  <Menu name="edit">
   <Action name="edit_select_all"/>
   <Action name="invert_selection"/>
  </Menu>
  <Menu name="view">
   <Action name="sort"/>
   <Action name="view_mode"/>
   <Action name="additional_info"/>
   <Action name="show_preview"/>
   <Action name="show_in_groups"/>
   <Action name="show_hidden_files"/>
   <Separator/>
   <Action name="split_view"/>
   <Action name="split_stash"/>
   <Action name="redisplay"/>
   <Action name="stop"/>
   <Separator/>
   <Action name="panels"/>
   <Menu name="location_bar">
    <text context="@title:menu">Location Bar</text>
    <Action name="editable_location"/>
    <Action name="replace_location"/>
   </Menu>
   <Separator/>
   <Action name="view_properties"/>
  </Menu>
  <Menu name="go">
   <Action name="closed_tabs"/>
  </Menu>
  <Menu name="tools">
   <Action name="show_filter_bar"/>
   <Action name="open_terminal"/>
   <Action name="compare_files"/>
   <Action name="change_remote_encoding"/>
  </Menu>
 </MenuBar>
 <ToolBar name="mainToolBar" alreadyVisited="1" noMerge="1">
  <text context="@title:menu" translationDomain="dolphin">Main Toolbar</text>
  <Action name="go_back"/>
  <Action name="go_forward"/>
  <Action name="go_up"/>
  <Action name="reload"/>
  <Separator name="separator_0"/>
  <Action name="icons"/>
  <Action name="compact"/>
 </ToolBar>
 <State name="new_file">
  <disable>
   <Action name="edit_undo"/>
   <Action name="edit_redo"/>
   <Action name="edit_cut"/>
   <Action name="edit_copy"/>
   <Action name="renamefile"/>
   <Action name="movetotrash"/>
   <Action name="deletefile"/>
   <Action name="invert_selection"/>
   <Separator/>
   <Action name="go_back"/>
   <Action name="go_forward"/>
  </disable>
 </State>
 <State name="has_selection">
  <enable>
   <Action name="edit_cut"/>
   <Action name="edit_copy"/>
   <Action name="renamefile"/>
   <Action name="movetotrash"/>
   <Action name="deletefile"/>
   <Action name="invert_selection"/>
  </enable>
 </State>
 <State name="has_no_selection">
  <disable>
   <Action name="edit_cut"/>
   <Action name="edit_copy"/>
   <Action name="renamefile"/>
   <Action name="movetotrash"/>
   <Action name="deletefile"/>
   <Action name="delete_shortcut"/>
   <Action name="invert_selection"/>
  </disable>
 </State>
 <ActionProperties scheme="Default">
  <Action name="go_back" priority="0"/>
  <Action name="go_forward" priority="0"/>
  <Action name="go_up" priority="0"/>
  <Action name="go_home" priority="0"/>
  <Action name="stop" priority="0"/>
  <Action name="icons" priority="0"/>
  <Action name="compact" priority="0"/>
  <Action name="details" priority="0"/>
  <Action name="view_zoom_in" priority="0"/>
  <Action name="view_zoom_out" priority="0"/>
  <Action name="edit_cut" priority="0"/>
  <Action name="edit_copy" priority="0"/>
  <Action name="edit_paste" priority="0"/>
 </ActionProperties>
</kpartgui>
zoom_in"/>
  <Action priority="0" name="view_zoom_out"/>
  <Action priority="0" name="edit_cut"/>
  <Action priority="0" name="edit_copy"/>
  <Action priority="0" name="edit_paste"/>
 </ActionProperties>
</kpartgui>
----------------------------
Comment 1 Elvis Angelaccio 2018-10-24 15:39:55 UTC
Can you try to reproduce the corruption if you remove (or rename) the already correpted xml file?
Comment 2 Nate Graham 2019-11-22 16:56:04 UTC
Got another report in Bug 414392.
Comment 3 Nate Graham 2022-02-03 18:09:40 UTC
*** Bug 449561 has been marked as a duplicate of this bug. ***
Comment 4 Oleg Solovyov 2022-02-04 08:14:37 UTC
Reproducible at least using kiten and konsole