Marten Jan de Ruiter wrote:
Dear all,
The reason I tried to switch to a newer compiler is that the older compiler crashed on, I suspect, memory usage. Increasing a const that determines the size of a number of arrays causes the crash. Restoring the const to the old value gives a fine compilation. Compiler gpc 20030830, based on gcc-3.2.1 also crashes on a linux machine.
The crashes are consistent in the following way: At a clean start, i.e. after removing all the object and gpi files, the compiler crashes after line 86 in writestruct.p (see below). Subsequent compile runs, with the already compiled .o and .gpi files available, consistently show line 120 of the same file. Could be a --progress-messages thing, not related to the real cause of the crash, but I am not sure.
I do not know how to single out the problem for this case. Aside of posting the backtrace, I am in the dark. Can anyone point me to information on how to attack this problem?
It looks that you are passing large arrays by value. Such arrays may cause problems at runtime due to limit on stack usage (by default 10Mb on Linux) -- arguments are passed by value and consume stack space. Unfortunatly, such array consume even more space in the compiler. Try increase stack limit or pass them as `var' parameters (if you want to protect them from modification make them `protected').
FYI crash on programs passing large arrays happens in all versions (including 3.3 and 3.4 backends).