From patchwork Fri Jan 18 17:22:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 31109 Received: (qmail 126656 invoked by alias); 18 Jan 2019 17:23:24 -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 126640 invoked by uid 89); 18 Jan 2019 17:23:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-ot1-f68.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oIAtq+7HRqp8QlM14gaeAfCO9RORX8gtkmVGRYXZq/k=; b=MNh0FLYzg50jcQFIzwvTHeI5kx9vAHAZKpawAsCL6ItQqEmii/DVdk7NyG4n9fVTPW 8fLlFcpOTJFMxRhmHpeMt5h6jxZiNhfcBEAWnkGo2c8aHHxxPiEdKkuKRNoLHGrs5ySs HqMfE8Fr1JlWkcWRXrhWONd095vI38NnCg05CByE5JcfjJMEju5rZqJwTPX/31QmIc44 Fp/9dvtTiUNOqjB1UzyPq4Kg2h6NCpik/tPfjeglbMpaQxmM5gQQHZNh0AkKQLq1hPvO FALFslqX04oYrnAxgUQYplW/YNLtXNGyvh3sVcBLnzvseAoyavuI6jcrjeLlrC7MSZHF XeHA== MIME-Version: 1.0 References: <20190115200526.4677-1-zackw@panix.com> <1d45c6cb-192c-5ade-513e-a40c65d9fb7e@redhat.com> <35b94b4d-adaa-7a83-a357-d82d6b4b2249@redhat.com> <919e911d-d59b-f557-6a06-2a9316cfc794@redhat.com> In-Reply-To: <919e911d-d59b-f557-6a06-2a9316cfc794@redhat.com> From: "H.J. Lu" Date: Fri, 18 Jan 2019 09:22:41 -0800 Message-ID: Subject: [PATCH] Disable lazy binding on tests for minimal signal handler To: "Carlos O'Donell" Cc: Zack Weinberg , GNU C Library , Siddhesh Poyarekar On Fri, Jan 18, 2019 at 8:40 AM Carlos O'Donell wrote: > > On 1/18/19 9:53 AM, H.J. Lu wrote: > > On Thu, Jan 17, 2019 at 7:12 PM Zack Weinberg wrote: > >> > >> On Wed, Jan 16, 2019 at 10:31 PM H.J. Lu wrote: > >>> > >>> The new tests failed on AVX512 machines: > >>> > >>> Program received signal SIGUSR1, User defined signal 1. > >>> __GI_raise (sig=sig@entry=10) at ../sysdeps/unix/sysv/linux/raise.c:50 > >>> 50 return ret; > >>> (gdb) c > >>> Continuing. > >>> > >>> Program received signal SIGSEGV, Segmentation fault. > >>> _dl_runtime_resolve_xsavec () at ../sysdeps/x86_64/dl-trampoline.h:93 > >>> 93 movq %rax, REGISTER_SAVE_RAX(%rsp) > >>> (gdb) bt > >>> #0 _dl_runtime_resolve_xsavec () at ../sysdeps/x86_64/dl-trampoline.h:93 > >>> #1 0x0040248d in handler (unused=) at tst-minsigstksz-4.c:44 > >>> #2 > >>> #3 __GI_raise (sig=sig@entry=10) at ../sysdeps/unix/sysv/linux/raise.c:50 > >>> #4 0x004024da in do_test () at tst-minsigstksz-4.c:59 > >>> #5 0x00402cd6 in support_test_main (argc=1, argv=0xffffcef8, > >>> config=config@entry=0xffffcdf0) at support_test_main.c:350 > >>> #6 0x00402348 in main (argc=, argv=) > >>> at ../support/test-driver.c:168 > >>> (gdb) > >>> > >>> AVX512 needs 2560 bytes to save processor state. > >> > >> Well, this is the problem that we knew existed and can't fix quickly. > >> If I'm reading http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html > >> correctly, we can't introduce new sysconf constants unilaterally > >> (there is no license to define system-specific _SC_* symbols). > >> > >> I wonder if this test passes if you run it with LD_BIND_NOW=t in the > >> environment. Forcing -z now for these tests might be the best we can > >> do for 2.29. > >> > > > > This works: > > > > diff --git a/signal/Makefile b/signal/Makefile > > index 9597287bca..9c65c26887 100644 > > --- a/signal/Makefile > > +++ b/signal/Makefile > > @@ -59,3 +59,9 @@ CFLAGS-sigwait.c += -fexceptions -fasynchronous-unwind-tables > > CFLAGS-sigwaitinfo.c += -fexceptions -fasynchronous-unwind-tables > > > > CFLAGS-sigreturn.c += $(no-stack-protector) > > + > > OK with comment: > > # We don't want to test the lazy resolution stack usage > # just the execution of the handler and the functions > > +LDFLAGS-tst-minsigstksz-1 = -Wl,-z,now > > +LDFLAGS-tst-minsigstksz-2 = -Wl,-z,now > > +LDFLAGS-tst-minsigstksz-3 = -Wl,-z,now > > +LDFLAGS-tst-minsigstksz-3a = -Wl,-z,now > > +LDFLAGS-tst-minsigstksz-4 = -Wl,-z,now > > > > I'd say this is OK for master. > > Reviewed-by: Carlos O'Donell > > All of this raises an interesting point. Should MINSIGSTKSZ > have included enough space for the lazy resolution to happen? > I think we have to, because you're never going to have already > called abort, quick_exit, or _exit, so they will all go through > lazy binding resolution if you're not BIND_NOW. Which means we > need an average estimate from all arches about the lazy binding > stack usage. > This is the patch I am checking in. Thanks. From 562f43620dc4fd06e4d7abc7cd03c05cd8ea98ae Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 18 Jan 2019 08:56:51 -0800 Subject: [PATCH] Disable lazy binding on tests for minimal signal handler Since MINSIGSTKSZ may not have sufficent stack space to allow lazy binding, build tests for minimal signal handler with -Wl,-z,now to disable lazy binding. * signal/Makefile (LDFLAGS-tst-minsigstksz-1): New. Set to -Wl,-z,now. (LDFLAGS-tst-minsigstksz-2): Likewise. (LDFLAGS-tst-minsigstksz-3): Likewise. (LDFLAGS-tst-minsigstksz-3a): Likewise. (LDFLAGS-tst-minsigstksz-4): Likewise. Reviewed-by: Carlos O'Donell --- ChangeLog | 9 +++++++++ signal/Makefile | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1b13e62e88..59d8b83289 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2019-01-18 H.J. Lu + + * signal/Makefile (LDFLAGS-tst-minsigstksz-1): New. Set to + -Wl,-z,now. + (LDFLAGS-tst-minsigstksz-2): Likewise. + (LDFLAGS-tst-minsigstksz-3): Likewise. + (LDFLAGS-tst-minsigstksz-3a): Likewise. + (LDFLAGS-tst-minsigstksz-4): Likewise. + 2019-01-18 TAMUKI Shoichi * manual/time.texi (strftime): Fix the wording to "alternative" rather diff --git a/signal/Makefile b/signal/Makefile index 9597287bca..06034fee8e 100644 --- a/signal/Makefile +++ b/signal/Makefile @@ -59,3 +59,11 @@ CFLAGS-sigwait.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-sigwaitinfo.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-sigreturn.c += $(no-stack-protector) + +# We don't want to test the lazy resolution stack usage, just the +# execution of the handler and the functions. +LDFLAGS-tst-minsigstksz-1 = -Wl,-z,now +LDFLAGS-tst-minsigstksz-2 = -Wl,-z,now +LDFLAGS-tst-minsigstksz-3 = -Wl,-z,now +LDFLAGS-tst-minsigstksz-3a = -Wl,-z,now +LDFLAGS-tst-minsigstksz-4 = -Wl,-z,now -- 2.20.1