Develop

Ticket #441 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

MoFile loader fails

Reported by: hjr Owned by: max
Priority: normal Milestone: XCSoar 6.0.x
Component: Translations Version: 6.0a
Keywords: mofile Cc:

Description

The language file de.mo does not load on the WM5 build for HP ipaq 300, it works fine for the PC build.

Tracked it down to the point where the file gets mapped:

FileMapping?.cpp (110):
hMapping = ::CreateFileMapping?(... return an invalid handle, whereas the check on invalid handle does not work either.

Change History

comment:1 Changed 3 years ago by max

so what does CreateFileMapping?() return? Why does the check not work?

comment:2 Changed 3 years ago by Turbo

  • Owner set to max
  • Status changed from new to assigned

comment:3 Changed 3 years ago by hjr

CreateFileMapping?() returns 0. The call seems to be ok. The filehandle is ok the file size is perfect.

Last errno is set to 6, which means invalid handle.

To check the result there is:

if (gcc_unlikely(hMapping == INVALID_HANDLE_VALUE))

which does not evaluate to true, whereas:

if (hMapping == NULL)

evaluates to true.

comment:4 Changed 3 years ago by max

Right, CreateFileMapping?() is documented to return NULL on failure, while all other HANDLE functions return INVALID_HANDLE_VALUE.

comment:5 Changed 3 years ago by max

Error handling fixed in fb92f42d9d264eff5419bceeead4f172318cf5a2

comment:6 Changed 3 years ago by hjr

Building from sources today, 18.10., for WM5 on my HP300 Ipaq the de.mo loads and display German texts flawlessly!

comment:7 Changed 3 years ago by Turbo

  • Status changed from assigned to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.