Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001973Core InformSource text and punctuationpublic2016-11-27 15:202016-12-05 12:11
Assigned To 
PlatformWindows x86OSWindowsOS Version10
Product Version6M62 
Target VersionFixed in Version 
Summary0001973: Can get out of memory error before the compiler is really out of memory
DescriptionTranslating the Source - Failed
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 11, and that probably indicates that the compiler failed to manage its data structures properly. Perhaps you created a complicated situation on which it has not been fully tested.

The best option now is probably to reword whatever was last changed and to try again. Subsequent attempts will not be affected by the failure of this one, so there is nothing to be gained by restarting the application or the computer. A failed run should never damage the source text, so your work cannot be lost.

If you think it 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 ( If you think the fault may be due to a problem in an extension you're using, then please contact the extension's author directly.

Sorry for the inconvenience
Minimal Source Text To Reproduce [^]
TagsNo tags attached.
Effect(critical) Compiler reports internal error
Attached Files

- Relationships

-  Notes
nuku (reporter)
2016-11-28 12:30

The extension Korvin by Stripes is the culprit, but I have no idea why. Commenting it out and making dummy variables that other code looks for allows for compiling.
dfremont (reporter)
2016-11-28 21:42

From the backtrace, it looks to me like Inform is trying to issue an error about running out of memory (probably the "generating endless structures" internal error). But when preparing the error screen, Inform tries to allocate a new structure, which triggers the out of memory error again. So we have an infinite recursion that eventually exhausts the stack.

Partial backtrace:

Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000bf7ffd5c

VM Regions Near 0xbf7ffd5c:
    Stack 00000000b0083000-00000000b0094000 [ 68K] rw-/rwx SM=COW
--> Stack Guard 00000000bc000000-00000000bf800000 [ 56.0M] ---/rwx SM=NUL
    Stack 00000000bf800000-00000000c0000000 [ 8192K] rw-/rwx SM=PRV

Thread 0 Crashed:: Dispatch queue:
0 libsystem_c.dylib 0x99bc286e __vfprintf + 12
1 libsystem_c.dylib 0x99beb1aa __v2printf + 670
2 libsystem_c.dylib 0x99bd0469 _vsnprintf + 832
3 libsystem_c.dylib 0x99bd04cc vsnprintf_l + 63
4 libsystem_c.dylib 0x99bc1292 snprintf + 82
5 ni 0x00001f90 Streams__printf + 608
6 ni 0x0003e977 HTML__begin_html_table + 135
7 ni 0x0003e5fb HTML__html_outcome_image + 1051
8 ni 0x000581b2 Problems__show_problem_location + 98
9 ni 0x00059550 Problems__issue_problem_begin + 352
10 ni 0x00005797 Problems__Issue__internal_error_fn + 215
11 ni 0x0000550b Memory__allocate_another_block + 91
12 ni 0x00006dd8 Memory__allocate + 120
13 ni 0x00027e50 allocate_parse_node_annotation_array + 80
14 ni 0x0002805b allocate_parse_node_annotation + 75
15 ni 0x000c2001 ParseTree__pna_new + 17
16 ni 0x000c2234 ParseTree__pn_annotate_pointer + 212
17 ni 0x00058101 ParseTree__set_problem_falls_under + 81
18 ni 0x00057fac Problems__visit_for_headings + 108
19 ni 0x000c6b9e ParseTree__traverse_from_ppn_nocs + 94
20 ni 0x000c6bf6 ParseTree__traverse_from_ppn_nocs + 182
21 ni 0x000c6bf6 ParseTree__traverse_from_ppn_nocs + 182
22 ni 0x000c6bf6 ParseTree__traverse_from_ppn_nocs + 182
23 ni 0x000c6bf6 ParseTree__traverse_from_ppn_nocs + 182
24 ni 0x00057f32 ParseTree__traverse_ppn_nocs + 66
25 ni 0x00057e86 Problems__find_headings_at + 118
26 ni 0x00058248 Problems__show_problem_location + 248
27 ni 0x00059550 Problems__issue_problem_begin + 352
28 ni 0x00005797 Problems__Issue__internal_error_fn + 215
29 ni 0x0000550b Memory__allocate_another_block + 91
30 ni 0x00006dd8 Memory__allocate + 120
31 ni 0x00027e50 allocate_parse_node_annotation_array + 80
32 ni 0x0002805b allocate_parse_node_annotation + 75
33 ni 0x000c2001 ParseTree__pna_new + 17
34 ni 0x000c2234 ParseTree__pn_annotate_pointer + 212
35 ni 0x00058101 ParseTree__set_problem_falls_under + 81
36 ni 0x00057fac Problems__visit_for_headings + 108
37 ni 0x000c6b9e ParseTree__traverse_from_ppn_nocs + 94
38 ni 0x000c6bf6 ParseTree__traverse_from_ppn_nocs + 182
39 ni 0x000c6bf6 ParseTree__traverse_from_ppn_nocs + 182
40 ni 0x000c6bf6 ParseTree__traverse_from_ppn_nocs + 182
41 ni 0x000c6bf6 ParseTree__traverse_from_ppn_nocs + 182
42 ni 0x00057f32 ParseTree__traverse_ppn_nocs + 66
43 ni 0x00057e86 Problems__find_headings_at + 118
44 ni 0x00058248 Problems__show_problem_location + 248
45 ni 0x00059550 Problems__issue_problem_begin + 352
46 ni 0x00005797 Problems__Issue__internal_error_fn + 215
47 ni 0x0000550b Memory__allocate_another_block + 91
48 ni 0x00006dd8 Memory__allocate + 120

(continues identically for a long time)
nuku (reporter)
2016-11-28 21:45

Oof, anything I can do on my end to slip by this?
DavidK (developer)
2016-11-29 00:36

Do you get the same stack trace on Windows? The latest Windows build should also give stack traces on NI failure on the Console sub-tab, but only for the latest June 2016 build - you might need to re-download it to be sure you've got the most up-to-date Windows build of 6M62.
dfremont (reporter)
2016-11-29 00:49

Looking at the debugging log, compilation appears to go smoothly until exactly 10,000 memory blocks have been allocated, when the crash happens. So you may just be hitting the threshold used by Inform to detect when runaway memory allocation is occurring. If that's the case, there probably isn't anything you can do except make the project smaller and wait until the limit is raised (or Inform's memory usage reduced).

An experiment you can try: if the explanation above is right, then putting Korvin back and removing a sufficient amount of other material (how much is hard to say) should allow a successful build. If the error really depends on that specific extension, then something else is going on. But I suspect it's just that Korvin is one of the last extensions included, and pushes you over the edge.
DavidK (developer)
2016-11-29 03:28

Good call: an internal error is generated at 10,000 memory blocks (about 2Gb). Shame it doesn't actually manage to show the error. When I get the chance I'll up this limit and rebuild on Windows as a test.
nuku (reporter)
2016-11-29 05:11

We are the largest Inform game that I'm aware of, stressing the engine in new and novel ways. Might that ceiling become something you can define in the game? That is, with a 'use' statement.
nuku (reporter)
2016-11-29 08:29

The console ends with:

I've also read Glulx Entry Points by Emily Short, which is 1138 words long.

Compiler finished with code 11
DavidK (developer)
2016-12-05 06:00

The core problem here is that the internal constant MAX_BLOCKS_ALLOWED should be settable in some way.

However, for the moment, I've just recompiled ni with MAX_BLOCKS_ALLOWED = 15000 and put the result here: [^]

When I try compiling the game, it now eventually fails with a "Too much text in quotation marks" error, and then crashes out. This is unfortunate, but I suspect that the "too much text" error is real and needs to be fixed in the game source.
nuku (reporter)
2016-12-05 07:41

Too much text? That's a thing? We need our text. Suggestions?
dfremont (reporter)
2016-12-05 08:40

Has 0001830 been fixed? It might be the further problem here, as it was producing a "too much text in quotation marks" error and crash before for this project - see the notes on 0001816 (at least at that time, you could fix this by deleting the extensions by "Auto Translator").

The "too much text in quotation marks" error means there's a quoted string that's too long (it's not about the total amount of text in your story). You can easily get around it by splitting the string into two or more parts and saying them separately, or by factoring out part of the string into a text substitution.
nuku (reporter)
2016-12-05 08:47

Curious, since those have been there a while. Still, if it helps?
nuku (reporter)
2016-12-05 08:49

The auto translator extensions are not included in the program, near as I see?
DavidK (developer)
2016-12-05 09:05

Yes, it looks like I'm getting [^] with the patched ni.
DavidK (developer)
2016-12-05 09:05

Anyway, nuku, would you try the patched ni?
dfremont (reporter)
2016-12-05 09:39

To be clear, 0001830 happens when there's a faulty extension that you're *not* including in your story. You need to either fix the error in the extension (i.e. shorten that overlong quoted text), or delete the extension file completely.
nuku (reporter)
2016-12-05 10:01

It compiled! So many thanks!
DavidK (developer)
2016-12-05 12:11

Great. I'll leave this bug open so that Graham can look at making a proper fix for the memory limit in the next version.

- Issue History
Date Modified Username Field Change
2016-11-27 15:20 nuku New Issue
2016-11-28 12:30 nuku Note Added: 0004605
2016-11-28 21:42 dfremont Note Added: 0004607
2016-11-28 21:45 nuku Note Added: 0004608
2016-11-29 00:36 DavidK Note Added: 0004609
2016-11-29 00:49 dfremont Note Added: 0004610
2016-11-29 03:28 DavidK Note Added: 0004611
2016-11-29 05:11 nuku Note Added: 0004612
2016-11-29 08:29 nuku Note Added: 0004613
2016-12-05 06:00 DavidK Note Added: 0004622
2016-12-05 06:01 DavidK Summary Failure to Compile => Can get out of memory error before the compiler is really out of memory
2016-12-05 07:41 nuku Note Added: 0004623
2016-12-05 08:40 dfremont Note Added: 0004624
2016-12-05 08:47 nuku Note Added: 0004625
2016-12-05 08:49 nuku Note Added: 0004626
2016-12-05 09:05 DavidK Note Added: 0004627
2016-12-05 09:05 DavidK Note Added: 0004628
2016-12-05 09:39 dfremont Note Added: 0004629
2016-12-05 10:01 nuku Note Added: 0004630
2016-12-05 12:11 DavidK Note Added: 0004631
2016-12-05 12:11 DavidK Status new => confirmed

Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker