Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!sco!chapman From: chapman@sco.COM (Brian Chapman) Newsgroups: comp.unix.sysv386 Subject: Re: SCO Unix 3.2 brk()/sbrk() problems???? Message-ID: <9395@scolex.sco.COM> Date: 3 Jan 91 22:47:18 GMT References: <24408@grebyn.com> Sender: news@sco.COM Lines: 34 yml@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!