unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* a couple bugs related to error reporting and backtraces
@ 2009-06-15 20:18 Jose A. Ortega Ruiz
  2009-06-20 10:47 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: Jose A. Ortega Ruiz @ 2009-06-15 20:18 UTC (permalink / raw)
  To: guile-devel


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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: a couple bugs related to error reporting and backtraces
  2009-06-15 20:18 a couple bugs related to error reporting and backtraces Jose A. Ortega Ruiz
@ 2009-06-20 10:47 ` Andy Wingo
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Wingo @ 2009-06-20 10:47 UTC (permalink / raw)
  To: Jose A. Ortega Ruiz; +Cc: guile-devel

Heya Jao,

Thanks for the detailed report. I've pushed fixes for both of these
issues.

On Mon 15 Jun 2009 22:18, "Jose A. Ortega Ruiz" <jao@gnu.org> writes:

>   ERROR: In procedure make_objcode_by_mmap:
>   ERROR: Success

>   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

Now,

Backtrace:
In unknown file:
   ?: 0* [#<vm b8071650> #<program b7fb7ec0 at <unknown port>:1:0 ()>]
   2: 1* [#<program b7fb7ec0 at <unknown port>:1:0 ()>]
   ?: 2* [load-compiled/vm "/home/wingo/.guile-ccache/1.9//tmp/a.scm.go"]
In /tmp/a.scm:
   4: 3* [ap]

ERROR: In procedure module-lookup:
ERROR: unbound variable: not-bound

I'm not certain why the load-compiled call does not have source info,
though. It seems the "2" on frame 1 corresponds to the second line of
stdin; perhaps that source info is getting misplaced. Let us know if you
find other bugs.

Andy
-- 
http://wingolog.org/




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-20 10:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-15 20:18 a couple bugs related to error reporting and backtraces Jose A. Ortega Ruiz
2009-06-20 10:47 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).