Bug 462825 - Utrace patch prevents clone()d thread from exiting.
Utrace patch prevents clone()d thread from exiting.
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Roland McGrath
Fedora Extras Quality Assurance
Depends On:
  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:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-10-23 22:36:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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 and Fedora 9's are affected.

How reproducible:

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);
		while (waitpid(pid, &error, __WALL) == EOF && errno == EINTR);
	printf("waitpid() returned %d\n", WIFEXITED(error) ? WEXITSTATUS(error) : -1);
	return 0;
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

> 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- and kernel- 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.