linux-um archives
 help / color / mirror / Atom feed
From: Gerd Knorr <kraxel@bytesex.org>
To: Paolo Giarrusso <blaisorblade_personal@yahoo.it>
Cc: user-mode-linux-devel@lists.sourceforge.net, Armin.Warda@gmx.de,
	"Christopher S. Aker" <caker@theshore.net>
Subject: Re: [uml-devel] Re: UML fills /tmp irreversibly (2.6.9-bb4 on SuSE 9.2)
Date: Mon, 10 Jan 2005 14:10:03 +0100	[thread overview]
Message-ID: <20050110131003.GA6121@bytesex> (raw)
In-Reply-To: <200501081315.34841.blaisorblade_personal@yahoo.it>

> Roland McGrath:
> 
>   o fix bogus ECHILD return from wait* with zombie group leader
> 
> I'm not sure this is the fix, but it is possible indeed, given that the 
> problem UML triggered was, IIRC, that when it exited, there wasn't a proper 
> cleanup of the status, and the process became invisible but still kept a 
> reference to the file in /tmp, preventing it from being deleted...

Yep, that makes sense.  The race thing also explains why it doesn't
allways happen.  I still can't reproduce it on my machine btw, so it's
hard for me to test whenever that really fixes it or not.

> I think you can search for it on linux.bkbits.net... I'll do that when I have 
> time...

Attached below for reference.

  Gerd

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/12/17 09:18:41-08:00 roland@redhat.com 
#   [PATCH] fix bogus ECHILD return from wait* with zombie group leader
#   
#   Klaus Dittrich observed this bug and posted a test case for it.
#   
#   This patch fixes both that failure mode and some others possible.  What
#   Klaus saw was a false negative (i.e.  ECHILD when there was a child)
#   when the group leader was a zombie but delayed because other children
#   live; in the test program this happens in a race between the two threads
#   dying on a signal.
#   
#   The change to the TASK_TRACED case avoids a potential false positive
#   (blocking, or WNOHANG returning 0, when there are really no children
#   left), in the race condition where my_ptrace_child returns zero.
#   
#   Signed-off-by: Roland McGrath <roland@redhat.com>
#   Signed-off-by: Andrew Morton <akpm@osdl.org>
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# kernel/exit.c
#   2004/12/17 00:09:08-08:00 roland@redhat.com +13 -2
#   fix bogus ECHILD return from wait* with zombie group leader
# 
diff -Nru a/kernel/exit.c b/kernel/exit.c
--- a/kernel/exit.c	2005-01-10 14:00:38 +01:00
+++ b/kernel/exit.c	2005-01-10 14:00:38 +01:00
@@ -1319,6 +1319,10 @@
 
 	add_wait_queue(&current->wait_chldexit,&wait);
 repeat:
+	/*
+	 * We will set this flag if we see any child that might later
+	 * match our criteria, even if we are not able to reap it yet.
+	 */
 	flag = 0;
 	current->state = TASK_INTERRUPTIBLE;
 	read_lock(&tasklist_lock);
@@ -1337,11 +1341,14 @@
 
 			switch (p->state) {
 			case TASK_TRACED:
-				flag = 1;
 				if (!my_ptrace_child(p))
 					continue;
 				/*FALLTHROUGH*/
 			case TASK_STOPPED:
+				/*
+				 * It's stopped now, so it might later
+				 * continue, exit, or stop again.
+				 */
 				flag = 1;
 				if (!(options & WUNTRACED) &&
 				    !my_ptrace_child(p))
@@ -1377,8 +1384,12 @@
 						goto end;
 					break;
 				}
-				flag = 1;
 check_continued:
+				/*
+				 * It's running now, so it might later
+				 * exit, stop, or stop and then continue.
+				 */
+				flag = 1;
 				if (!unlikely(options & WCONTINUED))
 					continue;
 				retval = wait_task_continued(


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  reply	other threads:[~2005-01-10 13:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-14  8:58 [uml-devel] UML fills /tmp irreversibly (2.6.9-bb4 on SuSE 9.2) Armin M. Warda
2004-12-16 14:50 ` [uml-devel] " Armin M. Warda
     [not found] ` <20041216183604.GB24982@bytesex>
     [not found]   ` <200412162013.21197.blaisorblade_personal@yahoo.it>
2004-12-30 14:20     ` Armin M. Warda
2004-12-30 16:14       ` Christopher S. Aker
2004-12-31 11:22         ` Armin M. Warda
2005-01-01 20:10           ` Christopher S. Aker
2005-01-02  9:25             ` Armin M. Warda
2005-01-03 14:07               ` Armin M. Warda
2005-01-03 10:13       ` Gerd Knorr
2005-01-03 11:49         ` Armin M. Warda
     [not found]           ` <20050103133412.GA25262@bytesex>
2005-01-03 14:31             ` Armin M. Warda
2005-01-04 11:59               ` Gerd Knorr
2005-01-04 14:05                 ` Armin M. Warda
2005-01-04 14:39                   ` Gerd Knorr
2005-01-04 15:33                     ` Christopher S. Aker
2005-01-05 11:28                       ` Gerd Knorr
2005-01-05 14:22                         ` Armin M. Warda
2005-01-07 11:20                           ` Gerd Knorr
2005-01-04 14:52                   ` Michael Richardson
2005-01-08 12:15               ` Paolo Giarrusso
2005-01-10 13:10                 ` Gerd Knorr [this message]
     [not found] ` <200501101450.32169.Armin.Warda@gmx.de>
     [not found]   ` <20050111165848.GA20592@bytesex>
2005-01-12 15:53     ` Armin M. Warda
2005-01-17 15:26       ` Gerd Knorr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050110131003.GA6121@bytesex \
    --to=kraxel@bytesex.org \
    --cc=Armin.Warda@gmx.de \
    --cc=blaisorblade_personal@yahoo.it \
    --cc=caker@theshore.net \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox