#14334 closed defect (fixed)

SAGA: ITE (Amiga) - random createReadStreamForMember resource errors after intro

Reported by: johnpevensie Owned by: dwatteau
Priority: high Component: Engine: SAGA
Version: Keywords: crash, createReadStreamForMember, resources, amiga
Cc: internetzel Game: Inherit the Earth

Description (last modified by johnpevensie)

ScummVM 2.7.0
The Amiga version of Inherit the Earth, newly added to ScummVM, crashes after the intro on the PPC Mac OS X port. The intro plays all the way through, including music, but when the intro ends (or the user tries to skip it), the game crashes to the debugger with an error: "Unable to locate resource file ite.00x" (on the AGA version) or "Unable to locate resource file ecs.00x" (on the ECS version).
I have only tested the English CD-ROM version of the game, but the same result happens in both the AGA and ECS versions.
This could be a big-endian bug, but I found another crash report about the German version on Intel Macs: https://bugs.scummvm.org/ticket/14081. I have not tested the game on any other big-endian platforms.
Mac OS X 10.4.11, PowerPC G4e

Change History (13)

comment:1 by johnpevensie, 13 months ago

Description: modified (diff)
Keywords: crash added; Amiga crashes removed
Priority: normalhigh
Summary: Inherit the Earth Amiga crashes after intro on Mac OS X PPCSAGA: ITE (Amiga) - crashes after intro on Mac OS X PPC

comment:2 by dwatteau, 13 months ago

Thank you for reporting this.

I do have access to various big-endian development systems, but I don't have the Amiga version of ITE yet. I could try having a look at it myself at some point, but no promise.

If another developer has access to this version of the game, the following guide might help testing it on big-endian through QEMU:
https://wiki.scummvm.org/index.php/HOWTO-Debug-Endian-Issues

If you can test the same resource files on a "regular" Intel computer, and tell us if the result is the same or different, that would be helpful. Thanks.

comment:3 by johnpevensie, 13 months ago

I have tested the same game (both AGA and ECS versions) on ScummVM 2.7.0 on an Intel laptop running Debian, and it works as it should. I have not tested the game on any platforms besides this laptop, OS X Tiger on a Power Mac G4 (on which I report the above-mentioned crash), and the PSP (which crashes upon startup).

comment:4 by johnpevensie, 11 months ago

Update:

I now have the specific error message. It pops up after viewing the intro:

ERROR: Resource::loadResource() failed to open ite.001

comment:5 by dwatteau, 11 months ago

Thanks for this additional piece of information!

I actually can reproduce the issue on an Intel system, both on Windows with MSVC and on Debian with GCC -- it just looks like the OSX PPC is "luckier" in triggering the issue, but the problem doesn't appear to be related to this port or its endianness.

It can randomly happen for any ite.XXX or ecs.XXX file, although the related files are *not* missing from the filesystem when this happens.

I see the following warning here, which gives a bit more context on what could be the issue (related PR for Amiga support was <https://github.com/scummvm/scummvm/pull/4419>):

WARNING: FSDirectory::createReadStreamForMember: Can't create stream for file 'ite.003'!
Resource::loadResource() failed to open ite.003!

Steps to reproduce:

  1. Add the Amiga game, whether in ECS or AGA mode
  2. From the GMM, launch/quit the game multiple times in a row, until hitting the (random) "Resource::loadResource() failed to open XXX" error.

I'm requalifying this issue a bit, since it's not OSX PPC related.

comment:6 by dwatteau, 11 months ago

Keywords: createReadStreamForMember resources amiga added; PPC big-endian removed
Summary: SAGA: ITE (Amiga) - crashes after intro on Mac OS X PPCSAGA: ITE (Amiga) - random createReadStreamForMember resource errors after intro

comment:7 by internetzel, 11 months ago

Cc: internetzel added

comment:8 by PushmePullyu, 11 months ago

This looks like a file handle leak. Could you test with this PR: ​https://github.com/scummvm/scummvm/pull/5043

in reply to:  8 comment:9 by dwatteau, 11 months ago

Replying to PushmePullyu:

This looks like a file handle leak. Could you test with this PR: ​https://github.com/scummvm/scummvm/pull/5043

Thanks, this does appear to fix the issue for me on OSX PPC, Linux and Windows!

If the PR gets accepted, I can provide an OSX PPC test build to @johnpevensie, since there are no automated daily builds for this platform at the moment.

comment:10 by dwatteau, 11 months ago

@johnpevensie: Since there are no daily builds for OSX PPC and no trivial way of building them, can you test the following (unsupported) test build on your environment and confirm whether this fixes the issue, please?

<https://github.com/dwatteau/scummvm/releases/download/v0.7.1/ScummVM-snapshot.dmg> (don't mind the tag number in the URL)

It looks good here with the fix above. Thanks!

comment:11 by johnpevensie, 11 months ago

This build fixed the issue in the ECS version of Inherit the Earth, which has dithered graphics. I was able to get to the game itself, whether I skipped the intro or I watched it.
However, it does not fix the issue in the full-color AGA version of Inherit the Earth. Although the error I first reported is gone, and the game shows one more image from the intro (of a close-up of a circus tent), the game displays the error "ERROR: Script::createThread wrong scriptEntryPointNumber!" afterwards. The same happens when I try to skip the intro by pushing the ESC key.
Although I have tested the game in both ECS and AGA modes, I have only tested the English CD-ROM version. Voice acting works.

in reply to:  11 comment:12 by dwatteau, 11 months ago

Replying to johnpevensie:

This build fixed the issue in the ECS version of Inherit the Earth, which has dithered graphics. I was able to get to the game itself, whether I skipped the intro or I watched it.
However, it does not fix the issue in the full-color AGA version of Inherit the Earth. Although the error I first reported is gone, and the game shows one more image from the intro (of a close-up of a circus tent), the game displays the error "ERROR: Script::createThread wrong scriptEntryPointNumber!" afterwards. The same happens when I try to skip the intro by pushing the ESC key.
Although I have tested the game in both ECS and AGA modes, I have only tested the English CD-ROM version. Voice acting works.

Thanks. The other issue you're having is a different problem in this engine, see #13661.

comment:13 by dwatteau, 11 months ago

Owner: set to dwatteau
Resolution: fixed
Status: newclosed

@johnpevensie: thank you for reporting this issue and for your tests on OSX PPC. They are more than welcome :)

@PushmePullyu: thank you for the fix!

Closing the current issue; the other one remains open in its dedicated thread.

Note: See TracTickets for help on using tickets.