From unknown Wed Jun 25 05:37:49 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#75504 <75504@debbugs.gnu.org> To: bug#75504 <75504@debbugs.gnu.org> Subject: Status: Crash of type-fold when compiling procedure Reply-To: bug#75504 <75504@debbugs.gnu.org> Date: Wed, 25 Jun 2025 12:37:49 +0000 retitle 75504 Crash of type-fold when compiling procedure reassign 75504 guile submitter 75504 "Ricardo G. Herdt" severity 75504 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 11 18:43:29 2025 Received: (at submit) by debbugs.gnu.org; 11 Jan 2025 23:43:29 +0000 Received: from localhost ([127.0.0.1]:45376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tWl8a-0003bP-Lz for submit@debbugs.gnu.org; Sat, 11 Jan 2025 18:43:29 -0500 Received: from lists.gnu.org ([2001:470:142::17]:34222) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tWl8X-0003b1-O4 for submit@debbugs.gnu.org; Sat, 11 Jan 2025 18:43:26 -0500 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 1tWl8S-000408-4T for bug-guile@gnu.org; Sat, 11 Jan 2025 18:43:20 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tWl8Q-0006eb-Ci for bug-guile@gnu.org; Sat, 11 Jan 2025 18:43:19 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id DA914240027 for ; Sun, 12 Jan 2025 00:43:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1736638991; bh=zDzVC4yECBUBPzwgLE86UTt/dWa/0qPuzA5RWeodhLs=; h=MIME-Version:Date:From:To:Subject:Message-ID:Content-Type: Content-Transfer-Encoding:From; b=gUhjWtUCpAF3kIoM//3NndcKEED+f13hphqY8V/wcGO9m7JHO38ipz7JAu1WWiigN hwAkh7u9ez/oWUoaDuBg6+MemuqKmXtmDh6QuvP4eD5GbXMOjGJjgefXiMvq6QLvTh vmU5+t/WIFKq8PnjSW0Myae8PBG4FQnYRk0eNmpBZGtBId/pS4dCVV2o541zyCX4l2 3IZq2YFyZKpP46DRDIX6oBANVOmCEYnDKyWtmaD3jzRX/QeEKV6Ii5A6PDvLBeQkg9 8El5L29uZBJStA2KRdv2oP+5c/pNJ7B3Ki08LAmJVahDEEqTsdhNw2ic/DNUi0AEEB 9+mVIe+pZQcAQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YVw7g3hHlz6tsf for ; Sun, 12 Jan 2025 00:43:11 +0100 (CET) MIME-Version: 1.0 Date: Sat, 11 Jan 2025 23:43:11 +0000 From: "Ricardo G. Herdt" To: bug-guile@gnu.org Subject: Crash of type-fold when compiling procedure Message-ID: <2893f54364e1a0cb227f6cc02ce0612c@posteo.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=r.herdt@posteo.de; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi, There is a weird bug when trying to evaluate/compile following=20 procedure: ------------------------ $ cat example.scm (define (test n) (make-vector n 1) (floor (sqrt n))) $ guild compile example.scm Backtrace: In /home/rgherdt/.guix-profile/bin/guild: 72:17 19 (main _) In srfi/srfi-1.scm: 634:9 18 (for-each # =E2=80=A6) In scripts/compile.scm: 279:27 17 (_ _) In system/base/target.scm: 72:6 16 (with-target _ _) In system/base/compile.scm: 187:6 15 (compile-file "example.scm" #:output-file _ #:from _ # _ =E2= =80=A6) 53:4 14 (call-with-output-file/atomic _ _ _) In ice-9/boot-9.scm: 1752:10 13 (with-exception-handler _ _ #:unwind? _ # _) In system/base/compile.scm: 69:11 12 (_) 190:11 11 (_ #) 314:15 10 (read-and-compile _ #:from _ #:to _ #:env _ # _ # _ # _) 352:28 9 (compile _ #:from _ #:to _ #:env _ #:optimization-level =E2= =80=A6) 265:44 8 (_ _ _) 261:33 7 (_ # #) In language/cps/optimize.scm: 130:12 6 (_ _ _) 102:3 5 (optimize-higher-order-cps _ _) In language/cps/type-fold.scm: 778:7 4 (type-fold _) 771:27 3 (fold-functions-in-renumbered-program # =E2=80=A6) 611:10 2 (local-type-fold _ 30 _) 48:4 1 (materialize-constant _ _ _ _ _) In ice-9/boot-9.scm: 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure =3D: Wrong type argument in position 1: # ------------------------ Somehow the type passed to materialize-constant is #,=20 leading to the crash when checking "(zero? type)". Swapping the=20 procedures like this doesn't lead to the same error: (define (test n) (make-vector n 1) (sqrt (floor n))) Thanks to gsdlb for discovering the bug and mwette for helping getting a=20 better backtrace. Tested with Guile 3.0.9. Regards, Ricardo G. Herdt