From: Bob Hutchison Date: 2006-12-03T22:51:38+09:00 Subject: Re: Segmentation fault, proc, eval, long string [Reproduced] Hi, On 2-Dec-06, at 10:59 AM, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Segmentation fault, proc, eval, long string > [Reproduced]" > on Fri, 1 Dec 2006 02:50:30 +0900, Bob Hutchison > writes: > > |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: > > Thank you for the report. Your script helped. Could you check if the > attached patch work for you? Thanks for the patch. I applied it and tried a few things with it. The test program I provided does work now, so I think this is solving the problem. On the other hand, when I try to run the application that needs it, debian is killing it and I can't see why. The installation I'm using, as it happens, doesn't have any VM configured and this has been causing some difficulty recently. Could this patch cause a lot of memory to be allocated rapidly? If not then there's something else going on that I'll have to look into (and it is likely a completely different problem). Thanks everyone for your help. Cheers, Bob > > matz. > > Index: parse.y > =================================================================== > RCS file: /var/cvs/src/ruby/parse.y,v > retrieving revision 1.307.2.47 > diff -p -u -1 -r1.307.2.47 parse.y > --- parse.y 2 Nov 2006 06:45:50 -0000 1.307.2.47 > +++ parse.y 2 Dec 2006 15:57:23 -0000 > @@ -4863,2 +4863,4 @@ gettable(id) > > +static VALUE dyna_var_lookup _((ID id)); > + > static NODE* > @@ -4891,3 +4893,3 @@ assignable(id, val) > } > - else if (rb_dvar_defined(id)) { > + else if (dyna_var_lookup(id)) { > return NEW_DASGN(id, val); > @@ -5733,2 +5735,18 @@ top_local_setup() > > +static VALUE > +dyna_var_lookup(id) > + ID id; > +{ > + struct RVarmap *vars = ruby_dyna_vars; > + > + while (vars) { > + if (vars->id == id) { > + vars->val = Qtrue; > + return Qtrue; > + } > + vars = vars->next; > + } > + return Qfalse; > +} > + > static struct RVarmap* > @@ -5767,3 +5786,5 @@ dyna_init(node, pre) > for (var = 0; post != pre && post->id; post = post->next) { > - var = NEW_DASGN_CURR(post->id, var); > + if (RTEST(post->val)) { > + var = NEW_DASGN_CURR(post->id, var); > + } > } > ---- Bob Hutchison -- blogs at Recursive Design Inc. -- Raconteur -- xampl for Ruby --