Message ID | alpine.DEB.2.21.2001240032350.7536@digraph.polyomino.org.uk |
---|---|
State | Committed |
Headers |
Received: (qmail 3219 invoked by alias); 24 Jan 2020 00:33:24 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 3203 invoked by uid 89); 24 Jan 2020 00:33:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: esa2.mentor.iphmx.com IronPort-SDR: ++s4sJ6ijXazq9pWjCcMXYA4GDqNafSs4II4gcUXMCPi+BY6nrhHTzpTYbGTMZAUuX6pCrUVYf YYFNiuQALaB3V6N54Ne0HyDgcHTfmfSv5/YG83/C+6QRj8INF8Qtvh+MGD5Z/tXTmUzjfXUoOZ 1iuEfGPH+ETTC0i1qMsccoLusQrFn3iUBU0EqEHCm8E/68OS6vnUVweUd+emjBn5QtYjg5ABjJ tPENwIbPunHO2/L7Z1Y6tkRV0LL3HLyM89TVMayzVZe02YI+1KtV7JHah8pYWgD2CrgW2Scgds Bso= IronPort-SDR: ojnxhWasLr/hasHkxxzVMzdOKRACulXh8qsamq4iaWROTU3rDjhSZfeXLK897d0EygtO410oMf RbPbKBtm7I/g== Date: Fri, 24 Jan 2020 00:33:16 +0000 From: Joseph Myers <joseph@codesourcery.com> To: <libc-alpha@sourceware.org> CC: <siddhesh@sourceware.org> Subject: Build raise with -fasynchronous-unwind-tables Message-ID: <alpine.DEB.2.21.2001240032350.7536@digraph.polyomino.org.uk> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Return-Path: joseph@codesourcery.com |
Commit Message
Joseph Myers
Jan. 24, 2020, 12:33 a.m. UTC
In testing glibc for Arm and MIPS, I see: FAIL: misc/tst-sigcontext-get_pc If this test - backtracing through a call to raise - is valid, then raise needs to be built with -fasynchronous-unwind-tables (as the test itself is) to have the required unwind information for that backtracing to work. Adding that option, which this patch does, causes the test for pass for Arm. For MIPS, the test still does not pass (the backtrace has an address that is 2 bytes after the "address in signal handler", for unknown reasons), although the patch allows a longer backtrace to be produced.
Comments
On 24/01/20 6:03 am, Joseph Myers wrote: > In testing glibc for Arm and MIPS, I see: > > FAIL: misc/tst-sigcontext-get_pc > > If this test - backtracing through a call to raise - is valid, then > raise needs to be built with -fasynchronous-unwind-tables (as the test > itself is) to have the required unwind information for that > backtracing to work. Adding that option, which this patch does, > causes the test for pass for Arm. For MIPS, the test still does not > pass (the backtrace has an address that is 2 bytes after the "address > in signal handler", for unknown reasons), although the patch allows a > longer backtrace to be produced. > The fix seems fine, but I wonder how the test passes on other architectures. Also the commit that introduced this test seems to indicate that the test was passing earlier: commit a43565ac447b1608ae2626f5012673560bb623ab Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Dec 17 16:44:14 2018 -0200 Refactor sigcontextinfo.h Siddhesh
* Siddhesh Poyarekar: > On 24/01/20 6:03 am, Joseph Myers wrote: >> In testing glibc for Arm and MIPS, I see: >> >> FAIL: misc/tst-sigcontext-get_pc >> >> If this test - backtracing through a call to raise - is valid, then >> raise needs to be built with -fasynchronous-unwind-tables (as the test >> itself is) to have the required unwind information for that >> backtracing to work. Adding that option, which this patch does, >> causes the test for pass for Arm. For MIPS, the test still does not >> pass (the backtrace has an address that is 2 bytes after the "address >> in signal handler", for unknown reasons), although the patch allows a >> longer backtrace to be produced. >> > > The fix seems fine, but I wonder how the test passes on other > architectures. Many architectures default to -fasynchronous-unwind-tables in GCC. The patch seems reasonable to me. Thanks, Florian
On 24/01/20 12:05 pm, Florian Weimer wrote: >> The fix seems fine, but I wonder how the test passes on other >> architectures. > > Many architectures default to -fasynchronous-unwind-tables in GCC. > > The patch seems reasonable to me. Thanks, looks good to me for master then. Siddhesh
On Fri, 24 Jan 2020, Joseph Myers wrote: > causes the test for pass for Arm. For MIPS, the test still does not > pass (the backtrace has an address that is 2 bytes after the "address > in signal handler", for unknown reasons), although the patch allows a > longer backtrace to be produced. I now understand the MIPS issue: libgcc/config/mips/linux-unwind.h adds 2 to the return address for a signal frame. The question then is how best to fix that MIPS issue. Adding 2 in the MIPS sigcontext_get_pc would fix things for the testcase, and be safe for the use in debug/segfault.c. I'm less sure, however, what's safe for the use of sigcontext_get_pc in sysdeps/unix/sysv/linux/profil-counter.h - what exactly that use requires regarding the return value of sigcontext_get_pc.
diff --git a/signal/Makefile b/signal/Makefile index 7da67def84..37de438bba 100644 --- a/signal/Makefile +++ b/signal/Makefile @@ -52,6 +52,7 @@ tests := tst-signal tst-sigset tst-sigsimple tst-raise tst-sigset2 \ include ../Rules +CFLAGS-raise.c += -fasynchronous-unwind-tables CFLAGS-sigpause.c += -fexceptions CFLAGS-sigsuspend.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-sigtimedwait.c += -fexceptions -fasynchronous-unwind-tables