On Sun, 2013-12-01 at 20:51 +0100, Jan Kratochvil wrote:
On Sun, 01 Dec 2013 18:50:33 +0100, Jan Kratochvil wrote:
> + errno = 0;
> + pthread_t thread;
> + int i = pthread_create (&thread, NULL, start, NULL);
> + assert_perror (errno);
BTW I randomly got here on F-19 x86_64:
backtrace-child: backtrace-child.c:207: main: Unexpected error: Cannot allocate memory.
But I do not have it reproducible and I cannot figure out how that could
happen.
> + assert (i == 0);
Note that the documentation of pthread_create doesn't say whether or not
it will set errno. It returns either zero for success or the error code
itself.
Maybe the setting of errno is an accident/implementation detail?
I would just remove the assert_perror (errno) here and see if that gets
rid of the random unexpected errors. The assert (i == 0) should remain
of course.
Cheers,
Mark