Opened 3 years ago

Closed 3 years ago

#12987 closed defect (fixed)

KYRA: Lands of Lore: The Throne of Chaos (Multi)

Reported by: BeWorld2018 Owned by: athrxx
Priority: normal Component: Engine: Kyra
Version: Keywords: kyra lands lore morphos load save
Cc: Game: Lands of Lore

Description

ScummVM 2.5.0 release (but older same bug)i

When i load saved game from this game, ScummVM crash....

Test on Windows = OK

I suppose big endian problem.

Attachments (1)

2021-10-12_20h12_42.png (639.7 KB ) - added by BeWorld2018 3 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 by athrxx, 3 years ago

Thanks for your report. Which platform is it where you experience the crash? I understand that Windows works fine for you, but I'd also need to know which platform has the issue.

I would find it rather surprising (which doesn't mean that it is impossible) if we really had a generic endianness bug (affecting all BE platforms) in the savegame code and noone would ever come across it for the last ~10 years

EDIT: I just checked the code for a bit, the endianness handling has been like this since 75c00369 (13.12.2011). It really should read everything as big endian regardless of your platform if this is a ScummVM savegame (and not an original) savegame.

Last edited 3 years ago by athrxx (previous) (diff)

comment:2 by BeWorld2018, 3 years ago

Platform: MorphOS (PowerPc)

I launch game, start to play a little and save game with scummVM, next i just try to load saved game... and crash.

I will send mail to Raziel (AmigaOS 4 PPC) to know if same problem with AmigaOS Platform.

comment:3 by athrxx, 3 years ago

Thanks, let's see if it really is an endian issue.

Did Lands of Lore ever work on MorphOS? Or is the bug new to ScummVM 2.5.0?

Unfortunately, this is difficult to debug for me, since I simply don't get the bug on my platforms. The easiest way would probably be if someone with an affected platform would do a Git bisect...

comment:4 by BeWorld2018, 3 years ago

I just test v2.2.0 and same crash
I test older version 1.7.0.. it's ok... mmm

I try to rebuild ScummVM just with this engine and try to find where crash is (if i can...)

comment:5 by athrxx, 3 years ago

Thanks. If you tested 1.7.0 and 2.2.0 that's roughly a period from middle of 2014 to Sept 2020. Maybe you could test some versions in between to narrow it down some more.

Does it also crash if you try loading from the launcher? Or only when loading ingame?

by BeWorld2018, 3 years ago

Attachment: 2021-10-12_20h12_42.png added

comment:6 by BeWorld2018, 3 years ago

so i debug on MorphOS to check location of crash.

First think, i build exe with -Os option on GCC...
I try to build with -00 -g and ScummVM dont crash after load game but i see alway a bug and with time ScummVM and MorphOS became unstable..

i found strcpy crash here :
https://github.com/scummvm/scummvm/blob/master/engines/kyra/script/script_lol.cpp#L1846

after that.. not sur if BE problem....

I put to your curiosity my MorphOS screenshot with some debug

comment:7 by BeWorld2018, 3 years ago

-> i test from launcher or ingame.. same problem

comment:8 by athrxx, 3 years ago

Thanks, that strcpy crash is a good find. Interesting that this never came up on other platforms. I've pushed a fix for it. Would you please test?

comment:9 by raziel-, 3 years ago

@BeWorld2018

I'm afraid i can't be of any help here.

I don't own the CD version and my floppy version is asserting after the king invites ego to the throne room (intro).

I have to admit, i didn't test the game for a long time, as it isn't my cup of tea.

Here is the log output:
User picked target 'lol' (engine ID 'kyra', game ID 'lol')...

Looking for a plugin supporting this target... Kyra

Running Lands of Lore: The Throne of Chaos (Extracted/DOS/English)
GENERAL.PAK: 0f1fabc1f67b772a30d8e05ece720ac5, 1383453 bytes.
CHAPTER7.PAK: 482308aba1c40ee32449b91b0c63b990, 325053 bytes.
assertion "idx < _size" failed: file "./common/array.h", line 238

@athrxx

The above is with the latest sources (including your fix) from today.

comment:10 by athrxx, 3 years ago

raziel, thanks for testing. Actually, you have been very helpful, since it confirms that the cause is probably a big endian issue.

And I think I have found it this time. It seems to be a regression from 3ae1d92f.

comment:11 by athrxx, 3 years ago

Owner: set to athrxx
Resolution: pending
Status: newpending

I have committed a fix. Please test...

comment:12 by raziel-, 3 years ago

Nice.
Can't test before Sunday, though...hope that's ok?

comment:13 by athrxx, 3 years ago

Sure, if BeWorld2018 (who got the exact same assert) gets to it first you won't even have to do it.

After finding it, it's actually pretty obvious. It's just a LE read I forgot to remove in my 2018 commit...

comment:14 by BeWorld2018, 3 years ago

athrxx: Yeahhh working NOW, thanks !!!

comment:15 by athrxx, 3 years ago

Resolution: pendingfixed
Status: pendingclosed

Thanks for your patience :-)

Note: See TracTickets for help on using tickets.