Minimum integer in various interpreters

#1

I’ve had a couple of Junior Arithmancer players tell me that reaching the minimum integer in Glulx causes the game not to misbehave (see this post) but to crash. I can’t make it crash in either the Inform IDE or Gargoyle for Windows, but apparently the game will crash in at least Gargoyle for Linux.

Would a few of you try checking the attached .gblorb file with your interpreter and see whether it crashes? The Inform code that produces the .gblorb file is simply

[code]Beginning is a room.

VERYSMALL is always -2147483647.
minimum-testing is an action out of world. Understand “minimum” as minimum-testing.
Carry out minimum-testing:
let newnumber be VERYSMALL;
say “The minimum integer in Glulx is almost [newnumber], which is [newnumber in words].[paragraph break]”;
let newnumber be newnumber - 1;
say “The minimum integer in Glulx actually is [newnumber], which is [newnumber in words].[paragraph break]”;
say “Since that didn’t work, let’s try again: The minimum integer in Glulx actually is [newnumber], which is minus two billion, one hundred forty-seven million, four hundred eighty-three thousand, six hundred forty-eight.[paragraph break]”;
let newnumber be newnumber - 1;
say “But the maximum integer in Glulx is [newnumber], which is [newnumber in words].[paragraph break]”.[/code]

If you type MINIMUM at the command prompt it should produce the output

[code]Welcome
An Interactive Fiction
Release 1 / Serial number 181126 / Inform 7 build 6M62 (I6/v6.33 lib 6/12N) SD

Beginning

minimum
The minimum integer in Glulx is almost -2147483647, which is minus two billion, one hundred and forty-seven million, four hundred and eighty-three thousand, six hundred and forty-seven.

The minimum integer in Glulx actually is -2147483648, which is minus .

Since that didn’t work, let’s try again: The minimum integer in Glulx actually is -2147483648, which is minus two billion, one hundred forty-seven million, four hundred eighty-three thousand, six hundred forty-eight.

But the maximum integer in Glulx is 2147483647, which is two billion, one hundred and forty-seven million, four hundred and eighty-three thousand, six hundred and forty-seven.
[/code]

I’d like to see which interpreters this works fine on (again, type MINIMUM at the command prompt), and which interpreters crash with this. I’ll probably put a note in the next release of JA about which interpreters might cause problems here.

Thanks!
story.gblorb (595 KB)

0 Likes

(Andrew Plotkin) #2

It works in the most recent (unofficial) Mac Gargoyle builds.

EDIT-ADD: Also Lectrote and the new Mac Spatterlight build.

If you figure out what’s crashing, I can add a test case to the Glulxercise test: eblong.com/zarf/glulx/glulxercise.ulx

0 Likes

(Linus Åkesson) #3

Works fine on Glulxe 0.5.4 with GlkTerm 1.0.4-wide.

0 Likes

#4

I’m using Gargoyle on Linux (Ubuntu 18.04). Here’s my output, which is not quite the expected output:

The interpreter doesn’t crash, though. I’m not sure how to check the version of Gargoyle.

0 Likes

(Andrew Plotkin) #5

Ooh, that’s definitely an interpreter bug.

If you load up glulxercise.ulx (link above) and type “streamnum”, what does it display? Should be

0 Likes

(David Kinder) #6

Presumably in this case the version of Gargoyle being used is using an old version of Git as the interpreter, in which case it’s just this: https://github.com/DavidKinder/Git/issues/8

0 Likes

#7

Would this also cause the interpreter to crash, do you think, or just print the wrong thing (as in Victor’s case) or nothing at all (in Zarf’s, lft’s, and my cases)?

0 Likes

(David Kinder) #8

This interpreter bug is affecting the printing of the number as a number, not as words. It won’t ever cause a crash, it just causes the number to be printed as the wrong character.

0 Likes

#9

It prints:

Looks like the interpreter is Git 1.2.9, so this is probably an old bug?

0 Likes

(Andrew Plotkin) #10

The printing error is an old bug (see DavidK’s comments above). Crashing may be an old bug as well. If you can get an updated version of Gargoyle, or rebuild Gargoyle with the current git, it’s worth checking.

0 Likes

(Linus Åkesson) #11

Spike, in addition to trying to get the bug tracked down and fixed (which is great), I would do the following if I were you:

When the game starts, make sure to silently convert the minimum integer into a string.

This way, if the player uses an interpreter that is susceptible to the crash, they will find out about it immediately. It prevents the unfortunate situation where a player has completed a large portion of the game, only to have it crash and potentially leave them with save files that cannot be used with another interpreter, or even later versions of the same interpreter.

0 Likes

(Andrew Plotkin) #12

Glulx save files should be portable across interpreters these days. (“These days” meaning, well, always as far as I know.)

0 Likes

(Andrew Plotkin) #13

Also, I don’t generally recommend adjusting a game file to account for interpreter bugs. You fix the bug.

We haven’t diagnosed this crash yet. We don’t know if it’s consistent. It might not happen at the start of a game, or in the context of silently converting an integer. We don’t even know if it has anything to do with printing.

0 Likes

(Linus Åkesson) #14

Hence “in addition to”. Surely there’s no harm in doing both.

But I should emphasize, perhaps, that my particular suggestion doesn’t involve hiding the bug. The idea is to (potentially) expose the bug earlier in the game, so that more people will realize, in time, that they ought to upgrade their interpreter.

Good thing about save-file compatibility! I had not realized that it was practically universal for glulx.

0 Likes