Linux Container Development
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
To: Sukadev Bhattiprolu
	<sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Cc: Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: Re: ctx->pipe_child bug ?
Date: Sat, 22 Jan 2011 13:28:22 -0500	[thread overview]
Message-ID: <4D3B21C6.70801@cs.columbia.edu> (raw)
In-Reply-To: <20110121073918.GA15385-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>



On 01/21/2011 02:39 AM, Sukadev Bhattiprolu wrote:
> Oren,
> 
> 
> In usercr commit 0dd3f9dacc0a08f5fb562e385a4e4244f453b41c we have the following
> diff:
> 
> @@ -1868,10 +1902,16 @@ static int ckpt_fork_feeder(struct ckpt_ctx *ctx)
>         close(ctx->pipe_child[0]);
>         ctx->pipe_out = ctx->pipe_child[1];
> 
> +       ctx->pipe_child[0] = -1;  /* mark unused */
> +       ctx->pipe_child[1] = -1;  /* mark unused */
> 
> ---
> 
> ckpt_fork_feeder() creates the ->pipe_child[] pipe and clones the fork_feeder.
> ckpt_do_feeder() does the following:
> 
> 
>         /* children pipe */
>         close(ctx->pipe_child[1]);
>         ctx->pipe_in = ctx->pipe_child[0];
> 
>         /* feeder pipe */
>         close(ctx->pipe_feed[0]);
> 
> But if the fork_feeder process runs after the parent marks the fds unused, the
> fork feeder would end up with a -1 in ctx->pipe_in right ?
> 
> The two threads don't share the fds but they do share the same VM and hence
> changes to 'ctx' in one process is visible in the other right ?

Good catch. I'll fix that, thanks.

Oren.

      parent reply	other threads:[~2011-01-22 18:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-21  7:39 ctx->pipe_child bug ? Sukadev Bhattiprolu
     [not found] ` <20110121073918.GA15385-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2011-01-22 18:28   ` Oren Laadan [this message]

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=4D3B21C6.70801@cs.columbia.edu \
    --to=orenl-eqauephvms7envbuuze7ea@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    /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