Opened 4 months ago

Closed 4 months ago

#13527 closed defect (fixed)

AGOS: MIDI setControllerDefault() crash with SIMON1-FLOPPY if MT_FM.IBK is missing

Reported by: dwatteau Owned by: dwatteau
Priority: high Component: Engine: AGOS
Version: Keywords:
Cc: Game: Simon the Sorcerer 1


Using ScummVM 2.6.0git from 2022-05-30 on OpenBSD/amd64 7.1.

A 2022-04-30 build runs fine, so I think this may be related to the recent audio changes in AGOS.

With the floppy English version of Simon the Sorcerer 1 from GOG, and this default configuration:

description=Simon the Sorcerer 1 (Floppy/DOS/English)
guioptions=sndNoSpeech launchNoLoad lang_English

The game immediately and systematically crashes at startup with this backtrace:

(lldb) bt
* thread #1, stop reason = signal SIGSEGV
  * frame #0: 0x000007a26625b26f`memset at memset.S:47
    frame #1: 0x0000079f8360dfba scummvm`signed char* Common::fill<short>(first=0x00000000000000e8, last=0x00000000000000f8, val=0) at algorithm.h:112:2
    frame #2: 0x0000079f8360d53e scummvm`MidiDriver_Multisource::setControllerDefault(this=0x0000000000000000, type=CONTROLLER_DEFAULT_PROGRAM, value=0) at mididrv_ms.cpp:242:3
    frame #3: 0x0000079f8360d3f7 scummvm`MidiDriver_Multisource::setControllerDefault(this=0x0000000000000000, type=CONTROLLER_DEFAULT_PROGRAM) at mididrv_ms.cpp:232:3
    frame #4: 0x0000079f80b8e89f scummvm`AGOS::MidiPlayer::open(this=0x000007a189b4f280) at midi.cpp:329:20
    frame #5: 0x0000079f80b697de scummvm`AGOS::AGOSEngine::init(this=0x000007a1f2b45000) at agos.cpp:615:20
    frame #6: 0x0000079f80b694fc scummvm`AGOS::AGOSEngine_Elvira1::init(this=0x000007a1f2b45000) at agos.cpp:151:34
    frame #7: 0x0000079f80b6c3c4 scummvm`AGOS::AGOSEngine::run(this=0x000007a1f2b45000) at agos.h:218:9
    frame #8: 0x0000079f808bce2b scummvm`scummvm_main + 10699
    frame #9: 0x0000079f808b8aa3 scummvm`main + 195
    frame #10: 0x0000079f80895612 scummvm`__start + 322

(OpenBSD uses --disable-seq-midi --enable-sndio if this matters.)

Change History (3)

comment:1 by dwatteau, 4 months ago

With some -d9 debug, I see that there was a File::open: opening 'MT_FM.IBK' failed just before the crash.

Indeed, I was missing this file (I guess I forgot it back then, because GOG does have it, at least now) and the docs do mention it, but maybe the engine should make this a fatal error, instead of letting the program have a low-level crash? Especially since the game wouldn't crash until now, if you missed that file.


comment:2 by dwatteau, 4 months ago

Summary: AGOS: MIDI setControllerDefault() crash with SIMON1-FLOPPY on OpenBSDAGOS: MIDI setControllerDefault() crash with SIMON1-FLOPPY if MT_FM.IBK is missing

comment:3 by NMIError, 4 months ago

Owner: set to dwatteau
Resolution: fixed
Status: newclosed

I've added some error messages when the instrument bank is missing or invalid.

Note: See TracTickets for help on using tickets.