From patchwork Tue May 16 19:11:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 99888 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp2172124qge; Tue, 16 May 2017 12:11:23 -0700 (PDT) X-Received: by 10.84.233.131 with SMTP id l3mr478157plk.18.1494961883310; Tue, 16 May 2017 12:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494961883; cv=none; d=google.com; s=arc-20160816; b=T96QUkJMZSUjQqbu8Kc0QL+XHUM7RYmTjxABQ/MonctO6v+TKqcGwX5rCP1xoFgBBu SmpFMA8hiaxyy883hvpYPo2EkDuBzjA2hD+vHLqjACg4wdTm+jHhyDCvikP20qACz8md Cn8t10lcj7iVk4zroUhPerOVD2LZ2I4sXOyHdHpF8gXQ0ALQu6WRC/hjGoZ+WZC84zKp CwTJBd0Egvgz1Fc4tL7IlEOLnZ8zopXvdXDKBvwspr55UGasuYqT8smOiLVZYEqn85ft uDZhKJ6VZ9YS/l05LxYzpA9cE3xPHj0U1c27FJi4fMi0fbhNxDms4FfjNtOfOA7aNjAN Zs4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:delivered-to:sender:list-help :list-post:list-archive:list-subscribe:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=a4fF4lFabKwbYIg7NKZMnUHKAt+ODAEaBBgsM1Divrk=; b=wGH3HhCuXEOAvPxKuuZIfzGXuiTKEaWE4lyGli+Y5Nd00I3Kgj6zFT/KCKO3T+ErVf /mawYK/vOTdqEC3+9OV4VjMKji/WGJbxZSp9thhydxk/gS3AIN8nuGhR1fygdlj44PQn CH6m09zPMeGbpw5ZAs20FkmGd04Ybzs0V6t3imvC3etcAwGDLVFC3/EDvb91jxNlzo0k Ehu59lt+rnPnXtDb0lHne+5/9yrs+76zVp62dLEaiCaqLipQfyPVt5FmsEnRVDMLhBST 2ZL3FHVPykiaZ81EwFXUDIdX86yPIVVrG/ds/53v9zSXXT74eYNcBJPPEA13+7rxvmOV P1ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-79457-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-79457-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id k10si126800pga.187.2017.05.16.12.11.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 May 2017 12:11:23 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-79457-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-79457-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-79457-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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:subject:date:message-id; q=dns; s= default; b=liNycr+JPS9b2Q5jba0aUC4owalp1/bNKlMFiUTTcIcp0GjLQyhMz RA7NIRiOlloRPZ+G/YGHAWuCYxEdYoQTIz/azVsT9HBGNSk/uPTvEWUAJErUpMPB LY5Hqh3eT2gY+Xor2B5zAJStKdtjQrEDcGpgX9VtcEpCkgTRo87S1Q= 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:subject:date:message-id; s=default; bh=xNkpnRq8IKdRvw2naAO17/ogIfU=; b=VZlU67XDarmNjQYi8YD7FOITdqgQ dVWlarpS/kHGDPIimXiA6ElIKbuQaPh6bb/0W8UqP7FgVKr8cWIQkdwepaSngu4u fFXENRt7qCN+zZ6/rlGP3jyrCEV8EhIk8XKST4xJXx75fGQwHFlmExXTl3zAAbyF 4RgynwaL326daZo= Received: (qmail 29853 invoked by alias); 16 May 2017 19:11:10 -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 29841 invoked by uid 89); 16 May 2017 19:11:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=states X-HELO: mail-qt0-f169.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=a4fF4lFabKwbYIg7NKZMnUHKAt+ODAEaBBgsM1Divrk=; b=QryslJ8XfF2dvKKSZNv5kj6IMHkR1N7vQZz9JqSxV2n1w5WHl83LyWVdr6quXrpQ0u KIUSaOUuYMK1vDj+fJ95CGU+gG1RYduSO1KG1hl9M7IWzEMn9rQelb21EqDOWpQc5oND EiVOzkNulyFsDOm0/PSp/ng7EU13WiFPDonbN+kG2xefhhTh8b54UReuYR4Cfy+5NKJE ByGWrQ3dDaaAV/wnApL8Yu8GLW4duoHx+TmL5J+ayWqPSSVB5GIzVYB0k1u1jzGnC8a8 vKFrlnX5zKwvV1//XR2BXbdUxpdp7Oknov8W4WCXGl8MtQ0GURLwGELbsYxG1l1AvPvG kmTQ== X-Gm-Message-State: AODbwcBL0Kw9ybfIWnRl4o7E7sndITyKD2VZEMy2bKd3tKAG5tZAZqKQ rdDQVi6i3yobSk/dW9dM4A== X-Received: by 10.200.47.161 with SMTP id l30mr12711181qta.153.1494961867681; Tue, 16 May 2017 12:11:07 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH] manual: Document getcontext uc_stack value on Linux [BZ #759] Date: Tue, 16 May 2017 16:11:01 -0300 Message-Id: <1494961861-30734-1-git-send-email-adhemerval.zanella@linaro.org> As decribed in BZ#759, Linux getcontext implementation on Linux does differs from other SysV system about the returned uc_stack. This is true not only for i386, but for all the architecture I could actually check (aarch64, arm, alpha, hppa, m68k, mips, mips64, mips64n32, powerpc, powerpc64, powerpc64le, s390x, sh, sparc, sparc64, and x86). And I think we should not change current behavior for some reasons: 1. POSIX 2008 removed this SySV interface for a good reason and changing this behavior adds nothing for current portable code. POSIX 2001 specification does states that stack should be saved [1] and current GLIBC code does in a arch-specific manner (inside the mcontext_t) which allows the setcontext to work correctly. 2. Changing this behavior would potentially require compat symbols and I see no gain in adding compat symbols for deprecated interfaces. 3. Also, for comment #2 in BZ#759, it is up to kernel do setup the contents for ucontext_t and currently it does not provide the stack information as well. Trying to change it is also another fix that does not worth the possible gains. Instead my proposal is to make it clear the current interface behavior in glibc documentation and close this bug as invalid. [BZ #759] * manual/setjmp.texi (getcontex): Document uc_stack value on Linux. [1] http://pubs.opengroup.org/onlinepubs/009695399/functions/getcontext.html --- ChangeLog | 5 +++++ manual/setjmp.texi | 5 +++++ 2 files changed, 10 insertions(+) -- 2.7.4 diff --git a/manual/setjmp.texi b/manual/setjmp.texi index 94d16be..07cc7bf 100644 --- a/manual/setjmp.texi +++ b/manual/setjmp.texi @@ -302,6 +302,11 @@ the content of the registers, the signal mask, and the current stack. Executing the contents would start at the point where the @code{getcontext} call just returned. +On Linux the stack information return on @code{uc_stack} is empty by +default. It also the case for signal handling information through +@code{sigaction} with @code{SA_SIGINFO}. It could be obtained using +architecture specific field from @code{uc_mcontext} member. + The function returns @code{0} if successful. Otherwise it returns @code{-1} and sets @var{errno} accordingly. @end deftypefun