[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
race in malloc(3)?
- To: tech@openbsd.org
- Subject: race in malloc(3)?
- From: Alexander Yurchenko <grange@rt.mipt.ru>
- Date: Tue, 9 Oct 2001 12:36:21 +0400
- Content-Disposition: inline
- User-Agent: Mutt/1.2.5i
Is it ok that the following program fails?
#include <sys/param.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main()
{
switch (rfork(RFPROC | RFMEM)) {
case -1:
perror("rfork()");
exit(-1);
case 0:
malloc(1);
exit(0);
}
usleep(1);
malloc(1);
/* Core dumped here */
}
--
Alexander Yurchenko (aka grange)