|
From: Mark W. <ma...@so...> - 2017-10-20 12:59:17
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=476b52d62dd9513a97235caad6f0275cbb903fc2 commit 476b52d62dd9513a97235caad6f0275cbb903fc2 Author: Mark Wielaard <ma...@kl...> Date: Fri Oct 20 14:55:06 2017 +0200 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: --- NEWS | 1 + none/tests/rlimit_nofile.c | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 50c0097..11055cf 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 c6d2be6..1f45612 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); } |