This is the mail archive of the
mailing list for the glibc project.
Re: Belated ping2, Re: [RFC][patch] Fix racy nptl/tst-getpid2
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Brooks Moses <bmoses at google dot com>
- Cc: libc-alpha at sourceware dot org, Paul Pluzhnikov <ppluzhnikov at google dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Mon, 25 Nov 2013 15:58:34 +0530
- Subject: Re: Belated ping2, Re: [RFC][patch] Fix racy nptl/tst-getpid2
- Authentication-results: sourceware.org; auth=none
- References: <20121001183214 dot B03561908A5 at elbrus2 dot mtv dot corp dot google dot com> <CAMe9rOpTjYCn_mjpG=eavdeu94K1zE3m7keDyFmsc6Wf6PX0WQ at mail dot gmail dot com> <CALoOobNPYsei9J-kqg97zgGmYmY5nTnW-U7CoLp5UyzzHwhQdg at mail dot gmail dot com> <CALoOobNKe-=yyh0YnEKtn2+DHrXpkgG4PVrJdg3iAiouK+XPEQ at mail dot gmail dot com> <528D7246 dot 7010103 at google dot com>
On Wed, Nov 20, 2013 at 06:39:02PM -0800, Brooks Moses wrote:
> I know it's been a while, but I got bitten by this one again just
> now. It would be nice to either fix the test or get it removed on
> grounds of being invalid.
> If there's consensus with H.J.'s assertion that it's invalid, I'll
> gladly write the obvious patch to remove it.
> - Brooks
I agree with Paul and think the patch is OK. My understanding from
reading the code is that the test verifies clone functionality with
CLONE_THREAD is not set and CLONE_VM is set and ensures that the PID
is set (and reset) appropriately in userspace.
> diff --git a/nptl/Makefile b/nptl/Makefile
> index b081b07..6f64b2c 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -270,6 +270,9 @@ tests-nolibpthread = tst-unload
> # of the page size since every architecture's page size is > 1k.
> tst-oddstacklimit-ENV = ; ulimit -s 1023;
> +# Avoid TLS race in dynamic loader
> +tst-getpid2-ENV = LD_BIND_NOW=1
> gen-as-const-headers = pthread-errnos.sym
> LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst