ld.so: Unset glibc tunables for --list-tunables test

Message ID CAMe9rOph540jV_QRn=P6p=RkKmE5hUUMMVWiAAuheJSse18n_A@mail.gmail.com
State Superseded
Headers
Series ld.so: Unset glibc tunables for --list-tunables test |

Commit Message

H.J. Lu Feb. 2, 2021, 5:36 p.m. UTC
  On Tue, Feb 2, 2021 at 2:59 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Jan 14 2021, H.J. Lu via Libc-alpha wrote:
>
> > diff --git a/elf/tst-rtld-list-tunables.exp b/elf/tst-rtld-list-tunables.exp
> > new file mode 100644
> > index 0000000000..4f3f7ee4e3
> > --- /dev/null
> > +++ b/elf/tst-rtld-list-tunables.exp
> > @@ -0,0 +1,14 @@
> > +glibc.malloc.arena_max: 0x0 (min: 0x1, max: 0x[f]+)
> > +glibc.malloc.arena_test: 0x0 (min: 0x1, max: 0x[f]+)
> > +glibc.malloc.check: 0 (min: 0, max: 3)
> > +glibc.malloc.mmap_max: 0 (min: -2147483648, max: 2147483647)
> > +glibc.malloc.mmap_threshold: 0x0 (min: 0x0, max: 0x[f]+)
> > +glibc.malloc.mxfast: 0x0 (min: 0x0, max: 0x[f]+)
> > +glibc.malloc.perturb: 0 (min: 0, max: 255)
> > +glibc.malloc.tcache_count: 0x0 (min: 0x0, max: 0x[f]+)
> > +glibc.malloc.tcache_max: 0x0 (min: 0x0, max: 0x[f]+)
> > +glibc.malloc.tcache_unsorted_limit: 0x0 (min: 0x0, max: 0x[f]+)
> > +glibc.malloc.top_pad: 0x0 (min: 0x0, max: 0x[f]+)
> > +glibc.malloc.trim_threshold: 0x0 (min: 0x0, max: 0x[f]+)
> > +glibc.rtld.nns: 0x4 (min: 0x1, max: 0x10)
> > +glibc.rtld.optional_static_tls: 0x200 (min: 0x0, max: 0x[f]+)
>
> This won't match if MALLOC_PERTURB_ is set.
>
> Andreas.

Here is the patch to unset tunables and their aliases for --list-tunables test.

OK for master?

Thanks.
  

Comments

Andreas Schwab Feb. 2, 2021, 6:07 p.m. UTC | #1
On Feb 02 2021, H.J. Lu wrote:

> From 321acb682702dd6ee273207b7ce832f8133abbfa Mon Sep 17 00:00:00 2001
> From: "H.J. Lu" <hjl.tools@gmail.com>
> Date: Tue, 2 Feb 2021 09:31:56 -0800
> Subject: [PATCH] ld.so: Unset glibc tunables for --list-tunables test
>
> Unset glibc tunables and their aliases for --list-tunables test.

Ok.  I think the subject should use tst-rtld-list-tunables.sh as the
topic prefix, since it doesn't change ld.so.

Andreas.
  

Patch

From 321acb682702dd6ee273207b7ce832f8133abbfa Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 2 Feb 2021 09:31:56 -0800
Subject: [PATCH] ld.so: Unset glibc tunables for --list-tunables test

Unset glibc tunables and their aliases for --list-tunables test.
---
 elf/tst-rtld-list-tunables.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/elf/tst-rtld-list-tunables.sh b/elf/tst-rtld-list-tunables.sh
index e7bbdde949..78f4ed2ebb 100755
--- a/elf/tst-rtld-list-tunables.sh
+++ b/elf/tst-rtld-list-tunables.sh
@@ -26,6 +26,17 @@  run_program_env=$3
 LC_ALL=C
 export LC_ALL
 
+# Unset tunables and their aliases.
+GLIBC_TUNABLES=
+MALLOC_ARENA_MAX=
+MALLOC_ARENA_TEST=
+MALLOC_CHECK_=
+MALLOC_MMAP_MAX_=
+MALLOC_MMAP_THRESHOLD_=
+MALLOC_PERTURB_=
+MALLOC_TOP_PAD_=
+MALLOC_TRIM_THRESHOLD_=
+
 ${test_wrapper_env} \
 ${run_program_env} \
 $rtld --list-tunables \
-- 
2.29.2