This is a multi-part message in MIME format.

--------------3F54FF6ABD
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

-- 
    Bob Palermo ( bob@printrak.com )

--------------3F54FF6ABD
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="malloc.post"


I am running OSF 3.2 Rev C and Rev D and have run into an into what 
appears to be a bug in the thread-safe version of malloc.

Given the following program:

main()
{
    unsigned char *buff;
	
    buff = (unsigned char*) malloc( 4000*4502 );

    printf( "sleeping ...\n" );
    sleep( 20 );
}

If this program is built as follows:
    cc -o blorf blorf.c

then when this program runs it will have a virtual size of about 18.5M
( I used 'ps -o user,vsize,command | grep blorf' to determine this.)

However, if this program is built as follows:
    cc -o blorf blorf.c -threads

then when this program runs it will have a virtual size of about 34.5M

I've noticed that the size of the block of memory allocated affects the
behavior of the bug.  For example, when the same program attempts to
allocate a block of memory that is 4000*4000 bytes in size the discrepency
between the 'threads' version and 'non-threads' version is only about 2.5M.

Has anyone else seen this ?
Is this a feature or a bug ?
If it is a bug is there an existing patch ?



Any help is appreciated.

Thanks.

--------------3F54FF6ABD--
