From patchwork Sat Dec 30 18:44:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 854139 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-88676-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="aRN1ifsh"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z8C7M5CHJz9s7s for ; Sun, 31 Dec 2017 05:45:03 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=g4vkYWu9Ydm+ASsYmlvMErrHTzlRtEqSACMDMmpHstq+JECcvHLvt to7PpynaUg9QGFufNveJtajD6DC03MzXF2GVObQwhgY19QRIed3xibWy+9z1bAhJ OxkA/HM+f5+eikY+JqyuAFqO465eQdlFqcgBpu2YJiSmkDQmE5RrhY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=m5mymQaYXtg5JG4RVH/jpILh2CI=; b=aRN1ifsh8O4RSBMVP2NhINkQ7d+G aJFnx67Sy7wXJZRCRzXbhX+zX7VN0/7szLRgXczQR/OPPNtMnbhsWerVmkIJgWua 9A25XGrYZHy+eDX3wDbH8s26z8fQSPlznaWqVJORDbkeyO0BoSJXplSMFchILQzO FSiNZgCj3mbFiIE= Received: (qmail 9279 invoked by alias); 30 Dec 2017 18:44:57 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 9245 invoked by uid 89); 30 Dec 2017 18:44:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=BAYES_00, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*Ad:U*rth X-HELO: hall.aurel32.net From: Aurelien Jarno To: libc-alpha@sourceware.org Cc: Richard Henderson , Aurelien Jarno Subject: [PATCH 0/4] Alpha: Fix getrlimit/setrlimit with RLIM_INFINITY Date: Sat, 30 Dec 2017 19:44:37 +0100 Message-Id: <20171230184441.25392-1-aurelien@aurel32.net> 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 two later patches are just some cleanup that I have seen possible while writing the two first patches. 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 Fix typos in getrlimit64.c and setrlimit64.c Simplify getrlimit64.c ChangeLog | 36 +++++++++++ sysdeps/unix/sysv/linux/alpha/Versions | 3 + sysdeps/unix/sysv/linux/alpha/bits/resource.h | 6 +- sysdeps/unix/sysv/linux/alpha/getrlimit64.c | 88 +++++++++++++++++++++++++++ sysdeps/unix/sysv/linux/alpha/libc.abilist | 4 ++ sysdeps/unix/sysv/linux/alpha/setrlimit64.c | 83 +++++++++++++++++++++++++ sysdeps/unix/sysv/linux/getrlimit64.c | 6 +- sysdeps/unix/sysv/linux/setrlimit64.c | 6 +- 8 files changed, 221 insertions(+), 11 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/alpha/getrlimit64.c create mode 100644 sysdeps/unix/sysv/linux/alpha/setrlimit64.c