bugBattle for Wesnoth - Bugs: bug #20366, Corrupted preferences file should...

 
 
Show feedback again

bug #20366: Corrupted preferences file should not prevent Wesnoth startup

Submitted by:  Ignacio R. Morelle <shadowmaster>
Submitted on:  Fri 14 Dec 2012 01:23:00 AM UTC  
 
Category: Feature RequestSeverity: 4 - Important
Priority: 5 - NormalItem Group: User Interface
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Release: 1.10.x, 1.11.0, 1.11.1, trunk r55849Operating System: Any

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 10 Feb 2013 09:46:23 AM UTC, comment #2:

This FR is quite similar to bug #19970. I'm testing a fix at the moment, if it fails to read the preferences it falls back to the default settings and overwrites the broken preferences upon exit.

I personally feel GUI feedback is overkill so I won't add that, I leave it to you to decide whether my fix is enough or whether you want to keep the FR open for the dialogue.

Mark de Wever <mordante>
Project Member
Fri 14 Dec 2012 01:25:07 AM UTC, comment #1:

Alternate method to reproduce (previously hinted at):

- Enter the command :alias =foo=bar in the in-game command line. This inserts a line ="foo=bar" in the preferences file, which is invalid WML.

- Try restarting Wesnoth. stderr should look like this:
(Needless to say, the line number will vary.)

Ignacio R. Morelle <shadowmaster>
Project Administrator
Fri 14 Dec 2012 01:23:00 AM UTC, original submission:

When Wesnoth hits a WML parser error when reading the main preferences file, it will instantly quit without any visual indication. The most that it will do in this case is printing the parser error in stderr with the affected file referred to as "<unknown>".

This is a rather severe usability problem that has affected every version I can recall. Ideally, there should be no way for Wesnoth to corrupt its preferences file, but this can not only happen accidentally (filesystem failure, etc.), but also deliberately, such as by entering the command :alias =foo=bar in the in-game command line.

To solve it I would propose ignoring the preferences file every time it exists and can't be read, and warning the user with an in-game notification via GUI dialog with an option to discard the corrupted preferences file and overwrite it, as well as pointers to solve the issue without discarding it.

Since this is not so much a bug as it is missing functionality (a sane fallback and notification in case the preferences file cannot be parsed), I have submitted it as a feature request.

(If nobody wants to try solving this before 1.11.4 or so, I may look into it myself.)

Steps to reproduce:

- Open the preferences file, and insert a '=' character at the beginning so that the first line reads like this:

- Try starting Wesnoth. stderr should look like this:

Ignacio R. Morelle <shadowmaster>
Project Administrator

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mordante (Posted a comment)
  • -unavailable- added by shadowmaster (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup