On 12/1/06, Pit Capitain <pit / capitain.de> wrote:
> Bob Hutchison schrieb:
> > So I put some printf into the eval.c file and it turns out that rb_eval
> > is called recursively 5301 times before seg faulting, while trying to
> > handle a NODE_DASGN_CURR node. There are no other eval node types being
> > evaluated when this begins, every node is a NODE_DASGN_CURR.
> >
> > There is nothing that is anywhere that deep in the script that I am
> > evaluating. So it looks as though the proc object is corrupt??
> >
> > So maybe this is reproducible?? Well, so it is. If I run this script:
> >
> > (...)
> >
> > It will fail on the one linux box, run on the other, and run on OS X.
> > With a little binary search, the smallest N that causes the segfault is
> > 3024 (3023 works).
>
> Bob, you can use parsetree to dump the AST of the generated proc. I'm
> sure you'll see the deep nesting of the nodes.
>

I just tried this, and here's what it gave me (for a smaller N, so the
whole process doesn't crash. Should show the same structure no matter
what N is, though)

[[:module,
  :SomeModule,
  [:defn,
   :initialize,
   [:scope, [:block, [:args], [:cvasgn, :@@proc, [:nil]]]]],
  [:defn,
   :"self.build",
   [:scope,
    [:block,
     [:args],
     [:if,
      [:cvar, :@@proc],
      [:block,
       [:lasgn, :result, [:call, [:cvar, :@@proc], :call]],
       [:cvasgn, :@@proc, [:nil]],
       [:return, [:lvar, :result]]],
      nil]]]]]]