[MacRuby-devel] macruby 0.3 - fiber library causes segmentation fault

Laurent Sansonetti lsansonetti at apple.com
Sun Sep 7 16:49:13 PDT 2008


Hi Bernard,

Yes fibers are currently broken. I don't plan to fix this for the  
upcoming 0.3 release, so if you want to file a bug please do. I don't  
remember if we have one, already.

Thanks for testing!

Laurent

On Sep 7, 2008, at 2:34 PM, Bernard Kenik wrote:

> I am not sure if this is a know problem and so I have not written a  
> ticket.
> I jave tried several small scripts with the similiar error messages.
>
> Trying to learn about fiber in ruby 1.9 -- I used the following  
> example from the PragDave: Pipelines Using Fibers in Ruby 1.9 webpage.
>
> renard$ cat first_fiber.rb
> ################# start of code
> require 'fiber'
>
> evens = Fiber.new do
>   value = 0
>   loop do
>     Fiber.yield value
>     value += 2
>   end
> end
>
> consumer = Fiber.new do
>   10.times do
>     next_value = evens.resume
>     puts next_value
>   end
> end
>
> consumer.resume
> ############### end of code
> renard$ macruby first_fiber.rb
>
> with the following results
>
>
> first_fiber.rb:13: [BUG] Segmentation fault
> MacRuby version 0.3 (ruby 1.9.0 2008-06-03) [universal-darwin9.0]
>
> -- stack frame ------------
> 0000 (0x1283800): 00000000
> 0001 (0x1283804): 00000004
> 0002 (0x1283808): 010adffd
> 0003 (0x128380c): 00000015
> 0004 (0x1283810): 00000004
> 0005 (0x1283814): 0128776d
> 0006 (0x1283818): 00000004
> 0007 (0x128381c): 00000004
> 0008 (0x1283820): 01283809 (= 2)
> 0009 (0x1283824): 010ae260
> 0010 (0x1283828): 00000004
> 0011 (0x128382c): 00000001 <- lfp <- dfp
> -- control frame ----------
> c:0007 p:---- s:0012 b:0012 l:000011 d:000011 CFUNC  :resume
> c:0006 p:0009 s:0009 b:0009 l:0026bc d:000008 BLOCK  first_fiber.rb:13
> c:0005 p:---- s:0008 b:0008 l:000007 d:000007 FINISH
> c:0004 p:---- s:0006 b:0006 l:000005 d:000005 CFUNC  :times
> c:0003 p:0008 s:0003 b:0003 l:0026bc d:000002 BLOCK  first_fiber.rb:12
> c:0002 p:---- s:0003 b:0003 l:000002 d:000002 FINISH
> c:0001 p:---- s:0001 b:-001 l:000000 d:000000 ------
> ---------------------------
> DBG> : "first_fiber.rb:13:in `resume'"
> DBG> : "first_fiber.rb:13:in `block (2 levels) in <main>'"
> DBG> : "first_fiber.rb:12:in `times'"
> DBG> : "first_fiber.rb:12:in `block in <main>'"
> -- backtrace of native function call (Use addr2line) --
> 0x2d4e06
> 0x1f3efc
> 0x1f3f3b
> 0x28a641
> 0x9557209b
> 0xffffffff
> 0x2daf76
> 0x947db28a
> 0x92c2c4d1
> -------------------------------------------------------
> Abort trap
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel



More information about the MacRuby-devel mailing list