bug#39997: High CPU load and no return value with 3.0.0

Ludovic Courtès <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
Hi,

Roel Janssen <[email protected]> skribis:

> When I use the "md5" module from guile-lib (release 0.2.6.1) together
> with the following snippet in Guile 3.0.0, it never returns, while on
> Guile 2.2.6, it returns the MD5 sum of the input string:
> ---
> (use-modules (md5))
>
> (define (md5-from-string input)
>   (call-with-input-string input md5))
>
> (define (random-ascii length)
>   "Returns a random string of ASCII characters of length LENGTH."
>   (list->string
>    (map (lambda _ (integer->char (+ (random 95) 32)))
>         (iota length))))
>
> (display
>  (md5-from-string
>   (random-ascii 32)))
> ---
>
> Could you point me in the right direction for finding the problem?

The Guix package has this patch:

        '(begin
           ;; Work around miscompilation on Guile 3.0.0 at -O2:
           ;; <https://bugs.gnu.org/39251>.
           (substitute* "src/md5.scm"
             (("\\(define f-ash ash\\)")
              "(define f-ash (@ (guile) ash))\n")
             (("\\(define f-add \\+\\)")
              "(define f-add (@ (guile) +))\n"))
           #t)

It’s very likely that you’re hitting this problem.

HTH!

Ludo’.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.