glibc/scripts
Alexey Makhalov cebcb9f864 Fix range check in do_tunable_update_val
Current implementation of tunables does not set arena_max and arena_test
values. Any value provided by glibc.malloc.arena_max and
glibc.malloc.arena_test parameters is ignored.

These tunables have minval value set to 1 (see elf/dl-tunables.list file)
and undefined maxval value. In that case default value (which is 0. see
scripts/gen-tunables.awk) is being used to set maxval.

For instance, generated tunable_list[] entry for arena_max is:
(gdb) p *cur
$1 = {name = 0x7ffff7df6217 "glibc.malloc.arena_max",
 type = {type_code = TUNABLE_TYPE_SIZE_T, min = 1, max = 0},
  val = {numval = 0, strval = 0x0}, initialized = false,
   security_level = TUNABLE_SECLEVEL_SXID_IGNORE,
    env_alias = 0x7ffff7df622e "MALLOC_ARENA_MAX"}

As a result, any value of glibc.malloc.arena_max is ignored by
TUNABLE_SET_VAL_IF_VALID_RANGE macro
  __type min = (__cur)->type.min;                    <- initialized to 1
  __type max = (__cur)->type.max;                    <- initialized to 0!
  if (min == max)                                    <- false
    {
      min = __default_min;
      max = __default_max;
    }
  if ((__type) (__val) >= min && (__type) (val) <= max)  <- false
    {
      (__cur)->val.numval = val;
      (__cur)->initialized = true;
    }

Assigning correct min/max values at a build time fixes a problem.
Plus, a bit of optimization: Setting of default min/max values for the
given type at a run time might be eliminated.

	* elf/dl-tunables.c (do_tunable_update_val): Range checking fix.
	* scripts/gen-tunables.awk: Set unspecified minval and/or maxval
	values to correct default value for given type.
2017-09-27 02:44:09 +05:30
..
abi-versions.awk
abilist.awk
backport-support.sh Add scripts/backport-support.sh 2017-02-28 16:36:26 +01:00
build-many-glibcs.py Use MPFR 3.1.6 in build-many-glibcs.py. 2017-09-07 14:50:32 +00:00
check-c++-types.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
check-execstack.awk
check-installed-headers.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
check-local-headers.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
check-localplt.awk
check-textrel.awk
config-uname.sh
config.guess Update config.guess and config.sub to current versions. 2017-01-01 00:29:55 +00:00
config.sub Update config.guess and config.sub to current versions. 2017-01-01 00:29:55 +00:00
cpp
cross-test-ssh.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
documented.sh
evaluate-test.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
firstversions.awk
gen-as-const.awk
gen-libc-abis
gen-libc-modules.awk
gen-posix-conf-vars.awk
gen-py-const.awk Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gen-rrtypes.py Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gen-sorted.awk Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gen-tunables.awk Fix range check in do_tunable_update_val 2017-09-27 02:44:09 +05:30
install-sh Update miscellaneous files from upstream sources. 2016-12-21 16:05:55 +00:00
lib-names.awk
list-fixed-bugs.py Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
list-sources.sh
localplt.awk
merge-test-results.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mkinstalldirs Update miscellaneous files from upstream sources. 2016-12-21 16:05:55 +00:00
move-if-change Update miscellaneous files from upstream sources. 2016-12-21 16:05:55 +00:00
output-format.sed
pylint
pylintrc
rellns-sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
soversions.awk
sysd-rules.awk
test_printers_common.py Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
test_printers_exceptions.py Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
test-installation.pl Update copyright dates not handled by scripts/update-copyrights. 2017-01-01 00:26:24 +00:00
update-abilist.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
update-copyrights Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
versionlist.awk Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
versions.awk Also create and use ldbl-compat-choose.h. 2017-05-19 11:30:26 +00:00