[PATCH 18/20] Fix elf/tst-dlmopen-twice to support enough link namespaces
Florian Weimer
fweimer@redhat.com
Thu Oct 27 16:51:34 GMT 2022
* Szabolcs Nagy:
> The 10/27/2022 18:24, Florian Weimer wrote:
>> * Szabolcs Nagy via Libc-alpha:
>>
>> > The test dlmopens 10 namespaces recursively, which requires a glibc
>> > tunable setting, otherwise it may run out of static TLS.
>> > ---
>> > elf/Makefile | 1 +
>> > elf/tst-dlmopen-twice.c | 2 +-
>> > 2 files changed, 2 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/elf/Makefile b/elf/Makefile
>> > index 7b50ccc07a..ace15dc11b 100644
>> > --- a/elf/Makefile
>> > +++ b/elf/Makefile
>> > @@ -2969,6 +2969,7 @@ tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
>> > $(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so
>> > tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
>> >
>> > +tst-dlmopen-twice-ENV = GLIBC_TUNABLES=glibc.rtld.nns=10
>> > $(objpfx)tst-dlmopen-twice.out: \
>> > $(objpfx)tst-dlmopen-twice-mod1.so \
>> > $(objpfx)tst-dlmopen-twice-mod2.so
>> > diff --git a/elf/tst-dlmopen-twice.c b/elf/tst-dlmopen-twice.c
>> > index 70c71fe19c..dfa58b1505 100644
>> > --- a/elf/tst-dlmopen-twice.c
>> > +++ b/elf/tst-dlmopen-twice.c
>> > @@ -46,7 +46,7 @@ do_test (void)
>> > recurse (1);
>> >
>> > /* Then with nesting. The constant needs to be less than the
>> > - internal DL_NNS namespace constant. */
>> > + glibc.rtld.nns tunable (which is between 1 and DL_NNS). */
>> > recurse (10);
>> > return 0;
>> > }
>>
>> This doesn't work if configured with --disable-tunables.
>>
>> I suspect this is merely a symptom. The static TLS sizing defaults
>> should allow creating DL_NNS namespaces?
>
> the tunable defaults to 4, DL_NNS is 16 and that's the max value
> of the tunable (since that's the static namespace array size)
Maybe we should lower the constant from 10 to 3 then? I mistakenly
assumed the namespace count was higher than it actually is. 3 should
not yet invalidate the test.
Thanks,
Florian
More information about the Libc-alpha
mailing list