From: Wilson Bilkovich Date: 2006-12-01T03:20:26+09:00 Subject: Re: Segmentation fault, proc, eval, long string On 11/30/06, Wilson Bilkovich wrote: > On 11/30/06, Bob Hutchison wrote: > > > > On 30-Nov-06, at 12:09 PM, Wilson Bilkovich wrote: > > > > > On 11/30/06, Bob Hutchison wrote: > > >> Hi, > > >> > > >> I'm getting a 'Segmentation fault' in ruby 1.8.5 running on debian in > > >> a Xen VPS. The same code running on OS X and a different version of > > >> linux has no problems. > > >> > > >> The process to get this is maybe a little strange. > > >> > > >> 1) read a large file into a string (1.3MB) > > >> 2) eval the string (the string is a single ruby proc definition that > > >> when called will build an object structure in memory) > > >> 3) call the proc --> Segmentation fault *very* soon after > > >> > > > > > > Hrm. This looks similar to the problem reported here: > > > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/80435 > > > > Thanks for the link. > > > > Could be, but that thread kind of petered out. There were some others > > that I found that didn't seem to resolve. There was one in Japanese > > that I certainly could not follow :-) > > > > Can you get a full stack trace from gdb or something? > I found a pile of other links by googling for 'unknown node type' that > seem to suggest that maybe some of your objects are getting > prematurely garbage collected. > > Maybe the size of that method hits a Ruby threshold that triggers GC > inappropriately? > > Try turning GC off; if that fixes it, that might help narrow it down. > Oh, and what happens when you freeze the string before eval'ing it?