PROBLEM:        (TKTQ72352)     (Patch ID: OSF370-350247)
********
This patch fixes a problem in which the size field of a process
displayed by the acctcom command is displayed incorrectly.

Typically, processes that use a lot of memory will display very invalid
size values.   These sizes will either be absurdly large or negative.

Compile and run the following program.  Acctcom will display a size that
is about 8 times larger than the actual memory usage.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <sys/resource.h>

#define  ALLOC_SIZE  1024 * 1024 /* 1M byte */

main()
{
  int i;
  struct rusage ru;
  i = fork();
  if (i == 0) {
   child();
   }
  else {
   wait3(NULL,0,&ru);
   printf("size information %ld %ld %ld\n",ru.ru_ixrss,ru.ru_idrss,ru.ru_isrss);
        }
}
child()
{
{
  int     counter;
  int     i;
  char    *address;

  for( counter = 1 ; counter < 100 ; counter++ ) {
    address = ( char * )malloc( sizeof( char ) * ALLOC_SIZE );
    if( address == NULL ) {
      printf( "Can't allocate memory.\n" );
      sleep( 60 );
      exit( 0 );
      }

  for( i = 0 ; i < ALLOC_SIZE ; i++ ) {
    *address = ( char )( counter % 255 );

    address ++;
      }

    printf( "Allocate %5dM byte\n" , counter );
    }

  exit( 1 );
}


FILE(s):

/usr/bin/acctcom                subset OSFACCT350
CHECKSUM: 44395     40  RCSfile: acctcom.c   RCS: 4.3.20.2
