GNU bug report logs - #72936
Compiler in 3.0.10 crashes when inlining 3.0.9 procedure with kw args

Previous Next

Package: guile;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Sun, 1 Sep 2024 17:29:01 UTC

Severity: important

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 72936 in the body.
You can then email your comments to 72936 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#72936; Package guile. (Sun, 01 Sep 2024 17:29:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sun, 01 Sep 2024 17:29:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: bug-guile <at> gnu.org
Subject: Compiler in 3.0.10 crashes when inlining 3.0.9 procedure with kw args
Date: Sun, 01 Sep 2024 19:24:49 +0200
Hello,

Here are two modules where one refers to a binding from the other:

--8<---------------cut here---------------start------------->8---
$ cat three-oh-nine.scm
(define-module (three-oh-nine)
  #:export (proc-with-kw-arg)
  #:declarative? #t)

(define* (proc-with-kw-arg one #:optional three #:key (two 2))
  (format #t "one: ~s two: ~s three: ~s~%" one two three))
$ cat three-oh-ten.scm
(define-module (three-oh-ten)
  #:use-module (three-oh-nine)
  #:export (proc-with-kw-args-user))

(define (proc-with-kw-args-user one)
  (pk (+ 42 (proc-with-kw-arg one))))
--8<---------------cut here---------------end--------------->8---

We’ll compile the first one with 3.0.9 and the second one with 3.0.10,
referring to the .go obtained with 3.0.9:

--8<---------------cut here---------------start------------->8---
$ guix shell guile <at> 3.0.9 -- guild compile -O3 three-oh-nine.scm -o three-oh-nine.go
wrote `three-oh-nine.go'
$ guix shell guile -- env GUILE_LOAD_COMPILED_PATH=$PWD guild compile -O3 -L. three-oh-ten.scm -o three-oh-ten.go
Backtrace:
In language/tree-il/peval.scm:
  1015:20 19 (loop _ #<vlist ()> #f values)
    833:6 18 (loop _ #<vhash 7f6c73a834e0 2 pairs> #f values)
  1052:26 17 (loop _ _ #f values)
  1015:20 16 (loop _ #<vhash 7f6c73aa1c60 4 pairs> #f values)
    833:6 15 (loop _ #<vhash 7f6c73aa1b80 6 pairs> #f values)
    833:6 14 (loop _ #<vhash 7f6c73aa1b80 6 pairs> #f effect)
  1427:25 13 (loop _ #<vhash 7f6c73aa1b80 6 pairs> #f effect)
In srfi/srfi-1.scm:
   702:29 12 (map1 (#<tree-il (lexical proc-with-kw-args-user #{ g113}#)> #<tree-il (lexi…>))
   702:17 11 (map1 (#<tree-il (lexical proc-with-kw-args-user #{ g114}#)>))
In language/tree-il/peval.scm:
   887:11 10 (loop _ _ #f value)
   379:22  9 (visit-operand #<<operand> var: #<<var> name: proc-with-kw-args-user gensym: …> …)
    833:6  8 (loop #<tree-il (lambda ((name . proc-with-kw-args-user)) (lambda-case (((one…> …)
  1886:20  7 (loop _ #<vhash 7f6c73aa1c60 4 pairs> #<<counter> effort: #<variable 7f6c72c2…> …)
  1558:45  6 (loop _ _ _ values)
In srfi/srfi-1.scm:
   702:17  5 (map1 (#<tree-il (primcall + (const 42) (call (@ (three-oh-nine) proc-with-kw…>))
In language/tree-il/peval.scm:
  1427:25  4 (loop _ #<vhash 7f6c73aa1940 6 pairs> #<<counter> effort: #<variable 7f6c72c2…> …)
In srfi/srfi-1.scm:
   702:29  3 (map1 (#<tree-il (const 42)> #<tree-il (call (@ (three-oh-nine) proc-with-kw…>))
   702:17  2 (map1 (#<tree-il (call (@ (three-oh-nine) proc-with-kw-arg) (lexical one one-…>))
In language/tree-il/peval.scm:
  1762:18  1 (loop _ _ _ _)
In ice-9/boot-9.scm:
  1676:22  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1676:22: In procedure raise-exception:
internal error: unexpected kwarg syms ((#:two two #f)) (t123)
--8<---------------cut here---------------end--------------->8---

It doesn’t crash when using the same version for both compilations, or
when ignoring the .go file of the previous step.

Could it be related to f95bf6921e13799abca6a0a13087609c42baba6b?

The context in which this bug was found is described at
<https://issues.guix.gnu.org/72183#6>: building the ‘guix’ package with
3.0.10 against ‘guile-gcrypt’ built with 3.0.9 would trigger this
compiler bug.

Ludo’.




Information forwarded to bug-guile <at> gnu.org:
bug#72936; Package guile. (Mon, 23 Sep 2024 11:34:01 GMT) Full text and rfc822 format available.

Message #8 received at 72936 <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> igalia.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 72936 <at> debbugs.gnu.org
Subject: Re: bug#72936: Compiler in 3.0.10 crashes when inlining 3.0.9
 procedure with kw args
Date: Mon, 23 Sep 2024 13:32:29 +0200
This one is because of 2c645571b351a0044911847025b666551a8e4fb5 :/  I
will see what I can do.




Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 27 Sep 2024 20:35:02 GMT) Full text and rfc822 format available.

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 27 Sep 2024 21:26:02 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Fri, 27 Sep 2024 21:26:02 GMT) Full text and rfc822 format available.

Message #15 received at 72936-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Andy Wingo <wingo <at> igalia.com>
Cc: 72936-done <at> debbugs.gnu.org
Subject: Re: bug#72936: Compiler in 3.0.10 crashes when inlining 3.0.9
 procedure with kw args
Date: Fri, 27 Sep 2024 22:50:25 +0200
Fixed by 90e1205018f13c86355517c85db8cf82952c6e98.

Thank you, Andy!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 26 Oct 2024 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 233 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.