"G" on first move causes a stack overflow (debug mode only)

I’m not sure what I did to do this, but I’m wondering if anyone has advice to track it down.

I have some error code which is designed to help the player if they type in more characters than they need.

rule for printing a parser error when the latest parser error is the didn't understand error:
	let Q be number of words in the player's command;
	say "That isn't a recognized verb[if Q > 4], or at [Q] words, it might be too complex an order[end if]. You can type VERB or VERBS to see them all.";
	reject the player's command;

On turn 1, this gives 188 words for the command, and it spins into

[code][** Programming error: tried to find the “parent” of <illegal object number 710532> **]

[** Programming error: tried to test “has” or “hasnt” of <illegal object number 114> **]

[/code]

This only seems to happen in debug mode. Release mode is okay. But I’m still worried, because you never know.

Are there any pointers on tracking this down? Turning RULES ALL on with

[code]to rulesAll: [used to turn rules ALL on at the very start of play]
(- RulesAllSub(); -)

when play begins (this is the set debug first rule):
rulesAll;[/code]

doesn’t help.

Does anyone have any experiements I can try? I tried commenting out all “when play begins” text, and I still got this. But when I type G immediately, nothing happens.

Thanks!

(Note: I’m using 6g95, so if there’s a bug fixed in 6L, it’s possible that’d be a help. But I’m not good at searching the mantis site.)

I can’t reproduce this either in 6G60 or 6L38. (There is no 6G95 compiler, that was a label which was used for an IDE update, to everyone’s confusion.) I always get “That’s not a verb I recognise” in Glulx, or “You can hardly repeat that” in Z-code.

There’s an open bug (will be fixed in the next release) where “AGAIN” on the first turn does not produce the correct error in Glulx. It doesn’t wind up at the didn’t-understand error, though.

This seems to suggest that it may code in a not for release section causing issues.

You could try this.

[code]To set the parser trace to (N - a number): (- parser_trace={N}; -).

First when play begins: set the parser trace to 6.[/code]

Although it looks like the issue is with another section of code.

What extensions are included at the moment? What’s the minimal code that reproduces this problem? Sometimes obscure things in different I6 inclusions can interact in strange ways.

Oh goodness. I let this slip. There were so many other in-game bugs to fix. Thanks for the trace advice…

It looks like a bare bones program doesn’t leak into the rule for printing parser errors. It says “You can hardly repeat that!”

I’ve tried looking at where I might be sending a fake command to the keyboard, but I can’t find it. So a kludge is:

if turn count is 1: say “VERB of VERBS is where you want to look. There will be more detail later.”

That’s good enough for now. Stripping the program will take effort, maybe too much, for relatively little reward.

Thanks all and again, sorry for the delay replying.