Ludovic Courtès escreveu: > Hi, > > Han-Wen Nienhuys <[EMAIL PROTECTED]> writes: > >> [EMAIL PROTECTED] 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 - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel