This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 0/4] Fix getrlimit/setrlimit/prlimit on Alpha and 32-bit machines
- From: Aurelien Jarno <aurelien at aurel32 dot net>
- To: libc-alpha at sourceware dot org
- Cc: Aurelien Jarno <aurelien at aurel32 dot net>
- Date: Fri, 5 Jan 2018 14:24:25 +0100
- Subject: [PATCH 0/4] Fix getrlimit/setrlimit/prlimit on Alpha and 32-bit machines
- Authentication-results: sourceware.org; auth=none
Since commit 045c13d185 ("Consolidate Linux setrlimit and getrlimit
implementation") which is in glibc 2.25, the getrlimit and setrlimit
functions are broken when used with RLIM_INFINITY on alpha. The commit
changed the syscalls behind these functions from getrlimit/setrlimit to
prlimit64. RLIM_INFINITY is not represented the same way in these
syscalls on alpha. The getrlimit/setrlimit syscalls use the same
definition than the GNU libc, that is 0x7fffffffffffffff while prlimit64
uses a standard value across all architectures which is 0xffffffffffffffff.
The commit therefore broke the getrlimit/setrlimit functions on alpha,
and is the reason why dozens of the glibc tests abort with:
allocatestack.c:480: allocate_stack: Assertion `size != 0' failed.
This patch series fixes that in two steps, the first patch adds a
wrapper to fix the value before/after the syscall and can be backported
to stable branches. The second add a new symbol so that the
RLIM_INFINITY value can be changed to the same value as in the kernel
and other architectures.
The third patch fixes an issue with prlimit and RLIM_INFINITY on 32-bit
machines found while writing a test. The last patch add a test to detect
such issueS.
Aurelien Jarno (4):
Alpha: Add wrappers to get/setrlimit64 to fix RLIM64_INFINITY constant
[BZ #22648]
Alpha: Fix the RLIM_INFINITY and RLIM64_INFINITY constants
prlimit: Translate old_rlimit from RLIM64_INFINITY to RLIM_INFINITY
[BZ #22678]
Add test for getrlimit/setrlimit/prlimit with infinity value
ChangeLog | 41 +++++++
sysdeps/unix/sysv/linux/Makefile | 3 +-
sysdeps/unix/sysv/linux/alpha/Versions | 3 +
sysdeps/unix/sysv/linux/alpha/bits/resource.h | 6 +-
sysdeps/unix/sysv/linux/alpha/getrlimit64.c | 56 +++++++++
sysdeps/unix/sysv/linux/alpha/libc.abilist | 4 +
sysdeps/unix/sysv/linux/alpha/setrlimit64.c | 53 +++++++++
sysdeps/unix/sysv/linux/getrlimit64.c | 18 +--
sysdeps/unix/sysv/linux/prlimit.c | 15 ++-
sysdeps/unix/sysv/linux/setrlimit64.c | 5 +
sysdeps/unix/sysv/linux/tst-rlimit-infinity.c | 157 ++++++++++++++++++++++++++
11 files changed, 342 insertions(+), 19 deletions(-)
create mode 100644 sysdeps/unix/sysv/linux/alpha/getrlimit64.c
create mode 100644 sysdeps/unix/sysv/linux/alpha/setrlimit64.c
create mode 100644 sysdeps/unix/sysv/linux/tst-rlimit-infinity.c
--
2.15.1