SCO Unix 3.2 brk()/sbrk() problems????

Brian Chapman chapman at sco.COM
Fri Jan 4 09:47:18 AEST 1991


yml at grebyn.com (Yermo M. Lamers) writes:

>Under SCO Unix 3.2 when I use sbrk() with a positive argument, the size
>of the process as reported by ps -l does get larger, but when I use
>sbrk() with a negative argument the process size as reported by ps -l
>does not get smaller. It seems to remain constant. (This same problem
>also occurs with malloc() and free(). )

>Is there another way to find out the size of a process instead of using
>ps? (could there be a bug in ps?)

Yes there is a bug in ps(C).  More percisly, there is a bug in the
kernel data strucures that ps reads.   The size fields in the upage
were not being updated properly.  These fields have *no*function*
except to be read by ps, so nothing else is going wrong.

The size of data was never decreased or cleared, even in exec()!
try:
$ sh
$ sh
$ sh
$ sh
$ sh
$ ps -l

Notice that the processes are listed in increasing data sizes.

I would like to repeat:  This problem is understood, and fixed
for the next release.  There are no ill effects except for the
incorrect size reported in ps(C).
-- 
Brian Chapman		uunet!sco!chapman
Pay no attention to the man behind the curtain!



More information about the Comp.unix.sysv386 mailing list