Subject: Re: [vserver] Concurrency issue in /proc?
From: Herbert Poetzl <herbert@13thfloor.at>
Date: Tue, 29 Jun 2010 18:28:06 +0200

On Tue, Jun 29, 2010 at 08:17:01AM -0400, Patrick LeBoutillier wrote:
> Hi all,

> I'm running kernel 2.6.32.6 with patch 2.3.0.36.28 and I 
> think there's a concurrency issue in the /proc /filesystem. 

sounds interesting ...

> Don't know if that makes a difference, but I'm also using 
> Jacques' tools.

would suggest to test with util-vserver (only), just to
rule out that the issue is tool related (i.e. incomplete
isolation or similar)

i.e. please create and start a test guest with util-vserver
and see if you can recreate the issue ...

> On a multicore (8 cores) server, if I run the following script:

> while /bin/true ; do
>         ls -ld /proc/self > /dev/null
> done

> twice in parallel (i.e. sh test.sh & sh test.sh) inside a guest, I get
> a lot of errors like this:
> 
> ls: cannot read symbolic link /proc/self: No such file or directory
> ls: cannot read symbolic link /proc/self: No such file or directory
> ls: /proc/self: No such file or directory
> ls: cannot read symbolic link /proc/self: No such file or directory
> ls: cannot read symbolic link /proc/self: No such file or directory
> ls: cannot read symbolic link /proc/self: No such file or directory
> ls: /proc/self: No such file or directory

> However, if I run the same script directly in the root server, I can't
> reproduce the issue.

> Here's how the various procs are mounted:
> none on /proc type proc (rw)                       # root /proc
> none on /vtmp/test/proc type proc (rw)         # guest /proc

> Does anyone have a clue on how to fix this? 

once we can reproduce it, we can fix it :)

> I looked at the patch, but it's a bit out of my league...

I tried here (to recreate the issue) with a dual core
cpu (kernel 2.6.33.x) but couldn't reproduce ....

It might be a good idea to update to a recent kernel
or at least recent patch as well, just to make sure
that you are not seeing a (mainline) issue which was
already fixed ....

thanks in advance,
Herbert

> Thanks,
> Patrick
> 
> -- 
> =====================
> Patrick LeBoutillier
> Rosemère, Québec, Canada