guile-devel
[Top][All Lists]
Advanced

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

Re: compiling with -DSCM_DEBUG=1


From: Ken Raeburn
Subject: Re: compiling with -DSCM_DEBUG=1
Date: Fri, 4 Sep 2009 18:56:24 -0400

On Sep 3, 2009, at 17:04, Ken Raeburn wrote:
[...] Scheme compilation bug is still there, though.

I'm still not sure where the bug is, but here's what I've traced through so far;

The error is happening in eval.i.c, line number in the high 800s (I've got a bunch of tracing lines added in my copy):

  while (!scm_is_null (args))
    {
      /* More arguments than specifiers => CLASS != ENV */
      SCM class_of_arg = scm_class_of (SCM_CAR (args));
      if (!scm_is_eq (class_of_arg, SCM_CAR (z)))   // <== HERE!
        goto next_method;
      args = SCM_CDR (args);
      z = SCM_CDR (z);
    }

At this line, at one point during the compilation of debugger.scm, z is not a pair. (Earlier the problem was triggering somewhere else for me, now it's in debugger.scm; not sure why.)

Some tracing of the containing do loop indicates that these are the sorts of values used before the error happens:

do-loop with hash_value 0 arg1 (#<struct 10a6370:1092060> #<struct 10a6d40:10b94e0>) z (no-method) do-loop with hash_value 0 arg1 (#<struct 10a6370:115cb0> #<struct 10a6d40:115a60>) z (no-method) do-loop with hash_value 0 arg1 (#<struct 10a6370:1010de0> #<struct 10a6d40:1010db0>) z (#<struct 10a73a0:10a6370> #<struct 10a0bc0:10a6d40> . #<procedure #f (#{gf\ 2116}# #{m\ 2117}#)>) do-loop with hash_value 0 arg1 (#<primitive-generic eqv?> #<struct 10a6d40:1099310>) z (#<struct 10a73a0:10a6370> #<struct 10a0bc0:10a6d40> . #<procedure #f (#{gf\ 2116}# #{m\ 2117}#)>)
[...]
do-loop with hash_value 3 arg1 (#<<generic> apply-generic (0)> #<<method> (<generic> <top>) 10bbd80>) z (#<<entity-class> <generic> 10a59a0> #<<class> <method> 10a6420> . #<procedure #f (#{gf\ 2116}# #{m \ 2117}#)>)

But then:
do-loop with hash_value 0 arg1 (#<<entity-class> <generic> 10a59a0> #:name compute-applicable-methods) z (#<<class> <entity-class> 10a6910> #<<class> <keyword> 10a3b90> . #<procedure #f (#{class\ 2660}# . #{initargs\ 2659}#)>)

Here, the arg list has three elements instead of the two in the calls shown above, but the initial 'z' value isn't any longer; they're walked in parallel in that while loop, 'z' runs out first, and SCM_CAR is applied to a non-pair:

Non-pair accessed with SCM_C[AD]R: `#<procedure #f (#{class\ 2660}# . #{initargs\ 2659}#)>'

Assuming the bug doesn't jump out as obvious to someone from this, I'll dig into it a little more later.

Ken




reply via email to

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