GNU bug report logs - #46009
(backtrace) crash, string->number: Wrong type argument in position 1 (expecting string): #f

Previous Next

Package: guile;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Wed, 20 Jan 2021 22:47:02 UTC

Severity: normal

Full log


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

From: Christopher Baines <mail <at> cbaines.net>
To: bug-guile <at> gnu.org
Subject: (backtrace) crash, string->number: Wrong type argument in position
 1 (expecting string): #f
Date: Wed, 20 Jan 2021 22:46:38 +0000
[Message part 1 (text/plain, inline)]
It seems that with-exception-handler might be breaking
false-if-exception inside terminal-width from (system repl debug).

I've come across this when trying to use with-exception-handler to print
backtraces for exceptions.


→ cat backtrace-crash.scm

(peek "COLUMNS" (getenv "COLUMNS"))

(with-exception-handler
    (lambda (exn)
      (backtrace))
  (lambda ()
    (+ 1 a)))


→ echo $COLUMNS
84


→ guile --no-auto-compile backtrace-crash.scm

;;; ("COLUMNS" #f)

Backtrace:
Backtrace:
          10 (primitive-load "/home/chris/Projects/Guix/guix-build-c…")
In ice-9/boot-9.scm:
  1736:10  9 (with-exception-handler _ _ #:unwind? _ # _)
In ice-9/eval.scm:
    159:9  8 (_ _)
   223:20  7 (proc #(#(#<directory (guile-user) 7f32e7dfbc80>)))
In unknown file:
           6 (%resolve-variable (7 . a) #<directory (guile-user) 7f3…>)
In ice-9/boot-9.scm:
  1669:16  5 (raise-exception _ #:continuable? _)
In unknown file:
           4 (backtrace #<undefined>)
In system/repl/debug.scm:
   148:36  3 (print-frames #(#<frame 7f32e6a22f30 backtrace> #<f…> …) …)
    72:20  2 (_)
In ice-9/boot-9.scm:
  1731:15  1 (with-exception-handler #<procedure 7f32e7e937b0 at ic…> …)
In system/repl/debug.scm:
    72:40  0 (_)

system/repl/debug.scm:72:40: In procedure string->number: Wrong type argument in position 1 (expecting string): #f
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 1 year and 82 days ago.

Previous Next


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