Bug 462825 - Utrace patch prevents clone()d thread from exiting.
Utrace patch prevents clone()d thread from exiting.
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Roland McGrath
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-19 03:33 EDT by Tetsuo Handa
Modified: 2008-10-23 22:36 EDT (History)
2 users (show)

See Also:
Fixed In Version: 2.6.26.6-79.fc9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-10-23 22:36:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tetsuo Handa 2008-09-19 03:33:40 EDT
Description of problem:

I noticed that clone()d thread sleeps forever on exit.
The clone()d thread's state becomes zombie, but it is not notified to
the process calling waitpid().

Not applying the three patches listed below solves this problem.
I think this problem is introduced by one of these patches.

  # Roland's utrace ptrace replacement.
  ApplyPatch linux-2.6-ptrace-cleanup.patch
  ApplyPatch linux-2.6-tracehook.patch
  ApplyPatch linux-2.6-utrace.patch

Version-Release number of selected component (if applicable):

Fedora 8's 2.6.26.3-14.fc8 and Fedora 9's 2.6.26.3-29.fc9 are affected.

How reproducible:
100%

Steps to Reproduce:
1. Compile the following program and run.

----------
#define _GNU_SOURCE
#include <sched.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>

static int child(void *arg) {
	return 0;
}

int main(int argc, char *argv[]) {
	int error;
	char *stack = malloc(8192);
	printf("Calling clone() ");
	{
		const pid_t pid = clone(child, stack + (8192 / 2), CLONE_NEWNS, NULL);
		printf("(pid=%d)\n", pid);
		fflush(stdout);
		while (waitpid(pid, &error, __WALL) == EOF && errno == EINTR);
	}
	printf("waitpid() returned %d\n", WIFEXITED(error) ? WEXITSTATUS(error) : -1);
	return 0;
}
----------
2.
3.
  
Actual results:
It sleeps forever until terminated by Ctrl-C.

Expected results:
It sould return immediately.

Additional info:
Comment 1 Roland McGrath 2008-09-30 01:40:58 EDT
This is fixed in the rawhide kernel.
Comment 2 Tetsuo Handa 2008-10-11 07:11:14 EDT
Hello.

> This is fixed in the rawhide kernel.
I see. Thanks.

But I haven't seen the fixed kernel for Fedora 8 and Fedora 9 yet.
Are Fedora 8 and Fedora 9 planning to jump to 2.6.27 without fixing this bug? :-)
Comment 3 Tetsuo Handa 2008-10-21 08:03:14 EDT
I found kernel-2.6.26.6-49.fc8.src.rpm and kernel-2.6.26.6-79.fc9.src.rpm in updates/testing/ repository.

Please close this topic. Thank you.

Note You need to log in before you can comment on or make changes to this bug.