[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
a couple bugs related to error reporting and backtraces
From: |
Jose A. Ortega Ruiz |
Subject: |
a couple bugs related to error reporting and backtraces |
Date: |
Mon, 15 Jun 2009 22:18:32 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) |
Hi,
I've got this trivial module definition in file a.scm:
(define-module (a)
#:export (ap))
(define (ap) (not-bound))
(ap)
intended to cause an error upon calling `ap'.
First bug is when trying to `load-compiled' a non-go file:
scheme@(guile-user)> (load-compiled "./a.scm")
Backtrace:
In unknown file:
?: 0* [#<vm b7ade680> #<program b798ec20 at <unknown port>:0:0 ()>]
1: 1* [#<program b798ec20 at <unknown port>:0:0 ()>]
?: 2* [load-compiled/vm "./a.scm"]
ERROR: In procedure make_objcode_by_mmap:
ERROR: Success
scheme@(guile-user)>
As you can see, the error key, Success, is not correct. This happens
with any non-go file (so the contents above is not relevant).
So let's compile and load the real file:
scheme@(guile-user)> ,i (system base compile)
scheme@(guile-user)> (load-compiled (compile-file "/home/jao/tmp/a.scm"))
Backtrace:
In unknown file:
?: 0* [#<vm b7a8a680> #<program b793ed70 at <unknown port>:1:0 ()>]
2: 1* [#<program b793ed70 at <unknown port>:1:0 ()>]
?: 2* [load-compiled/vm
"/home/jao/.guile-ccache/1.9//home/jao/tmp/a.scm.go"]
?: 3* [ap]
ERROR: In procedure module-lookup:
ERROR: unbound variable: not-bound
scheme@(a)>
As you can see, the location of the error is not reported; with the same
behaviour when calling the program interactively:
scheme@(a)> ap
#<program ap ()>
scheme@(a)> (ap)
Backtrace:
In unknown file:
?: 0* [#<vm b7a8a680> #<program b6f102f0 at <unknown port>:3:0 ()>]
?: 1* [ap]
ERROR: In procedure module-lookup:
ERROR: unbound variable: not-bound
scheme@(a)>
Adding the directory containing a.scm to Guile's load path changes
nothing. What i was expecting is a backtrace pointing me to the location
of the call to `not-bound' in a.scm. Am i doing something wrong?
Thanks!
jao
- a couple bugs related to error reporting and backtraces,
Jose A. Ortega Ruiz <=