36

As the title states, compiling with latex produces the error, right away:

Ouch---my internal constants have been clobbered!---case 14

I have no idea what this means... I use TexLive 2012. I updated my texmf.cnf and ran fmtutil-sys and texhash. I guess texhash may have messed it up?

Any ideas?

As requested a minimal working example:

\documentclass{article}
\begin{document}
    Any tex file.
\end{document}
Markus
  • 1,365

1 Answers1

56

The error message

Ouch---my internal constants have been clobbered!---case 14

is caused by

if (mem_min<min_halfword)or(mem_max>=max_halfword)or@|
  (mem_bot-mem_min>max_halfword+1) then bad:=14;

in pdftex.web. Probably you have changed the memory settings in texmf.cnf that triggers the error. For further analysis these changes would be useful.

Maximal main_memory

tex.ch changes the code lines above to:

if (mem_bot-sup_main_memory<min_halfword)or@|
  (mem_top+sup_main_memory>=max_halfword) then bad:=14;

Also it defines max_halfword as:

@d max_halfword==@"FFFFFFF {largest allowable value in a |halfword|}

That is 228-1 = 268,435,455. The value for sup_main_memory:

@!sup_main_memory = 256000000;

And mem_top is initialized as:

mem_top := mem_bot + main_memory -1;

Then the latest condition for triggering the error becomes:

mem_top + sup_mem_memorymax_half_word
main_memorymax_halfword - sup_main_memory + 1
main_memory ≥ 12,435,456

or main_memory must be smaller or equal than 12,435,455.

Memory units

From tex.web:

@!mem : array[mem_min..mem_max] of memory_word; {the big dynamic storage area}
...
@!memory_word = record@;@/
  case four_choices of
  1: (@!int:integer);
  2: (@!gr:glue_ratio);
  3: (@!hh:two_halves);
  4: (@!qqqq:four_quarters);
  end;

The translation to bytes seems to be system dependent, from texmfmem.h my guess for memory_word are four or eight bytes.

Heiko Oberdiek
  • 271,626
  • 1
    Indeed, I apparently had one too many zeros for the main_memory entry. Reread the config files. No more error! Thank you! – Markus Aug 13 '12 at 21:03
  • 1
    Is there an easy way to find out the max_halfword? In the TeX sources I found a #define that set it to 1073741823 but this error occurs way before my main_memory variable reaches that value. – Christian May 17 '13 at 17:27
  • 2
    @Christian I have updated the answer to add some calculation for main_memory. – Heiko Oberdiek May 17 '13 at 18:14
  • @HeikoOberdiek Oh that's great. This works indeed just so :) Just out of curiosity, are these bytes, words or what else? If it's bytes, that's awfully few :/ – Christian May 17 '13 at 19:19
  • @Christian Answer updated with my guesses for the size of the memory units. – Heiko Oberdiek May 17 '13 at 19:34
  • @HeikoOberdiek Thanks again! I was silently hoping for 4K blocks or something but well, I guess TeX's age just shows in such things. – Christian May 17 '13 at 19:37
  • Message from ten years later: here I am fighting the same error. Maybe it's time TeX updated its handling of memory?

    Anyway, thanks @HeikoOberdiek, you're the GOAT.

    – Francisco Sep 15 '23 at 14:25
  • This a cursed way to handle being out of memory in 2023. – beyarkay Nov 26 '23 at 18:10