Memory access out of range invoking rulebook

I’m trying to track down a crash… I put some print statements in and found that the crash happens after invoking a rulebook but before the first rule runs. Has anyone seen anything like that?

Here’s a link to my latest commit on github:

github.com/i7/kerkerkruip/commi … 53592812d4

I’m running the command “queue test weapon aftereffects” and it crashes after the debug hitting marker rule and before the debug attack modifier marker rule, both of which are in the extension “Automated Testing” by author “Kerkerkruip.” The rulebooks are defined in “Kerkerkruip ATTACK” by Victor Gijsbers.

I’ll try to pare this down if I can’t solve it, but that’s all I have time for at the moment. Thanks if you can help!

I’m still working on this. I attempted to pare the code down a bit… unfortunately this is Kerkerkruip so there’s still a lot of code. I’m still getting a segfault, but now it’s when I assign a text as the value of “the description of combat hit”. Combat hit is an instance of a KOV called “outcome” - assigning a text to another outcome doesn’t cause any problem. Could this be a stack overflow or something? I’m so mystified.

You know, it occurred to me… outcomes are defined by a table with continuations. Maybe it’s this bug after all…

inform7.com/mantis/view.php?id=1255

… although that’s supposedly fixed. Help!!!

It is unlikely to be a stack overflow. Beyond that I don’t know.

Here’s a memory access out of range that isn’t fixed in the latest version (I don’t think). It happens when you try to access a row but you haven’t chosen a row. It might not be that one, though, as it seems to produce a different address.

That’s fixed in 6L38.

Ah, I wasn’t sure because it isn’t marked as fixed in a version. (And I’m still on 6L02.)

I’m on 6L38. I’m going to try to isolate the problem further.

Ok, not exactly the same problem, but I think this might be related. Here’s the complete source:

[code]An outcome is a kind of value. Some outcomes are defined by the Table of outcomes.

An outcome has a text called the description.

Table of Outcomes
outcome description
boring lack of results “”
generic reusable event “”

Combat hit is an outcome.

When play begins:
now description of combat hit is “”.

Test is a room.
[/code]

This produces two runtime problems (and halts):

Am I doing something wrong here?

EDIT: placing “combat hit” into a table continuation seems to have stopped the problem. I’d like to make sure there’s an issue for this, though: if defining something outside of a table should be prohibited, then it shouldn’t compile. If it should be allowed, it should work right! Can you tell me if such an issue exists?

There’s a compiler bug; it’s not correctly generating the (default-value) property for “combat hit”. You can see this more easily if you change the rule to

Every turn:
	repeat with O running through outcomes:
		say "...[O] [description of O].";

I will have to do more work to diagnose this. Could you file it?

I’ll create an issue… inform7.com/mantis/view.php?id=1519

Thanks for the help, Zarf! Feel free to edit my ticket.