mallocstress stresses the VMM and C library  by spawning N threads which malloc blocks of increasing size until malloc returns NULL. It occur because test doesn't wait for all thread started. already started threads begin allocate memory, so pthread_create can return ENOMEM. my patch added this synchronizing. I use semaphore, because it can wait-for-zero unlike pthread_mutex. sorry, forgot set permission in semget, new patch attached. Andrew Vagin <avagin@gmail.com>.
1 file changed