Can't compile with 6L02

I have a huge game, so I expected some debug time when I upgraded to 6L02. A few hours later, It stopped spewing errors! But it also isn’t compiling. It stops with an error 2, and if I look at the log, it says malloc error, ran out of memory. What do I to?

So the compiler itself ran out of memory? What are the parameters of your system?

Is it the inform6 stage or the ni stage that got a malloc error?

Please post the entire error message from the Results/Console tab.

Appears to be in the inform 6? Recompiling to get it…
The system it’s compiling on has 10 gigs of RAM(Enough I’d hope).

Here we are:
Run out of memory: malloc failed

Compiler finished with code 2


The report reads:
The application ran your source text through the Inform 7 compiler, as usual, but the compiler unexpectedly failed. This should not happen even if your source text is gibberish, so you may have uncovered a bug in the program.

When a program like the I7 compiler fails, it typically returns an error number: this time, the number was 2, so I7 probably stopped because of a fatal file-system error.

It is very unlikely that your computer is at fault. More likely causes are:

•disc space running out on the volume holding the project;
•trying to run a project from a read-only volume, such as a burned CD or DVD;
•trying to run a project which belongs to another user, whose files you have no permission to alter.

However, if you think it more likely that the Inform 7 compiler is at fault, please check that you have the currently distributed build of the system: if you have, please consider taking the time to fill out a bug report at the Inform bug tracker (www.inform7.com/bugs).

Sorry for the inconvenience.

Thanks. That looks like the I7 compiler (ni) failed.

Yes, 10 gigs should be enough for even a large game. It’s possible that the compiler got into an infinite loop and tried to allocate an infinite amount of memory.

Please file this as a bug. It would be helpful if you could provide the source code. Or, better – start chopping pieces off of the source code until you have the smallest sample game that runs out of memory.

Oh my, it’s quite a large game. Would linking to the git-hub work? And where is the bug reporting page?

I think I know the game you’re talking about. Most of the content is in extensions, isn’t it? Try commenting out a bunch of those extensions and recompiling. See if it still happens.

Yes. Be sure to mention what version of extensions you’re using, for extensions not in the github repository.

The bug reporting page is inform7.com/mantis/.

The trick with that is a lot of extensions merrily use other extensions, meaning commenting out a chunk usually results in not compiling at all.

Hm. Would it compile without any of those content extensions at all?

Let’s find out! I’ll try commenting out all critters first, though I expect explosions.

Yep, quite a tangle. Working through to see how many monsters I can prune out and still compile(or fail to)

The plot thickens. With some code fixed that wasn’t producing an explicit error but was mucking things up, it got past the I7 stage!

New error:

The 58185-word source text has successfully been translated into an
intermediate description which can be run through Inform 6 to complete
compilation. There were 247 rooms and 930 things.
Inform 7 has finished.

C:\Program Files (x86)\Inform 7\Compilers\inform6
-w~S~DGk +include_path=…\Source,.\ auto.inf output.ulx
Inform 6.33 for Win32 (10th May 2014)
auto.inf(503102): Error: Expected expression with side-effects but found i

               i f

auto.inf(503121): Error: ‘else’ without matching ‘if’

} else
auto.inf(503121): Error: Expected ‘;’ but found {
} else {
auto.inf(503121): Error: Expected expression but found {
} else {
auto.inf(503121): Error: Expected expression with side-effects but found
} else {
auto.inf(503157): Error: Expected expression but found }
}
auto.inf(503157): Error: Expected expression with side-effects but found
}
auto.inf(503163): Error: Expected expression but found }
}
auto.inf(503163): Error: Expected expression with side-effects but found
}
auto.inf(503171): Error: Expected expression but found }
}
auto.inf(503171): Error: Expected expression with side-effects but found
}
In: 1 source code files 838639 syntactic lines
600928 textual lines 60835133 characters (ISO 8859-1 Latin1)
Allocated:
161222 symbols (maximum 13000000) 979467338 bytes of memory
Out: Glulx story file 57.140610 (17210K long):
46 classes (maximum 200) 1243 objects (maximum 1250)
233 global vars (maximum 512) 1409949 variable/array space (maximum 12500000)
289 verbs (maximum 330) 1945 dictionary entries (maximum 15000)
674 grammar lines (version 2) 877 grammar tokens (unlimited)
272 actions (maximum 320) 48 attributes (maximum 56)
40 common props (maximum 256) 240 individual props (unlimited)
16863273 characters used in text 9773250 bytes compressed (rate 0. 70)
0 abbreviations (maximum 64) 15236 routines (unlimited)
934190 instructions of code 620122 sequence points
2185728 bytes writable memory used 15437056 bytes read-only memory used
17622784 bytes used in machine 1056119040 bytes free in machine
Compiled with 11 errors and 7649 suppressed warnings (no output)
Completed in 30 seconds

Compiler finished with code 1

It gets more interesting. I dug into the auto.info for some clues, tweaked a bit, then got this:

The 58185-word source text has successfully been translated into an
intermediate description which can be run through Inform 6 to complete
compilation. There were 247 rooms and 930 things.
Inform 7 has finished.

C:\Program Files (x86)\Inform 7\Compilers\inform6
-w~S~DGk +include_path=…\Source,.\ auto.inf output.ulx
Inform 6.33 for Win32 (10th May 2014)
auto.inf(503102): Error: Expected expression with side-effects but found i

               i f

auto.inf(503170): Error: Expected expression but found }

}
auto.inf(503170): Error: Expected expression with side-effects but found
}
auto.inf(503173): Error: Expected expression but found }
}
auto.inf(503173): Error: Expected expression with side-effects but found
}
In: 1 source code files 838643 syntactic lines
600930 textual lines 60835208 characters (ISO 8859-1 Latin1)
Allocated:
161222 symbols (maximum 13000000) 979467338 bytes of memory
Out: Glulx story file 57.140610 (17210K long):
46 classes (maximum 200) 1243 objects (maximum 1250)
233 global vars (maximum 512) 1409949 variable/array space (maximum 12500000)
289 verbs (maximum 330) 1945 dictionary entries (maximum 15000)
674 grammar lines (version 2) 877 grammar tokens (unlimited)
272 actions (maximum 320) 48 attributes (maximum 56)
40 common props (maximum 256) 240 individual props (unlimited)
16863273 characters used in text 9773250 bytes compressed (rate 0. 70)
0 abbreviations (maximum 64) 15236 routines (unlimited)
934195 instructions of code 620125 sequence points
2185728 bytes writable memory used 15437056 bytes read-only memory used
17622784 bytes used in machine 1056119040 bytes free in machine
Compiled with 5 errors and 7649 suppressed warnings (no output)
Completed in 29 seconds

Compiler finished with code 1

The error, when gawked at, was literally ‘i f’, as in, for some reason, it put a space in ‘if’. I don’t know why.

The line being translated was: ! [32: if waiterhater is 0 , wait for any key]

It looks like you’ve got two different errors. You should file both of them. A compiler crash is a serious bug even if it was “your fault” for writing bad code.

Yea, I just need to figure out how to cleanly do this. Maybe I should split the code off right here, so it stops changing, so they can examine it at their leisure.

Bug filed: inform7.com/mantis/view.php?id=1339

Thanks. I’ve grabbed a copy of the code and linked it in the bug report, so Graham can examine it as needed.

Roger that. I presume I should just stick with the old inform for now?

Yeah. You could make a little more porting progress if you fixed the “i f” mistake by hand and recompiled. But this is probably more work than it’s worth.

I don’t know how to do that. How do you do that?