pthread_create() returning EINTR? (glibc-2.1.3, Linux x86 kernel 2.2.15, gcc-2.95.2)

Britton fsblk@aurora.uaf.edu
Fri Oct 13 15:20:00 GMT 2000


On Fri, 13 Oct 2000, George T. Talbot wrote:

> I've got a program which spawns threads that listen on sockets.  After
> running for a while, and opening and closing a lot of sockets, and
> starting a lot of threads, pthread_create() returns -1 with errno set to
> EINTR.  EINTR isn't listed on pthread_create()'s man page, though I know
> what it is after using select().

pthread_create() won't ever set errno.  pthread function returns zero on
success, and an error code on error.  So the value you are seeing in errno
is either the result of an error in some previous other system call, or
errno is just starting out at EINTR and never getting changed (this has
happened to me).

> Once it starts returning EINTR, no more threads can be created.  I also
> see this:
> 
> BUG IN DYNAMIC LINKER ld.so: dl-runtime.c: 67: fixup: Assertion
> `((reloc->r_info) & 0xff) == 7' failed!
> 
> At this point I'm going to assume that I've either corrupted some data
> structure, or run out of some critical system resource.  Any ideas?

Probably you have run up against PTHREAD_THREADS_MAX.

Britton



More information about the Libc-alpha mailing list