[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #32340] non-local exit may cause wrong-type-arg error

From: Mike Gran
Subject: [bug #32340] non-local exit may cause wrong-type-arg error
Date: Thu, 03 Feb 2011 14:48:56 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110103 Fedora/3.6.13-1.fc14 Firefox/3.6.13


                 Summary: non-local exit may cause wrong-type-arg error
                 Project: Guile
            Submitted by: mike121
            Submitted on: Thu 03 Feb 2011 02:48:55 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any




Sometimes on a non-local exit can cause a wrong-type-arg error to be emitted.
 This may be associated with GUILE_AUTO_COMPILE=0.  It is a mandelbug, so I
don't have a way to replicate it consistently, yet.

Here is one example.

guile: uncaught throw to wrong-type-arg: (#f Wrong type (expecting ~A): ~S
(exact integer (#t #<catch-closure 318bca0> #<catch-closure 318bc80>
#<catch-closure 318bc60>)) ((#t #<catch-closure 318bca0> #<catch-closure
318bc80> #<catch-closure 318bc60>)))

Looking at the C backtrace, the error is a non-integer getting passed to
scm_to_size_t in scm_i_prompt_pop_abort_args_x.

The line in question is

63        n = scm_to_size_t (SCM_PROMPT_REGISTERS (prompt)->sp[0]);

If I scm_write the value that is getting passed to scm_to_size_t, I get the

  ((@ (ice-9 control) %) (begin (load-user-init) ((@ (ice-9 top-repl)

which is clearly not an integer.  ;-)

Nine levels up in the C stack is a scm_c_primitive_eval, which is evaluating
#<tree-il (apply (@@ (ice-9 control) call-with-prompt) (apply (@@ (ice-9
control) default-prompt-tag)) (lambda () (lambda-case ((() #f #f #f () ())
(begin (apply (toplevel load-user-init)) (apply (@ (ice-9 top-repl)
top-repl)))))) (@@ (ice-9 control) default-prompt-handler))>

Here is the C stack  

#0  scm_error_scm (key=0x766320, subr=0x4, message=0xafb0c20, args=0xaaf2290,

    data=0xaaf22b0) at error.c:94
#1  0x00007ffff7c95ac1 in scm_error (key=0x766320, subr=0x0, 
    message=0x7ffff7d78617 "Wrong type (expecting ~A): ~S", args=0xaaf2290, 
    rest=0xaaf22b0) at error.c:61
#2  0x00007ffff7c95fe6 in scm_wrong_type_arg_msg (subr=0x0, pos=0, 
    bad_value=0xb14b40, szMessage=0x7ffff7d85130 "exact integer")
    at error.c:287
#3  0x00007ffff7cdecee in scm_to_uint64 (val=0xb14b40)
    at ../libguile/conv-uinteger.i.c:90
#4  0x00007ffff7c8df25 in scm_i_prompt_pop_abort_args_x (prompt=0xafaaa80)
    at control.c:63
#5  0x00007ffff7c97e99 in eval (x=0x869750, env=0xaaf0150) at eval.c:424
#6  0x00007ffff7c971be in eval (x=0x6534080, env=0x565ec80) at eval.c:223
#7  0x00007ffff7c9743b in eval (x=0x885940, env=0x19c31e0) at eval.c:247
#8  0x00007ffff7c97ec2 in eval (x=0x869750, env=0x653a610) at eval.c:428
#9  0x00007ffff7c98d27 in scm_c_primitive_eval (exp=0x98065a0) at eval.c:728
#10 0x00007ffff7d46875 in vm_debug_engine (vm=0x7b2d40, program=0x7b9340, 
    argv=0x7fffffffbbb0, nargs=1) at vm-i-system.c:874
#11 0x00007ffff7d56908 in scm_c_vm_run (vm=0x7b2d40, program=0x7b9340, 
    argv=0x7fffffffbba8, nargs=1) at vm.c:565
#12 0x00007ffff7c98d61 in scm_primitive_eval (exp=0xb14b40) at eval.c:735

If I coerce a Scheme backtrace out of it, I get

In unknown file:
   ?: 4 [boot-closure #t #<catch-closure 318bca0> ...]
   ?: 3 [catch-closure]
   ?: 2 [primitive-eval {((@ (ice-9 control) %) (begin (load-user-init)
   ?: 1 [boot-closure wrong-type-arg #f ...]
   ?: 0 [catch-closure wrong-type-arg #f ...]


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]