Opened 3 years ago

Closed 3 years ago

#12729 closed defect (fixed)

AGS: Crash when starting Strangeland

Reported by: criezy Owned by: dreammaster
Priority: normal Component: Engine: AGS
Version: Keywords:
Cc: Game:

Description

When starting Strangeland I get the following error:

ERROR: !Error running function 'game_start':
Error: Null pointer referenced

This is with the latest source code from master (commit 8b460556ac from this morning) on macOS.

The call stack is as follow:

    frame #11: AGS3::quit_with_script_error(functionName="game_start") at script.cpp:575:3
    frame #12: AGS3::RunScriptFunctionIfExists(sci=0x0000000143a96080, tsname="game_start", numParam=0, params=0x0000000000000000) at script.cpp:374:3
    frame #13: AGS3::RunTextScript(sci=0x0000000143a96080, tsname="game_start") at script.cpp:414:14
    frame #14: AGS3::start_game() at game_start.cpp:86:3
    frame #15: AGS3::initialize_start_and_play_game(override_start_room=0, loadSaveGameOnStartup=-1) at game_start.cpp:124:3
    frame #16: AGS3::initialize_engine(startup_opts=0x000000016fdfbce0) at engine.cpp:1247:2
    frame #17: AGS::AGSEngine::run(this=0x000000011c89a8c0) at ags.cpp:183:2
    frame #18: runGame(plugin=0x0000000108c37bd0, enginePlugin=0x0000000108c37cf0, system=0x0000000108493240, debugLevels=0x000000016fdfd8c0) at main.cpp:307:33
    frame #19: ::scummvm_main(argc=1, argv=0x000000016fdff870) at main.cpp:604:27
    frame #20: main(argc=1, argv=0x000000016fdff870) at macosx-main.cpp:45:12
frame #12: 0x00000001006979f8 scummvm`AGS3::RunScriptFunctionIfExists(sci=0x0000000143a96080, tsname="game_start", numParam=0, params=0x0000000000000000) at script.cpp:374:3
   371 	
   372 		// 100 is if Aborted (eg. because we are LoadAGSGame'ing)
   373 		if ((toret != 0) && (toret != -2) && (toret != 100)) {
-> 374 			quit_with_script_error(tsname);
   375 		}
   376 	
   377 		_G(post_script_cleanup_stack)++;
(lldb) p toret
(int) $0 = -6

Change History (3)

comment:1 by dreammaster, 3 years ago

Confirmed by a diff of the output of instruction offsets between standalone and ScummVM for the method that ScummVM crashes in that it diverges immediately after calling the stubbed GameDoOnceOnly method in the AGSWaves plugin. So I guess I need to proceed with filling in the methods sooner rather than later.

comment:2 by Paolo86cripple, 3 years ago

After a few code changes where the game went fine until the logo screen, it now crashes at startup with the following message : scummvm: engines/ags/shared/util/string.cpp:565: void AGS3::AGS::Shared::String::Free(): Assertion `_bufHead->RefCount > 0' failed.
Aborted (core dumped)
So I guess it's a regression of sorts?

comment:3 by dreammaster, 3 years ago

Owner: set to dreammaster
Resolution: fixed
Status: newclosed

Thanks for reminding me. I did a bisect and tracked it down to a refactoring from upstream to allow for extended params for DrawSurface. So Strangeland will work again, I've changed the error to a warning that will be output once, and now Strangeland starts up again.

Note: See TracTickets for help on using tickets.