From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#40737: Segfault in arm gcc7, thumb2 builroot, with arm patch Date: Sat, 20 Jun 2020 16:04:28 +0200 Message-ID: <877dw1bzpv.fsf@gnu.org> References: <3583c04a12981cebf9a014b71c2d6f1a27b851af@webmail> <87366r9h34.fsf@news-spur.riddles.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="93780"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: Andy Wingo , 40737@debbugs.gnu.org To: Andrew Gierth Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sat Jun 20 16:05:07 2020 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jme7H-000OH5-Bd for guile-bugs@m.gmane-mx.org; Sat, 20 Jun 2020 16:05:07 +0200 Original-Received: from localhost ([::1]:35500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jme7F-0002RN-TM for guile-bugs@m.gmane-mx.org; Sat, 20 Jun 2020 10:05:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jme7C-0002RH-7Y for bug-guile@gnu.org; Sat, 20 Jun 2020 10:05:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47056) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jme7B-0007yL-Th for bug-guile@gnu.org; Sat, 20 Jun 2020 10:05:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jme7B-0002Wb-O3 for bug-guile@gnu.org; Sat, 20 Jun 2020 10:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 20 Jun 2020 14:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40737 X-GNU-PR-Package: guile Original-Received: via spool by 40737-submit@debbugs.gnu.org id=B40737.15926618849678 (code B ref 40737); Sat, 20 Jun 2020 14:05:01 +0000 Original-Received: (at 40737) by debbugs.gnu.org; 20 Jun 2020 14:04:44 +0000 Original-Received: from localhost ([127.0.0.1]:58602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jme6u-0002W1-DC for submit@debbugs.gnu.org; Sat, 20 Jun 2020 10:04:44 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jme6q-0002Vn-Lv for 40737@debbugs.gnu.org; Sat, 20 Jun 2020 10:04:42 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39124) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jme6h-0007wf-P9; Sat, 20 Jun 2020 10:04:31 -0400 Original-Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=41468 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jme6h-00050l-62; Sat, 20 Jun 2020 10:04:31 -0400 In-Reply-To: <87366r9h34.fsf@news-spur.riddles.org.uk> (Andrew Gierth's message of "Fri, 19 Jun 2020 17:07:34 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:9813 Archived-At: Hi Andrew, Andrew Gierth skribis: > diff --git a/libguile/lightening/lightening/arm-cpu.c b/libguile/lighteni= ng/lightening/arm-cpu.c > index 4445266af..2b4eecc29 100644 > --- a/libguile/lightening/lightening/arm-cpu.c > +++ b/libguile/lightening/lightening/arm-cpu.c > @@ -230,7 +230,7 @@ encode_thumb_immediate(unsigned int v) > return ((v & 0xff) | (1 << 12)); > /* abcdefgh 00000000 abcdefgh 00000000 */ > if (((v & 0xffff0000) >> 16) =3D=3D (v & 0xffff) && (v & 0xff) =3D=3D = 0) > - return ((v & 0x000000ff) | (2 << 12)); > + return (((v & 0x0000ff00) >> 8) | (2 << 12)); > /* abcdefgh abcdefgh abcdefgh abcdefgh */ > if ( (v & 0xff) =3D=3D ((v & 0xff00) >> 8) && > ((v & 0xff00) >> 8) =3D=3D ((v & 0xff0000) >> 16) && I pushed this fix to the lightening repo on your behalf: https://gitlab.com/wingo/lightening/-/commit/1bb909a44d2303f88bb05125fc67= 42e97f80cd1d The CI jobs pass: https://gitlab.com/wingo/lightening/-/pipelines/158337465 I=E2=80=99ll try merging it into Guile, but do you have a test that reprodu= ces the original bug, either at the Guile level or in C using the lightening API? Perhaps the test that Dale posted yesterday at ? --8<---------------cut here---------------start------------->8--- #include "test.h"=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 static void=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 run_test(jit_state_t *j, uint8_t *arena_base, size_t arena_size) {=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 jit_begin(j, arena_base, arena_size);=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 jit_movi(j, JIT_R0, 0xa500a500);=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 jit_retr(j, JIT_R0);=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 jit_uword_t (*f)(void) =3D jit_end(j, NULL);=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 ASSERT(f() =3D=3D 0xa500a500);=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 }=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 int=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 main (int argc, char *argv[])=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 {=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 return main_helper(argc, argv, run_test);=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 }=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 --8<---------------cut here---------------end--------------->8--- Thanks, Ludo=E2=80=99.