[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#325600: <defunct> threads.... a solution?



Hi All -

I finally tracked this down to the "pthread_read_children" call in the "manager.c" file in linuxthreads.

For some reason, the waitpid_not_cancel in the following "while" always returns 0
and no children are "reaped": (Line 947 or so)
 while ((pid = waitpid_not_cancel(-1, &status, WNOHANG | __WCLONE)) > 0) {
   pthread_exited(pid);

Children are then properly "reaped" if I change it to:
 while ((pid = wait3( &status,  WNOHANG | __WCLONE, NULL )) > 0 ) {
   pthread_exited(pid);

I'm not sure if "wait4" (which waitpid_not_cancel uses) is broken, or the INLINE_SYSCALL
macro is somehow broken and doesn't return the correct value.

In any case, "wait3", not-inlined, works nicely for me ... I'll leave it up to the maintainers to determine the best patch to encompass all platforms, I'll cerainly be happy for now.

...tom



Reply to: