PROBLEM:  (TKTQ 72352)	 (Patch ID: OSF410-400230)
********
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
Acctcom will display a size that is about 8 times larger than the actual memory
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 OSFACCT410
CHECKSUM: 62535     40     RCSfile: acctcom.c      RCS: 4.3.21.2
