From: WATANABE Hirofumi Date: 2002-09-04T14:51:05+09:00 Subject: Re: Ruby Segfault: Marshaling large objects Hi, "Guaracy Monteiro" writes: > ----- Original Message ----- > From: "Paul Duncan" > > (...) > > > pabs@picard:~/proj/marshaltest> cat ./marshaltest.rb > > #!/usr/bin/ruby > > > > s = '%10d' % 1; # Create Smaller string > > d = Marshal.dump(s); # Dump it > > t = Marshal.load(d); # Load it > > puts 'okay' > > > > s = '%10000000d' % 1; # Create 10Mb string > > d = Marshal.dump(s); # Dump it > > t = Marshal.load(d); # Load it -- causes segfault > > > > pabs@picard:~/proj/marshaltest> gdb ~/cvs/ruby/ruby > > Starting program: /home/pabs/cvs/ruby/ruby ./marshaltest.rb > > okay > > > > Program received signal SIGSEGV, Segmentation fault. > (...) > > > I perused the source but didn't see anything really obvious. I'll take > > a better look after lunch. > > The sources is ok (i think). No problems to run on Windows ME 64Mb. > > ruby 1.6.7 (2002-03-01) [i586-mswin32] (from Pragmatic Programmer's) > and > ruby 1.7.3 (2002-09-02) [i386-cygwin] (from CVS) That's because the stack of mswin32/mingw32/cygwin ruby has reserved 32MB. % objdump -p =ruby.exe |grep -i stack SizeOfStackReserve 02000000 SizeOfStackCommit 00001000 -- eban