unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Han-Wen Nienhuys <hanwen@xs4all.nl>
Subject: Re: frames / stacks / source?  was Re: coverage/profiling
Date: Wed, 10 Jan 2007 12:44:21 +0100	[thread overview]
Message-ID: <45A4D195.30109@xs4all.nl> (raw)
In-Reply-To: <874pqzgs2a.fsf@laas.fr>

Ludovic Courtès escreveu:
> Hi,
> 
> Han-Wen Nienhuys <hanwen@xs4all.nl> writes:
> 
>> [hanwen@haring info]$ guile
>> guile> (trap-enable 'enter-frame-handler)
>> throw from within critical section.
>> Abortado
> 
> Same here with HEAD and 1.8.0.  Here's what happens:
> 
>   #0  0x0fc13f6c in raise () from /lib/tls/libc.so.6
>   #1  0x0fc15a0c in abort () from /lib/tls/libc.so.6
>   #2  0x0ffa4a1c in scm_ithrow (key=0x10015410, args=0x300a2558, noreturn=<value optimized out>) at throw.c:699
>   #3  0x0ff3718c in scm_error_scm (key=0x10015410, subr=0x300781f0, message=0x300781d0, args=0x300a2578, data=0x4) at error.c:92
>   #4  0x0ff37220 in scm_error (key=0x10015410, subr=<value optimized out>, message=0xffc5594 "Unknown option name: ~S", args=0x300a2578, 
>       rest=0x4) at error.c:58
>   #5  0x0ff37268 in scm_misc_error (subr=0xfa <Address 0xfa out of bounds>, message=0x3001bb60 "", args=0x0) at error.c:268
>   #6  0x0ff721a8 in scm_options (args=0x300a25e8, options=0xffe1b40, n=7, s=0xffc117c "evaluator-traps-interface") at options.c:202
>   #7  0x0ff3a1e4 in scm_evaluator_traps (setting=0x300a25c8) at eval.c:3134
>   #8  0x0ff3ec50 in deval (x=<value optimized out>, env=0x300a2668) at eval.c:4219
> 
> (Note the "Unknown option name"...)

I have added 

 /* the jump buffer data structure */
@@ -695,7 +696,24 @@ scm_ithrow (SCM key, SCM args, int noret
 
   if (scm_i_critical_section_level)
     {
+      SCM s = args;
+      int i = 0;
+
+      /*
+       We have much better routines for displaying Scheme, but we're
+       already inside a pernicious error, and it's unlikely that they
+       are available to us. We try to print something useful anyway,
+       so users don't need a debugger to find out what went wrong.
+       */
       fprintf (stderr, "throw from within critical section.\n");
+      if (scm_is_symbol (key))
+       fprintf (stderr, "error key: %s\n", scm_i_symbol_chars (key));
+
+      
+      for (; scm_is_pair (s); s = scm_cdr (s), i++)
+       if (scm_is_string (scm_car (s)))
+         fprintf (stderr, "argument %d: %s\n", i, scm_i_string_chars (scm_car (s)));
+      
       abort ();
     }
 

I wonder, is there any generic routine for safely printing immediates 
and strings/symbols?  This might also be a good idea to apply to 1.8.
With lilypond, we occasionally have this problem as well, and it's
a PITA to have to use a debugger to find out about a user-level fault.


 
-- 
 Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2007-01-10 11:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-02 18:19 coverage/profiling Han-Wen Nienhuys
2007-01-08 23:48 ` frames / stacks / source? was coverage/profiling Han-Wen Nienhuys
2007-01-09  9:10   ` Ludovic Courtès
2007-01-09 13:32     ` Han-Wen Nienhuys
2007-01-09 14:07     ` Andy Wingo
2007-01-09 22:05   ` Kevin Ryde
2007-01-09 22:15   ` Neil Jerram
2007-01-09 22:45     ` Han-Wen Nienhuys
2007-01-09 22:48     ` Han-Wen Nienhuys
2007-01-10  8:46       ` Neil Jerram
2007-01-10 12:59         ` Han-Wen Nienhuys
2007-01-10  9:16       ` Ludovic Courtès
2007-01-10 11:44         ` Han-Wen Nienhuys [this message]
2007-01-17 22:57           ` Kevin Ryde
2007-01-10 15:43     ` Han-Wen Nienhuys
2007-01-11  8:46       ` Ludovic Courtès
2007-01-11 10:19         ` Han-Wen Nienhuys
2007-01-11 15:57           ` Ludovic Courtès
2007-01-14  0:36     ` Neil Jerram
2007-01-18 23:15       ` Kevin Ryde
2007-01-27 18:12         ` Neil Jerram

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=45A4D195.30109@xs4all.nl \
    --to=hanwen@xs4all.nl \
    /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).