Opened 3 years ago

Closed 3 years ago

#11969 closed defect (fixed)

Ultima 8 memset tests fail on big-endian platforms

Reported by: skitt Owned by: mduggan
Priority: normal Component: Engine: Ultima
Version: Keywords:
Cc: skitt Game:

Description

On big-endian platforms, test/engines/ultima/ultima8/misc/memset_n.h fails because the memset_n functions assume they're running on a little-endian platform. On a big-endian platform, the value written to memory will depend on the alignment: if the value is aligned, it will be written as expected (MSB first), but if it's not aligned, it will be written in a mixture of little- and big-endian. The tests always use the host memory order.

I can fix this, but I don't know what the correct order is: does the Ultima 8 engine assume little-endian order, or does it work with the host order?

To reproduce this, build and run the tests on a big-endian platform. See https://buildd.debian.org/status/package.php?p=scummvm for some examples (on 2.2.0, but the tests fail in the same way on the current git head).

Change History (5)

comment:1 by mduggan, 3 years ago

Owner: set to mduggan
Resolution: pending
Status: newpending

Thanks for reporting, I will have to look closely at the code because I tried to write the tests with the same assumptions as the engine.

comment:2 by sev-, 3 years ago

Resolution: pending
Status: pendingnew

comment:3 by mduggan, 3 years ago

Apologies for the slow response here - I'd been wanting to remove these functions and the associated tests for a while anyway so this gave me the reminder to do it, but it got complex because there were many parts tied together. I have a local change with this done, but it needs a bit more testing.

comment:4 by skitt, 3 years ago

No worries, thanks for the updates!

comment:5 by mduggan, 3 years ago

Resolution: fixed
Status: newclosed

Fixed in 28bb30 by removing the memset_n file and associated tests.

Note: See TracTickets for help on using tickets.