From: Daniel Berger Date: 2006-10-28T01:25:09+09:00 Subject: Re: Bug segmentation fault Gavin Kistner wrote: > From: list-bounce@example.com > > I am trying to display the contents of large array (over 1000 rows) > > using arrayName.collect {|x| puts x.inspect} > > However the following occurs: > > > > [Bug] Segmentation fault > > ruby 1.8.5 (20006-08-25) [i386-mswin32] > > I have no idea if it will make a different, but do you realize that by > calling collect you are creating an array whose entries are the return > value of puts (which is always nil). An array of over 1000 nil entries. > > I think you probably want either: > arrayName.each{ |x| puts x.inspect } > or > puts arrayName.collect{ |x| x.inspect } True, but it shouldn't segfault in any case. I'm curious what the objects of arrayName look like. I was not able to duplicate this problem with a 10000 element array of simple objects. Regards, Dan