bugFreeciv - Bugs: bug #22283, Poor error reporting on failure to...

Show feedback again

bug #22283: Poor error reporting on failure to open file

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Sun Jul 6 11:47:19 2014  
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: None
Assigned to: NoneOpen/Closed: Open
Release: Operating System: None
Planned Release: Contains string changes: None

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


Fri Jun 26 02:57:50 2015, comment #2:

I have been working on a map generator and I had to guess why my save files weren't working. I was missing a quote at the end of my terrain map lines but logfile output even with -d 3 gave no indication. Even a line number would be helpful. There was only a message on GUI console that it could not load the file and was falling back. As of now the development cycle for a custom mapgen requires having savegame2.c open and iterating in my head.

Zakri Kneebone <i1abnrk>
Tue Jul 15 20:30:22 2014, comment #1:

See bug #21702 for a specific example where this has caused confusion.

Jacob Nevins <jtn>
Project Administrator
Sun Jul 6 11:47:19 2014, original submission:

If a data file isn't present, has no permissions, etc, secfile_error() doesn't return anything useful (a blank string when I tried).

Fixing this will be quite tedious:

secfile_load()/secfile_load_section() call inf_from_file() in inputfile, which doesn't have a defined ferror/errno/strerror-type interface.

inf_from_file() calls fz_from_file(), which kind of has such an interface (fz_strerror()), although it relies on the regular errno which won't be set for compression-related errors. Also, it's not set for all OS errors.

For instance, support.c:is_reg_file_for_access() can return FALSE for a non-errno condition, so fz_from_file() can't simply call strerror(), hence we don't trivially get "file not found" vs "permission denied" in fz_strerror().

Fixing this will require a usable error reporting interface at every layer in this stack, so that we can get "file not found" from the OS all the way to secfile_error().

Jacob Nevins <jtn>
Project Administrator


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

Attach File(s):

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 i1abnrk (Posted a comment)
  • -unavailable- added by jtn (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.


    Error: not logged in



    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup