bugGuile - Bugs: bug #32340, non-local exit may cause...

 
 

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

Submitter:  Mike Gran <mike121>
Submitted:  Thu 03 Feb 2011 02:48:55 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 30 Mar 2011 09:32:35 PM UTC, comment #1: 

Fixed in 572eef50c2d902d34427945dd504ba03af666e48.  Thanks for the report!

Andy Wingo <wingo>
Group administrator
Thu 03 Feb 2011 02:48:55 PM UTC, original submission:  

Hi-

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 expression

  ((@ (ice-9 control) %) (begin (load-user-init) ((@ (ice-9 top-repl) 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

Backtrace:
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 ...]

Mike Gran <mike121>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by wingo (Posted a comment)
  • -email is unavailable- added by mike121 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-03-30 wingo StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code