From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43177 invoked by alias); 28 Mar 2018 08:01:54 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 43141 invoked by uid 89); 28 Mar 2018 08:01:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=bus, Fire X-HELO: mx1.redhat.com Subject: Re: SIGBUS failure for misc/tst-bz21269 on i386 To: Aurelien Jarno References: <20180327214707.GA4207@aurel32.net> From: Florian Weimer Cc: GNU C Library , "H.J. Lu" Message-ID: <23e0f059-1fd0-8b95-ce35-99eba8a96a30@redhat.com> Date: Wed, 28 Mar 2018 08:01:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180327214707.GA4207@aurel32.net> Content-Type: multipart/mixed; boundary="------------1A4653123FCDB37607AEE90D" X-SW-Source: 2018-03/txt/msg00581.txt.bz2 This is a multi-part message in MIME format. --------------1A4653123FCDB37607AEE90D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1298 On 03/27/2018 11:47 PM, Aurelien Jarno wrote: > Here is the coredump that I can get: > > Thread 1 "tst-bz21269" received signal SIGBUS, Bus error. > 0x565564a0 in do_test () at ../sysdeps/unix/sysv/linux/i386/tst-bz21269.c:217 > 217 while (atomic_load (&ftx) != 0) > (gdb) bt > #0 0x565564a0 in do_test () at ../sysdeps/unix/sysv/linux/i386/tst-bz21269.c:217 > #1 0x56556bc2 in support_test_main (argc=, argv=0xffffd518, config=0xffffd424) at support_test_main.c:321 > #2 0x56556061 in main (argc=2, argv=0xffffd514) at ../support/test-driver.c:164 > (gdb) print &ftx > $1 = (atomic_uint *) 0x5655a0e0 > (gdb) print ftx > $2 = 0 Ahh. I see. /* Fire up thread modify_ldt call. */ atomic_store (&ftx, 2); while (atomic_load (&ftx) != 0) ; /* On success, modify_ldt will segfault us synchronously and we will escape via siglongjmp. */ support_record_failure (); But: xsethandler (SIGSEGV, sigsegv_handler, 0); /* 32-bit kernels send SIGILL instead of SIGSEGV on IRET faults. */ xsethandler (SIGILL, sigsegv_handler, 0); So some kernels apparently use SIGBUS instead, and the crash actually shows the test succeeded. Would you please try the attached patch? Thanks, Florian --------------1A4653123FCDB37607AEE90D Content-Type: text/x-patch; name="sigbus.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="sigbus.patch" Content-length: 902 Subject: [PATCH] Linux i386: tst-bz21269 triggers SIGBUS on some kernels To: libc-alpha@sourceware.org In addition to SIGSEGV and SIGILL, SIGBUS is also a possible signal generated by the kernel. 2018-03-28 Florian Weimer * sysdeps/unix/sysv/linux/i386/tst-bz21269.c (do_test): Also capture SIGBUS. diff --git a/sysdeps/unix/sysv/linux/i386/tst-bz21269.c b/sysdeps/unix/sysv/linux/i386/tst-bz21269.c index 353e36507d..6ee3fc62be 100644 --- a/sysdeps/unix/sysv/linux/i386/tst-bz21269.c +++ b/sysdeps/unix/sysv/linux/i386/tst-bz21269.c @@ -177,6 +177,8 @@ do_test (void) xsethandler (SIGSEGV, sigsegv_handler, 0); /* 32-bit kernels send SIGILL instead of SIGSEGV on IRET faults. */ xsethandler (SIGILL, sigsegv_handler, 0); + /* Some kernels send SIGBUS instead. */ + xsethandler (SIGBUS, sigsegv_handler, 0); thread = xpthread_create (0, threadproc, 0); --------------1A4653123FCDB37607AEE90D--