SEGV with flatten and callcc

e$B0J2<$N$h$&$K$9$k$He(B SEGV e$B$7$^$9!#e(B

% ./ruby -rcontinuation -ve ’
o = Object.new
def o.to_ary() callcc {|k| $k = k; [1,2,3]} end
p [10,20,o,30,o,40].flatten
$k.call

ruby 1.9.0 (2008-05-22 revision 16518) [i686-linux]
[10, 20, 1, 2, 3, 30, 1, 2, 3, 40]
-e:4: [BUG] Segmentation fault
ruby 1.9.0 (2008-05-22 revision 16518) [i686-linux]

– stack frame ------------
0000 (0xb7acb008): 00000004
0001 (0xb7acb00c): 081aeb9c
0002 (0xb7acb010): 00000004
0003 (0xb7acb014): 00000001
0004 (0xb7acb018): 081aec64
0005 (0xb7acb01c): 00000004
0006 (0xb7acb020): 081aebb0
0007 (0xb7acb024): 00000004
0008 (0xb7acb028): 081aebd8
0009 (0xb7acb02c): 00000004
0010 (0xb7acb030): 00000001
0011 (0xb7acb034): 00000004
0012 (0xb7acb038): 00000001 <- lfp <- dfp
– control frame ----------
c:0005 p:---- s:0013 b:0013 l:000012 d:000012 CFUNC :inspect
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :stuck_out_tongue:
c:0003 p:0048 s:0007 b:0007 l:0019a0 d:0019a0 TOP -e:4
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
:private_class_method
c:0001 p:0000 s:0002 b:0002 l:0019dc d:0019dc TOP :17

DBG> : “-e:4:in p'" DBG> : "-e:4:in'”
– backtrace of native function call (Use addr2line) –
0x8117ed4
0x813c9ef
0x813ca27
0x80daceb
0xb7f66440
0xb7e1a9ef
0x8062b70
0x8062c41
0x8062c85
0x8062cc6
0x80e0014
0x80e0044
0x8066e45
0x8066e70
0x8067aa4
0x811bc14
0x811bdb9
0x812375f
0x810d8fe
0x810d403
0x805da8a
0x805dad8
0x805dd23
0x8084626
0x8072b20
0x8072b7f
0x810d8e8
0x81156fb
0x8115245
0x8111744
0x81158e2
0x8115f33
0x805bc06
0x805bca9
0x8058d28
0xb7dc7ea8
0x8058c31

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs