My heap is overwriting my stack !!!????

L. Marco lou at hoxna.UUCP
Thu Dec 4 09:46:35 AEST 1986


	My news 2.11 won't run because it won't fork. It won't
fork because it's corrupting its environment.  It's corrupting
its environment when it allocates a lot of storage for strings & stuff
in the routine sortactive(). Apparently, the heap is overwriting the
stack.  My questions (Besides the obvious "_Can_ this happen ??") are:

1. How the devil can something like this happen without
generating an error?  Programs that run out of stack crash.
Programs that allocate more memory than they have crash.
This just goes right on along.

2. How can I fix it ?  ("Don't allocate all that memory" :-) )
Is it a bad tunable parameter ?  I have an 11/780 with only 2 meg;
UNIX 5.2.02 (swapping, not paging).  Is it a hardware limitation ?
Can someone give some advice on which of the <some large integer>
variables in sortactive() could be made external or punted ?
One solution would be to save a copy of the environment before
it enters the "bad" code, then restore, or would that just make
the (supposed) memory problem worse, by adding more variables ?

3. What changed between 2.10 and 2.11 to make this happen ?


                                            hopeful in holmdel,

                                                     Lou Marco

ps- The environment gets trashed at ~line 632 in rfuncs.c, where
it's reading the active file and counting which articles are read.



More information about the Comp.unix.wizards mailing list