bug#79365: wrong irritant for 'wrong number of arguments' exception inside modules

Olivier Dion <[email protected]> Fri, 20 Feb 2026 10:04:18 -0500
Newsgroups gmane.lisp.guile.bugs
Message-ID <87342v78y5.fsf@laura>
Can be reproduced in 3.0.9 and not in 3.0.11.

Reproduce script:
--8<---------------cut here---------------start------------->8---
#!/bin/sh

GUILE="${GUILE:-$(command -v guile || command -v guile3.0)}"

if [ -z "$GUILE" ]; then
    echo "Missing guile executable."
    exit 1
fi

if [ ! -f "except.scm" ]; then
    cat -> except.scm <<EOF
(define-module (except)
               #:export (
                         start-main
))
(use-modules (rnrs conditions))

(define (func s)
  1)

(define (main)
    (func)
    (display "test\n"))

(define (start-main)
  (with-exception-handler
    (lambda (c . more)
      (display "Caught an exception!\n")
      (when (message-condition? c)
        (display c))

      (newline))
    (lambda ()
      (main))))
EOF
fi

if [ ! -f "runn.scm." ]; then
    cat -> runner.scm <<EOF
(set! %load-path (cons "." %load-path))
(use-modules (except))
(start-main)
EOF
fi
set -x
GUILE_AUTO_COMPILE=1 $GUILE -L . ./runner.scm
--8<---------------cut here---------------end--------------->8---

-- 
Olivier Dion