Opened 17 years ago

Closed 17 years ago

#164 closed enhancement (fixed)

Debug messages show incorrect "OS error"

Reported by: Philip Taylor Owned by: Jan Wassenberg
Priority: Nice to Have Milestone:
Component: Core engine Keywords:
Cc: Patch:

Description

Every time the game brings up its Program Error window which looks somewhat like ...

Function call failed: return value was -100101 (Case 1)
Location: allocators.cpp:174 (validate_da)
errno = 0 (?)
OS error = The system cannot find the file specified.


Call stack:

validate_da (allocators.cpp:164)
    da = 0x00CEE6A0 -> 
        base = 0x00000000
        max_size_pa = 0x00000000
        cur_size = 0x00000000
        prot = 0
        pos = 0x00000000

    pos = 0xCCCCCCCC
    prot = 0xCCCCCCCC
    base = 0xCCCCCCCC
    cur_size = 0xCCCCCCCC
    max_size_pa = 0xCCCCCCCC

... I can't help but read the one piece of understandable meaningful English on it, which is nearly always "OS error = The system cannot find the file specified.", which is nearly always completely irrelevant (because it was probably set seconds ago by some unrelated operation). Then I unfailingly get confused for a while before remembering that that message is completey irrelevant, and have to start again at trying to work out what the error is complaining about.

Since it's worse than useless in most cases (because it distracts me from what the real problem is), it would be nice to remove it. If there are cases where it's actually useful, it could at least report the error number instead of the string so it doesn't stand out (and change the "OS error" text because that's distractingly English too), and we can always look up the meaning of that number in the rare cases when it's relevant to a bug report.

So, it could look more like:

Function call failed: return value was -100101 (Case 1)

Location: allocators.cpp:174 (validate_da)

(errno=0, oserr=2)

Call stack:

validate_da (allocators.cpp:164)
    da = 0x00CEE6A0 -> 
        base = 0x00000000
        max_size_pa = 0x00000000
        cur_size = 0x00000000
        prot = 0
        pos = 0x00000000

    pos = 0xCCCCCCCC
    prot = 0xCCCCCCCC
    base = 0xCCCCCCCC
    cur_size = 0xCCCCCCCC
    max_size_pa = 0xCCCCCCCC

and then it's still not very helpful but at least it's not misleading, and I can see I should just look in the code or the debugger to work out what's wrong.

Change History (2)

comment:1 by Jan Wassenberg, 17 years ago

(In [4791]) # fix in sound resource management .. as mentioned in http://www.wildfiregames.com/forum/index.php?showtopic=10719&hl= thanks to matei and philip!

bonus: refs #164 tried to alleviate that by moving the OS error bit to the very end, which usually means it's beyond the end of the little window unless you're looking for it. does that help? i'll venture that the OS error *might* be useful in rare cases and it wouldn't be bad to have in there.

comment:2 by Philip Taylor, 17 years ago

Resolution: fixed
Status: newclosed

I think that fix works fine.

Note: See TracTickets for help on using tickets.