PERFORCE change 113819 for review

Roman Divacky rdivacky at FreeBSD.org
Thu Feb 1 09:15:55 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=113819

Change 113819 by rdivacky at rdivacky_witten on 2007/02/01 09:15:53

	Reparent all procs that are part of a threading group but not its leaders
	to init and SIGCHLD init to finish the zombies off. This fixes zombies
	left after opera's exit.
	
	Noticed by: Scott Robbins <scottro at nyc.rr.com>

Affected files ...

.. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#29 edit

Differences ...

==== //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#29 (text+ko) ====

@@ -165,6 +165,17 @@
 
 	KASSERT(em != NULL, ("proc_exit: emuldata not found.\n"));
 
+	/* reparent all procs that are not a thread leader to initproc */
+	if (em->shared->group_pid != p->p_pid) {
+	   	sx_xlock(&proctree_lock);
+	   	wakeup(initproc);
+		PROC_LOCK(p);
+		proc_reparent(p, initproc);
+		p->p_sigparent = SIGCHLD;
+		PROC_UNLOCK(p);
+	   	sx_xunlock(&proctree_lock);
+	}
+
 	child_clear_tid = em->child_clear_tid;
 
 	EMUL_UNLOCK(&emul_lock);


More information about the p4-projects mailing list