Opened 10 months ago

Closed 10 months ago

Last modified 10 months ago

#16287 closed defect (fixed)

SCUMM: DIG: Game crashes when moving to another area

Reported by: ianperez Owned by: AndywinXp
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: The Dig

Description

ScummVM version: 2.9.1.1 (Android, Play Store)
Steps to reproduce: Move to another area using attached save
Language: English
Version: CD DOS
Hardware: Pixel 9 Pro XL
OS: Android 16 (BP3A.251005.004.B1)

Attachments (1)

dig.s21 (37.9 KB ) - added by ianperez 10 months ago.

Download all attachments as: .zip

Change History (8)

by ianperez, 10 months ago

Attachment: dig.s21 added

comment:1 by AndywinXp, 10 months ago

Component: --Unset--Engine: SCUMM
Summary: The Dig crashes when moving to another areaSCUMM: DIG: Game crashes when moving to another area

This sounds like a bug which was recently solved. Please download a daily build (https://buildbot.scummvm.org/#/dailybuilds), "latest branch master" and let us know.

comment:2 by ianperez, 10 months ago

I downloaded "android-arm64-master-a7857165.zip" and installed it (after uninstalling the stable version), but the issue remains.

comment:3 by antoniou79, 10 months ago

Testing with the provided saved game, the Windows dev build of ScummVM (Windows 10, local build from recent master HEAD) also throws a segmentation fault.

Debugging with Visual Studio shows a read access violation within playDigMusic() (of dimuse_scripts.cpp) at this line:
https://github.com/scummvm/scummvm/blob/dd1dcb2240c91dae871c6fccfb12a758ce8c480a/engines/scumm/imuse_digi/dimuse_scripts.cpp#L534

I think it's maybe because at that specific call of the playDigMusic() method (playDigMusic(_digStateMusicTable[num].name, &_digStateMusicTable[num], num, false)) , num has a value of 436207660 which seems a bit too large.

Edit: also, might be worth mentioning that at the time of loading this save, the _attributes table after the syncArray call in IMuseDigital::cmdsSaveLoad() has some really large numbers in many (not all) of its entries. Iirc this is a sign that the saved game is in a corrupted state.

@ianperez for your playthrough did you start a new game with ScummVM 2.9.1.1 or was this an old playthrough, that you started with an older version of ScummVM and picked up again recently loading from a saved spot?

Last edited 10 months ago by antoniou79 (previous) (diff)

comment:4 by ianperez, 10 months ago

Good question. I actually started this on my Steam Deck and I believe it has ScummVM 2.9.1. Would that cause the corruption? It's strange though, because some of my previous saves work fine (and also came from my Steam Deck). Maybe it's an error that accumulated over time until it reached a point that it caused a crash?

Note: I will confirm the version of ScummVM on my Steam Deck later today.

comment:5 by ianperez, 10 months ago

Also forgot to mention that on my Steam Deck I was using the Steam version of The Dig. Now I'm wondering if that's the root cause.

I assumed the saves were compatible since it was the same game.

Last edited 10 months ago by ianperez (previous) (diff)

comment:6 by AndywinXp, 10 months ago

Owner: set to AndywinXp
Resolution: fixed
Status: newclosed

In ec98389c:

SCUMM: DIG/DiMUSE: Post-load fix for corrupted savegames

Fixes #16287:

"SCUMM: DIG: Game crashes when moving to another area"

There has been a small wave of corrupted savegames which
were seemingly connected to ticket #15215:

"SCUMM: DIG: Error box 29 is out of bounds in ScummVM 2.8.1"

In affected savegames, the _attributes array from the iMUSE system
seems to contain byteswapped 32-bit values in a few of the slots,
suggesting some kind of data corruption happening behind the scenes.

While the issue was solved in eefca8b ("SCUMM: (DIG) - fix setActorWalkSpeed"),
there is no guarantee that a previous savegame won't be affected and won't cause
a chain reaction in playDigMusic(), causing an out of bounds array read.

This is a pretty reliable way to detect if the savegame was corrupted.

Hopefully.

comment:7 by AndywinXp, 10 months ago

Hi!

I added a fix for savegames which were corrupted during the time we had a certain bug.
Please wait for tomorrow's daily build and let me know how it goes with that.

I tested your savegame (and several others which were affected within the other ticket) and it seems to work great.

Note: See TracTickets for help on using tickets.