public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Andy Johnson <johnsonzjo@gmail.com>
Cc: util-linux@vger.kernel.org
Subject: Re: Cannot allocate memory when calling unshare
Date: Thu, 09 May 2013 23:41:56 -0700	[thread overview]
Message-ID: <87ip2rz68b.fsf@xmission.com> (raw)
In-Reply-To: <CAF0Lin2XM9kSzjDyLJS19zV-M9PdAS55hH3jwDT3ph4F7mSYLg@mail.gmail.com> (Andy Johnson's message of "Fri, 10 May 2013 09:07:51 +0300")

Andy Johnson <johnsonzjo@gmail.com> writes:

> Thanks.
> Copy ans paste of that line:
> unshare --pid -- /bin/sh -c /bin/bash
>
> still gave:
> ./unshare --pid -- /bin/sh -c /bin/bash
> bash: fork: Cannot allocate memory
>
> also tried to tweak a bit and it did not help
> I am using latest git linux-util on fedora 18 with
> 3.8.4-202.fc18.x86_64 kernel

How weird.  It works here.

My hunch would be that my /bin/sh is dash, and fedora likes to use bash.
It looks like your /bin/sh is exec'ing /bin/bash instead of forking and
execing it.  You can look in another window and confirm that you don't
have two processes doing the work only one.

When it works echo $$ returns 1.

Shrug.

Eric

      reply	other threads:[~2013-05-10  6:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-07  5:03 Cannot allocate memory when calling unshare Andy Johnson
2013-05-09 18:26 ` Eric W. Biederman
2013-05-10  6:07   ` Andy Johnson
2013-05-10  6:41     ` Eric W. Biederman [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=87ip2rz68b.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=johnsonzjo@gmail.com \
    --cc=util-linux@vger.kernel.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