|Anonymous | Login | Signup for a new account||2019-07-21 12:17 PDT|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002046||I6 Library||General||public||2017-12-23 08:10||2018-09-12 01:14|
|Target Version||Fixed in Version|
|Summary||0002046: "undo" after replay input crashes Glulx interpreter|
|Description||Compiled using Inform v6.33 Library v6.12.1 S).|
After I replay a command script, even one of only one command, issuing "undo" causes Git and Glulxe report:
Reference to non-existent Glk object
Lectrote is, as expected more helpful, showing:
Quixe run: glk_get_line_stream: invalid stream
If, without replaying, I take the same command, I can type it in, hit <ENTER> and then type 'undo' and nothing untoward happens.
I've got a minimal example (attached) that demonstrates this.
If it is compiled with -~D in any way, then it crashes when you type undo after inputting a replay file.
in parserm.h in GGRecoverObjects (line 6491 in mine), there's the following:
gg_commandstr = 0;
gg_command_reading = false;
#Endif; ! DEBUG
and a bit further down inside the switch sstatement (line 6503):
GG_COMMANDWSTR_ROCK: gg_commandstr = id;
gg_command_reading = false;
GG_COMMANDRSTR_ROCK: gg_commandstr = id;
gg_command_reading = true;
#Endif; ! DEBUG
So we only wipe gg_commandstr and clear gg_command_reading when it's a debug build (which, unsurprisingly, is when it works properly for me, not crashing). If it's a release build, gg_commandstr is not cleared.
During discussion at intfiction.org (thread: https://www.intfiction.org/forum/viewtopic.php?f=7&t=25197&p=138447 [^]), zarf had the following to say:
"I don't know why the gg_commandstr lines in GGRecoverObjects() are conditionalized with "#ifdef DEBUG". There's no good reason for that, except maybe the expectation that the RECORD command will only be used on debug builds, which is not a good assumption. You can just remove the "#ifdef" lines there."
So I thought I'd post this here and see if anyone knows of a reason those #Ifdefs are there. I can verify that removing both sets seems to address my issue.
|Minimal Source Text To Reproduce|
Constant Story "Test bed"; Constant Headline "^An Interactive Tester^ No copyright asserted^"; Release 0; Serial "171223"; Include "Parser"; Include "VerbLib"; Object garden "Beautiful Garden" with description "An apple tree provides shade. The kitchen lies east.", e_to Kitchen, has light; Object -> "feather" with name 'feather', description "It's a feather."; Object kitchen "Kitchen", with description "This is a large country-style kitchen.", w_to Garden, has light; Object -> plain_bag "plain shopping bag" with name 'plain' 'shopping' 'bag', description "A plain shopping bag that can hold 2 things.", capacity 2, has open container; Object -> "fork" with name 'fork', description "It's a fork."; [ Initialise; location = garden; lookmode = 2; print "^^This is a simple game for bug-testing.^^^"; Banner(); return 2; ]; Include "Grammar";
|Additional Information||- compile the above game (or, I believe any game) to Glulx with debug disabled|
- create a command replay file with just a command or two, replay it into the game and type undo.
The interpreter will crash.
|Tags||No tags attached.|
>recording on [Command recording on.] >take feather Taken. >recording off [Command recording off.] >replay [Replaying commands.] >take feather You already have that. >recording off [Command replay complete.] >undo Beautiful Garden [Previous turn undone.] > -------------------------------------------------------------------------------- Glulxe fatal error: Reference to nonexistent Glk object. Hit any key to exit.
|Cross reported to https://gitlab.com/DavidGriffith/inform6lib/issues/55 [^]|
|Fixed in https://gitlab.com/DavidGriffith/inform6lib/commit/74df3809e58fef5f967142d12e3f7573dbfee6b2 [^]|
|2017-12-23 08:10||turthalion||New Issue|
|2018-09-12 01:01||DavidG||Note Added: 0004811|
|2018-09-12 01:09||DavidG||Note Added: 0004812|
|2018-09-12 01:14||DavidG||Assigned To||=> DavidG|
|2018-09-12 01:14||DavidG||Status||new => assigned|
|2018-09-12 01:14||DavidG||Note Added: 0004813|
|2018-09-12 01:14||DavidG||Status||assigned => resolved|
|2018-09-12 01:14||DavidG||Resolution||open => fixed|
|Copyright © 2000 - 2010 MantisBT Group|