From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.bugs Subject: bug#71891: 3.0.10 may be broken on 32-bit architectures Date: Mon, 01 Jul 2024 21:09:12 -0500 Message-ID: <87r0ccsfxz.fsf@trouble.defaultvalue.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32910"; mail-complaints-to="usenet@ciao.gmane.io" To: 71891@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Tue Jul 02 04:10:24 2024 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 1sOSyO-0008Jp-4Z for guile-bugs@m.gmane-mx.org; Tue, 02 Jul 2024 04:10:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOSy3-0007Wy-NM; Mon, 01 Jul 2024 22:10:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOSy2-0007Wk-75 for bug-guile@gnu.org; Mon, 01 Jul 2024 22:10:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOSy1-000597-Iz for bug-guile@gnu.org; Mon, 01 Jul 2024 22:10:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sOSy2-0007qv-8U for bug-guile@gnu.org; Mon, 01 Jul 2024 22:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Rob Browning Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 02 Jul 2024 02:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71891 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.171988616230120 (code B ref -1); Tue, 02 Jul 2024 02:10:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Jul 2024 02:09:22 +0000 Original-Received: from localhost ([127.0.0.1]:35265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sOSxO-0007pk-2F for submit@debbugs.gnu.org; Mon, 01 Jul 2024 22:09:22 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:45812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sOSxM-0007pc-CH for submit@debbugs.gnu.org; Mon, 01 Jul 2024 22:09:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOSxL-0007OC-6E for bug-guile@gnu.org; Mon, 01 Jul 2024 22:09:19 -0400 Original-Received: from defaultvalue.org ([45.33.119.55]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOSxI-00054J-Gv for bug-guile@gnu.org; Mon, 01 Jul 2024 22:09:18 -0400 Original-Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@defaultvalue.org) by defaultvalue.org (Postfix) with ESMTPSA id C2CC020182 for ; Mon, 1 Jul 2024 21:09:12 -0500 (CDT) Original-Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 5790114E081; Mon, 1 Jul 2024 21:09:12 -0500 (CDT) Received-SPF: pass client-ip=45.33.119.55; envelope-from=rlb@defaultvalue.org; helo=defaultvalue.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10877 Archived-At: First noticed via https://buildd.debian.org/guile-3.0 on armel, armhf and i386: https://buildd.debian.org/status/fetch.php?pkg=guile-3.0&arch=armel&ver=3.0.10-1&stamp=1719706962&raw=0 https://buildd.debian.org/status/fetch.php?pkg=guile-3.0&arch=armhf&ver=3.0.10-1&stamp=1719706478&raw=0 https://buildd.debian.org/status/fetch.php?pkg=guile-3.0&arch=i386&ver=3.0.10-1&stamp=1719703034&raw=0 They all failed to build like this: GUILE_BOOTSTRAP_STAGE=stage1 ../meta/build-env guild compile --target="i686-pc-linux-gnu" -W1 -O2 -Ono-cross-module-inlining -L "/<>/module" -o "ice-9/calling.go" "../module/ice-9/calling.scm" Backtrace: In ice-9/boot-9.scm: 1755:12 19 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _) In system/base/compile.scm: 69:11 18 (_) 190:11 17 (_ #) 309:6 16 (read-and-compile # #:from _ #:to _ #:env _ #:optimization-level _ #:warning-level _ #:opts _) 352:28 15 (compile # ?) 265:44 14 (_ # ?) 261:33 13 (_ # #) In language/cps/optimize.scm: 136:2 12 (_ _ #) 111:3 11 (optimize-first-order-cps _ _) In language/cps/switch.scm: 414:6 10 (optimize-branch-chains _) In language/cps/intmap.scm: 519:6 9 (visit-branch #(#(#(# (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) #f) (absent) (absent) (absent) (absent) (absent) (absent) (absent) #((absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) # ?) ?) ?) ?) 519:6 8 (visit-branch #((absent) (absent) #((absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) # (absent) (absent) (absent) (absent) (absent) (absent) (absent) #f) (absent) (absent) #((absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) # ?) ?) ?) 519:6 7 (visit-branch #((absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) # (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) (absent) #f) _ 3680 _) In language/cps/switch.scm: 99:36 6 (fold-branch-chains # _ _ # _) 343:8 5 (optimize-branch-chain 3346 7427 (6771 6772 6773 6901 7029 7157 7285) _) In ice-9/boot-9.scm: 260:13 4 (for-each # _) In language/cps/switch.scm: 340:32 3 (_ (u64-imm-< . 7428)) In language/cps/guile-vm.scm: 89:31 2 (target-symbol-hash _) 41:18 1 (jenkins-lookup3-hashword2 "u64-imm-<") In ice-9/boot-9.scm: 1676:22 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1676:22: In procedure raise-exception: Value out of range 0 to< 18446744073709551615: -505802029 make[4]: *** [Makefile:2515: language/cps/guile-vm/reify-primitives.go] Error 1 Investigation on an i386 host, and then a git bisect suggested that this might be relevant (i.e. the "bad" commit bisect landed on): commit d579848cb5d65440af5afd9c8968628665554c22 Fix bug lowering logand/immediate to ulogand/immediate * module/language/cps/specialize-numbers.scm (logand/immediate): Define a sigbits handler. (specialize-operations): Require logand/immediate operand to be u64 to lower to ulogand/immediate. Shouldn't be necessary but even if only u64 bits are used, negative fixnums will have the sign bit set, which trips up further unboxed uses which error if the operand to `scm->u64` is negative. * module/language/cps/type-fold.scm (rem): Emit logand/immediate. I also found some other issues I have patches for that I'll propose separately, e.g. test-hashing needs a 32-bit "expected", etc. Hope this helps, and happy to assist if I can. Thanks -- Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4