]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug #385912. Remove explicit NULL check from none/tests/rlimit_nofile.
authorMark Wielaard <mark@klomp.org>
Fri, 20 Oct 2017 12:55:06 +0000 (14:55 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 20 Oct 2017 12:55:06 +0000 (14:55 +0200)
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

NEWS
none/tests/rlimit_nofile.c

diff --git a/NEWS b/NEWS
index 50c0097d3e7a69bc089e69b8484b961404b385cc..11055cf5a76702ff5d1e2e2df6cb3872e0067863 100644 (file)
--- 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)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index c6d2be6b9914fa82f7e6413ea0b5b488b6468390..1f45612b9737df9d8d9d1188f06c9c5e4f92fe14 100644 (file)
@@ -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);
 }