coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

require_ulimit_v_(): tests skipped with enable-single-binary


From: Bernhard Voelker
Subject: require_ulimit_v_(): tests skipped with enable-single-binary
Date: Wed, 9 Sep 2015 01:18:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

All tests using 'require_ulimit_v_' are skipped when configuring with
either --enable-single-binary=shebangs or ...=symlinks.


+ require_ulimit_v_
+ local ulimit_works=yes
+ local vm
+ case $(printenv LD_PRELOAD) in
++ printenv LD_PRELOAD
+ vm=10000
+ ulimit -v 10000
+ date
/tmp/coreutils-8.24.16-907f3/build2/src/coreutils: error while loading shared 
libraries: libcap.so.2: failed to map
segment from shared object: Cannot allocate memory
+ ulimit_works=no
+ ulimit -v 20
+ date
../init.cfg: line 148: 29355 Killed                  date
+ test no = no
+ skip_ 'this shell lacks ulimit support'


The reason is that the multicall 'coreutils' binary requires
much more memory due to shared libraries being loaded, and the
size of the 'date' binary (~290KiB) compared to the multicall
binary (~5MiB), of course.

Adapting the above limit in the case the single-binary option is
active doesn't help much, as the actual tests would still use hard
coded values for 'ulimit -v' which are too low, of course.

One solution could be that 'require_ulimit_v_' determines the
basic memory the actual test program (cp, dd, etc.) needs, and
that the test then uses that value plus a certain number as actual
memory limit.  Something along the following (completely untested!)
lines:

  require_ulimit_v() {
    ...
    local v
    for v in $( seq 1000 1000 50000 ); do
      ( ulimit -v $v && "$@" ) && { echo $v; return 0; }
    done
    ...
    skip_ "can not determine basic ulimit"
    ...
  }

and in the tests:

  base=$( require_ulimit_v_ dd if=/dev/zero of=/dev/null bs=1 count=1 ) \
    || skip_ "ulimit not working"

  ( ulimit -v $(expr $base + 30000) && dd ... ) || fail=1
  ...

WDYT?  Is this worth the trouble?

Have a nice day,
Berny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]