[RFC][patch] Fix racy nptl/tst-getpid2

H.J. Lu hjl.tools@gmail.com
Mon Oct 1 18:59:00 GMT 2012


On Mon, Oct 1, 2012 at 11:32 AM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
> Greetings,
>
> The nptl/tst-getpid2 failed on one of our nightly builders, and we've
> discovered that it is quite flaky:
>
> build=$PWD
> j=0;
> while GCONV_PATH=$build/iconvdata LC_ALL=C \
>     $build/elf/ld-linux-x86-64.so.2 --library-path $build:$build/nptl \
>         $build/nptl/tst-getpid2 > /dev/null; do
>   j=$(($j+1))
> done;
> echo "failed after $j iterations"
>
>
> Didn't expect signal from child: got `Illegal instruction'
> failed after 140 iterations
>
> Didn't expect signal from child: got `Illegal instruction'
> failed after 28 iterations
>
> Didn't expect signal from child: got `Illegal instruction'
> failed after 12 iterations
>
>
>
> What's happening here is that f() is invoked in a CLONE_VM cloned "thread",
> without setting up TLS for that cloned thread (and therefore sharing TLS
> with the parent thread).
>
> The dynamic loader doesn't expect such sharing, and will crash if two
> threads attempt to resolve some dynamic symbols at the same time.
>
> The crash goes away when LD_BIND_NOW=1 is set in the environment,
> as attached patch does.
>

It is

http://sourceware.org/bugzilla/show_bug.cgi?id=11214

I believe the test is invalid.

-- 
H.J.



More information about the Libc-alpha mailing list