Projects

Ticket #81 (closed defect: duplicate)

Opened 4 years ago

Last modified 14 months ago

Enumerable::Enumerator seems to be broken

Reported by: flatter@… Owned by: lsansonetti@…
Priority: minor Milestone:
Component: MacRuby Keywords:
Cc:

Description

Hi there, Enumerators seem to be broken in trunk (did not try 0.2). Perhaps I'm using them the wrong way but anyways "at least it should not crash" (greetings to lrz).

Code sample:

arr = [:a, :b, :c, :d]
enum = arr.map!
while(el = enum.next) do
 puts el
end

Output:

foo.rb:4: [BUG] Segmentation fault
MacRuby version 0.3 (ruby 1.9.0 2008-06-03) [universal-darwin9.3]

-- stack frame ------------
0000 (0x30030): 00000004
0001 (0x30034): 00000001
0002 (0x30038): 00000004
0003 (0x3003c): 00000001
0004 (0x30040): 010c39f0
0005 (0x30044): 010c3a90
0006 (0x30048): 00000004
0007 (0x3004c): 00000004
0008 (0x30050): 00000001
0009 (0x30054): 010c3a90
0010 (0x30058): 00000004
0011 (0x3005c): 010c3d20
-- control frame ----------
c:0004 p:---- s:0012 b:0012 l:002478 d:002478 CFUNC  :next
c:0003 p:0038 s:0009 b:0009 l:000008 d:000008 TOP    foo.rb:4
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH :inherited
c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP    
---------------------------
DBG> : "foo.rb:4:in `next'"
DBG> : "foo.rb:4:in `<main>'"
-- backtrace of native function call (Use addr2line) --
0x2b63d6
0x1df14c
0x1df18b
0x270311
0x9123309b
0xffffffff
0x2bc096
0x2bc210
0x1de90a
0x2a4df1
0x2a8ab8
0x1e
-------------------------------------------------------

Change History

Changed 4 years ago by lsansonetti@…

  • milestone set to MacRuby 0.3

Changed 3 years ago by lsansonetti@…

It's broken because it uses a fiber, and the whole multithreaded thing is broken right now in MacRuby.

Changed 3 years ago by lsansonetti@…

  • milestone changed from MacRuby 0.3 to MacRuby 0.4

Changed 23 months ago by martinlagardette@…

  • priority changed from blocker to minor
  • milestone MacRuby 0.4 deleted

Changed Priority to minor, because it doesn't crash anymore. It doesn't mean it works, but "at least it does not crash" and I guess there are multiple other ways to enumerate over a collection :-)

Changed 14 months ago by eloy.de.enige@…

  • status changed from new to closed
  • resolution set to duplicate

#817 has more details.

Note: See TracTickets for help on using tickets.