From: ebiederm@xmission.com (Eric W. Biederman)
To: Josh Boyer <jwboyer@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Al Viro <viro@zeniv.linux.org.uk>, Mel Gorman <mgorman@suse.de>,
linux-kernel@vger.kernel.org, williams@redhat.com
Subject: Re: Odd ENOMEM being returned in 3.8-rcX
Date: Fri, 08 Feb 2013 12:45:47 -0800 [thread overview]
Message-ID: <87r4kqttz8.fsf@xmission.com> (raw)
In-Reply-To: <20130208202314.GF31684@hansolo.jdub.homelinux.org> (Josh Boyer's message of "Fri, 8 Feb 2013 15:23:14 -0500")
Josh Boyer <jwboyer@redhat.com> writes:
> < Two emails fly past each other in the night >
Yep.
>> My best guess in some dark corner of mock has untested code to unshare a
>> pid namespace, and that corner started doing something now that
>> unsharing of the pid namespace actually works.
>>
>> If mock has called unshare(CLONE_NEWPID). And then forked a process and
>> that process exited, and then forked anothe process that second and all
>> subsequent fork calls will fail with -ENOMEM (because init has exited in
>> the pid namespace). -ENOMEM will be generated because of a failure of
>> alloc_pid.
>>
>> Looking at that code path a little closer that just about has to be it,
>> because I goofed and the error path drops the lock but not irqs. The
>> patch below should fix the nasty warning and confirm where the code is
>> failing in copy_process.
>
> OK. I'll turn the debug option back on and give this patch a try.
Thanks. Your minimal test case also confirms my hunch. But we should
fix the error path as well.
>> An strace to see which syscalls mock is making and with which flags
>> would be very interesting. I am almost certain that there is a
>> unshare(CLONE_NEWPID) somewhere in there. But in a remote corner of
>> possibility it could weird clone flags, or something else.
>
> Oh, I have that but it's a python app with a helper C app and it's a...
> verbose strace. It's here for one failure:
>
> http://jwboyer.fedorapeople.org/pub/mock-strace
>
> Hopefully the testcase from my other email will help though. It's much
> simpler.
Yes. Your other test case confirms my patch you bisected this to is
working correctly.
>> Beyond that I suspect we want to work with the mock folks so they get
>> their code to use a pid namespace working the way they intended.
>
> Right. CC'd Clark (for real this time).
>
> I'll let you know on the patch.
Cool. Looking at the strace I can't figure out what mock expected
to happen or how mock was working before this. As mock is calling
unshare(CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWPID) all in one
go.
Previous to my patch enabling CLONE_NEWPID that would cause the unshare
to fail.
So it looks mock is taking a buggy untested code path and things are not
working as it expected.
Eric
next prev parent reply other threads:[~2013-02-08 20:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-07 21:57 Odd ENOMEM being returned in 3.8-rcX Josh Boyer
2013-02-07 22:15 ` Andrew Morton
2013-02-08 0:35 ` Josh Boyer
2013-02-08 18:19 ` Josh Boyer
2013-02-08 20:13 ` Eric W. Biederman
2013-02-08 20:23 ` Josh Boyer
2013-02-08 20:45 ` Eric W. Biederman [this message]
2013-02-08 21:27 ` Josh Boyer
2013-02-08 22:05 ` Eric W. Biederman
2013-02-08 22:40 ` Clark Williams
2013-02-08 22:10 ` Clark Williams
2013-02-08 22:40 ` Eric W. Biederman
2013-02-08 22:56 ` Clark Williams
2013-02-08 22:12 ` Josh Boyer
2013-02-11 23:57 ` Andrew Morton
2013-02-12 10:34 ` Eric W. Biederman
2013-02-08 20:18 ` Josh Boyer
2013-02-08 20:36 ` Eric W. Biederman
2013-02-08 20:40 ` Josh Boyer
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=87r4kqttz8.fsf@xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=jwboyer@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=viro@zeniv.linux.org.uk \
--cc=williams@redhat.com \
/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