This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Tweak test-*exit-race tests to honor the maximum number of processes


On Tue, Jan 30, 2018 at 12:04:06PM -0800, Carlos O'Donell wrote:
> On 01/30/2018 08:54 AM, Dmitry V. Levin wrote:
> > When the number of threads created by test-*exit-race tests is close
> > to the maximum number of simultaneous processes per uid, these tests
> > fail with the following diagnostics:
> > 
> > error: xpthread_check_return.c:32: pthread_create: Resource temporarily unavailable
> > 
> > Workaround this issue by limiting the number of threads created
> > by these tests to sysconf (_SC_CHILD_MAX) / 2.
> > 
> > Tested that these tests still fail reliably on x86_64 with glibc-2.26
> > and sysconf (_SC_CHILD_MAX) == 512.
> > 
> > *  stdlib/test-atexit-race-common.c: Include <unistd.h>.
> > (kNumThreads): Remove const qualifier.
> > (do_test): Limit kNumThreads to sysconf (_SC_CHILD_MAX) / 2.
> 
> The test should return UNSUPPORTED if an expected minimum number of threads
> required to reliably trigger the test cannot be created e.g. 512.

It depends on what do you call reliably.  For example, on an x86_64 box
with `getconf _NPROCESSORS_ONLN` == 32 the chance of test-atexit-race
*not* to trigger a segfault with glibc-2.26 was about 0.08% with current
value of kNumThreads == 1024, and this chance increased roughly 4 times
to about 0.34% with kNumThreads == 256.


-- 
ldv

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]