Received: (at submit) by debbugs.gnu.org; 11 Jan 2025 23:43:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 11 18:43:29 2025
Received: from localhost ([127.0.0.1]:45376 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1tWl8a-0003bP-Lz
for submit <at> 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 <r.herdt@HIDDEN>) id 1tWl8X-0003b1-O4
for submit <at> 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 <r.herdt@HIDDEN>) id 1tWl8S-000408-4T
for bug-guile@HIDDEN; 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 <r.herdt@HIDDEN>) id 1tWl8Q-0006eb-Ci
for bug-guile@HIDDEN; 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 <bug-guile@HIDDEN>; 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 <bug-guile@HIDDEN>; 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" <r.herdt@HIDDEN>
To: bug-guile@HIDDEN
Subject: Crash of type-fold when compiling procedure
Message-ID: <2893f54364e1a0cb227f6cc02ce0612c@HIDDEN>
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@HIDDEN;
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 <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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 #<procedure 7fc101fbc230 at scripts/compile.=E2=80=
=A6> =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 (_ #<closed: file 7fc101f95e00>)
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 (_ #<intmap 0-41> #<module (#{ g106}#) 7fc1020f2460>)
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 #<procedure loca=E2=80=
=A6> =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: #<unspecified>
------------------------
Somehow the type passed to materialize-constant is #<unspecified>,=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
"Ricardo G. Herdt" <r.herdt@HIDDEN>:bug-guile@HIDDEN.
Full text available.bug-guile@HIDDEN:bug#75504; Package guile.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.