From: Mark Wielaard Date: Fri, 20 Oct 2017 12:55:06 +0000 (+0200) Subject: Bug #385912. Remove explicit NULL check from none/tests/rlimit_nofile. X-Git-Tag: VALGRIND_3_14_0~223 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=476b52d62dd9513a97235caad6f0275cbb903fc2;p=thirdparty%2Fvalgrind.git Bug #385912. Remove explicit NULL check from none/tests/rlimit_nofile. glibc doesn't guarantee anything about setrlimit with a NULL limit argument. It could just crash (if it needs to adjust the limit) or might silently succeed (as newer glibc do). Just remove the extra check. See also the "setrlimit change to prlimit change in behavior" thread: https://sourceware.org/ml/libc-alpha/2017-10/threads.html#00830 --- diff --git a/NEWS b/NEWS index 50c0097d3e..11055cf5a7 100644 --- a/NEWS +++ b/NEWS @@ -66,6 +66,7 @@ n-i-bz Fix missing workq_ops operations (macOS) 385183 PPC64, Add support for xscmpeqdp, xscmpgtdp, xscmpgedp, xsmincdp instructions 385334 PPC64, fix vpermr, xxperm, xxpermr mask value. 385868 glibc ld.so _dl_runtime_resolve_avx_slow conditional jump warning. +385912 none/tests/rlimit_nofile fails on newer glibc/kernel. Release 3.13.0 (15 June 2017) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/none/tests/rlimit_nofile.c b/none/tests/rlimit_nofile.c index c6d2be6b99..1f45612b97 100644 --- a/none/tests/rlimit_nofile.c +++ b/none/tests/rlimit_nofile.c @@ -98,11 +98,9 @@ int main(int argc, char **argv) perror("open"); } - if (setrlimit(RLIMIT_NOFILE, NULL) != -1 || errno != EFAULT) - { - fprintf(stderr, "setrlimit non addressable arg2 must set errno=EFAULT\n"); - exit(1); - } + /* We used to test setrlimit(RLIMIT_NOFILE, NULL) -1 || errno != EFAULT, + but glibc doesn't give any guarantees that won't just crash, in + newer versions it just silently succeeds... See bug #385912. */ exit(0); }