Opened 4 months ago

Closed 4 months ago

#15281 closed defect (fixed)

SCUMM: Loom: Crash when loading savegame from launcher

Reported by: eriktorbjorn Owned by: AndywinXp
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Loom

Description

I'm uncertain which games are affected, but some versions of Loom are affected. The EGA and FM Towns versions at the very least.

When using the launcher to load a savegame, ScummVM will crash if that savegame was made with the original GUI. If it was done with ScummVM's save dialog, it works fine.

scummvm: engines/scumm/script.cpp:824: void Scumm::ScummEngine::stopObjectCode(): Assertion `_currentScript != 0xFF' failed.

I thought at first this was a regression... and in a sense it is, but only because an assert() has been added to catch it. Backtrace from GDB:

#0  __pthread_kill_implementation
    (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0)
    at ./nptl/pthread_kill.c:44
#1  0x00007ffff62a53ff in __pthread_kill_internal
    (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  0x00007ffff62564f2 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/posix/raise.c:26
#3  0x00007ffff623f4ed in __GI_abort () at ./stdlib/abort.c:79
#4  0x00007ffff623f415 in __assert_fail_base
    (fmt=0x7ffff63b6c08 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x555556fa1ed2 "_currentScript != 0xFF", file=file@entry=0x555556fa1993 "engines/scumm/script.cpp", line=line@entry=824, function=function@entry=0x555556fa1ea8 "void Scumm::ScummEngine::stopObjectCode()")
    at ./assert/assert.c:94
#5  0x00007ffff624f012 in __assert_fail
    (assertion=0x555556fa1ed2 "_currentScript != 0xFF", file=0x555556fa1993 "engines/scumm/script.cpp", line=824, function=0x555556fa1ea8 "void Scumm::ScummEngine::stopObjectCode()") at ./assert/assert.c:103
#6  0x0000555557e8cbff in Scumm::ScummEngine::stopObjectCode()
    (this=0x5555607354e0) at engines/scumm/script.cpp:824
#7  0x0000555557ea14e5 in Scumm::ScummEngine_v3::terminateSaveMenuScript()
    (this=0x5555607354e0) at engines/scumm/scumm.cpp:3204
#8  0x0000555557ea1666 in Scumm::ScummEngine_v3::scummLoop_handleSaveLoad()
    (this=0x5555607354e0) at engines/scumm/scumm.cpp:3243
#9  0x0000555557e9f312 in Scumm::ScummEngine::scummLoop(int)
    (this=0x5555607354e0, delta=3) at engines/scumm/scumm.cpp:2714
#10 0x0000555557e9e583 in Scumm::ScummEngine::go() (this=0x5555607354e0)
    at engines/scumm/scumm.cpp:2471
#11 0x0000555557d231b6 in Scumm::ScummEngine::run() (this=0x5555607354e0)
    at ./engines/scumm/scumm.h:583
#12 0x0000555557cef872 in runGame(Plugin const*, OSystem&, DetectedGame const&, void const*)
    (enginePlugin=0x55555ea53680, system=..., game=..., meDescriptor=0x0)
    at base/main.cpp:311
#13 0x0000555557cf1c68 in scummvm_main(int, char const* const*)
    (argc=1, argv=0x7fffffffe638) at base/main.cpp:796
#14 0x0000555557cec928 in main(int, char**) (argc=1, argv=0x7fffffffe638)
    at backends/platform/sdl/posix/posix-main.cpp:44

The terminateSaveMenuScript() will set _currentScript to 0xFF before calling stopObjectCode() so the only chance that it won't crash is if runScript() in between sets _currentScript and then doesn't reset it.

But that doesn't seem to happen here.

Change History (4)

comment:1 by athrxx, 4 months ago

Owner: set to AndywinXp
Resolution: assigned
Status: newpending

comment:2 by AndywinXp, 4 months ago

In 2f9a4409:

SCUMM: LOOM: Fix crash when loading game

Should fix ticket #15281:
"SCUMM: Loom: Crash when loading savegame from launcher"

in reply to:  2 comment:3 by eriktorbjorn, 4 months ago

Replying to AndywinXp:

Thanks! I've tried saving both with the original and the ScummVM GUI in both EGA and FM Towns Loom, and then loaded those savegames with the original GUI, the ScummVM GUI, the command line (-x) and the launcher, and it all worked fine as far as I could tell.

I don't know if any other games were affected.

comment:4 by AndywinXp, 4 months ago

Resolution: assignedfixed
Status: pendingclosed
Note: See TracTickets for help on using tickets.