unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Jose A. Ortega Ruiz" <jao@gnu.org>
To: guile-devel@gnu.org
Subject: a couple bugs related to error reporting and backtraces
Date: Mon, 15 Jun 2009 22:18:32 +0200	[thread overview]
Message-ID: <87ocspb693.fsf@mithrandir.homeunix.net> (raw)


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





             reply	other threads:[~2009-06-15 20:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-15 20:18 Jose A. Ortega Ruiz [this message]
2009-06-20 10:47 ` a couple bugs related to error reporting and backtraces Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ocspb693.fsf@mithrandir.homeunix.net \
    --to=jao@gnu.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).