Bug #3557
closedMarshal.dump fails for large Arrays of Arrays
Description
=begin
def test
n1 = 10
n2 = 34000
b = Array.new n1
for i in 0 ... n1 do
a = Array.new n2
for j in 0 ... n2 do a[j] = j end
b[i] = a
end
Marshal.dump b
end
dump_arg_data in marshal.c gets prematurely freed by GC run_final()
Enclosing the Marshal.dump with GC.disable and GC.enable fixes the problem
=end
Updated by nobu (Nobuyoshi Nakada) almost 15 years ago
- Status changed from Open to Feedback
=begin
2010-05-31 sounds truly old.
I can't reproduce it with the recent.
$ ./ruby -ve 'p Marshal.dump(Array.new(10){[*34000.times]}).size'
ruby 1.9.2dev (2010-07-11 revision 28610) [i386-mswin32_80]
1356254
I suspect it has been fixed at r28467.
=end
Updated by luislavena (Luis Lavena) almost 15 years ago
=begin
I can't reproduce it either, using rc1
C:\Users\Luis>ruby -ve 'p Marshal.dump(Array.new(10){[*34000.times]}).size'
ruby 1.9.2dev (2010-07-02) [i386-mingw32]
1356254
=end
Updated by nobu (Nobuyoshi Nakada) almost 15 years ago
- Status changed from Feedback to Rejected
=begin
=end
Updated by ajankevics (Andrew Jankevics) almost 15 years ago
=begin
Notice I am running x64 on mswin64 (xp64 sp2), not i386 on mswin32 or mingw32.
My version passes "nmake test".
C:\andy\data>ruby -ve 'p Marshal.dump(Array.new(10){[*34000.times]}).size'
ruby 1.9.2dev (2010-05-31) [x64-mswin64_80]
-e:1: [BUG] Segmentation fault
ruby 1.9.2dev (2010-05-31) [x64-mswin64_80]
-- control frame ----------
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :dump
c:0003 p:0031 s:0007 b:0006 l:000428 d:001278 EVAL -e:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:000428 d:000428 TOP¶
-- Ruby level backtrace information ----------------------------------------
-e:1:in <main>' -e:1:in
dump'
=end
Updated by nobu (Nobuyoshi Nakada) almost 15 years ago
=begin
Hi,
At Tue, 27 Jul 2010 05:34:32 +0900,
Andrew Jankevics wrote in [ruby-core:31502]:
C:\andy\data>ruby -ve 'p Marshal.dump(Array.new(10){[*34000.times]}).size'
ruby 1.9.2dev (2010-05-31) [x64-mswin64_80]
Try with newer revision.
--
Nobu Nakada
=end
Updated by ajankevics (Andrew Jankevics) almost 15 years ago
=begin
Thank you!
D:\andy\data>ruby -ve 'p Marshal.dump(Array.new(10){[*34000.times]}).size'
ruby 1.9.2dev (2010-07-11) [x64-mswin64_80]
1356254
Many other combinations of Array lengths that previously failed work properly now!
Sorry, I missed 1.9.2-rc2 until you pointed it out.
Andy
=end