[comp.os.minix] bug in chmem.c

martin@iris.ucdavis.edu (Bruce K. Martin Jr.) (09/19/87)

Symptoms:  chmem was allocating to much memory (over 64K) to exectuables
when given a command such as  chmem =64000 mined

This would cause mined to crash.

This will be a problem if you are compiling your
programs without seperate I & D (namely with the minix cc).  What happens
is that when chmem calculates the new header field TOTAL, it does not
remove the text space size until after the new TOTAL has been written.
Here is the diff to chmem.c

55a56
>   if (separate == 0) newtot += header[TEXT];
59d59
<   if (separate == 0) newtot += header[TEXT];



				...bruce

Bruce K. Martin Jr.  UC. Davis  Div. of Computer Science
martin@iris.ucdavis.edu  --or--  {ucbvax | lll-crg}!ucdavis!iris!martin