Actions
Bug #10567
closedA fiber issue with `autoload`: `fiber called across stack rewinding barrier (FiberError)`
    Bug #10567:
    A fiber issue with `autoload`: `fiber called across stack rewinding barrier (FiberError)`
  
Description
We have two ruby files as following:
test.rb
autoload :User, './user.rb'
f = Fiber.new do
  p User
end
f.resume
f.resume
user.rb
class User
end
Fiber.yield # This line is important
If I run the test.rb, i got the a FiberError on Ruby 2.x but not on Ruby 1.9.3
$ rvm 1.9.3,2.0,2.1 do sh -c 'echo ==== $RUBY_VERSION; ruby test.rb'
==== ruby-1.9.3-p551
User
==== ruby-2.0.0-p598
user.rb:4:in `yield': fiber called across stack rewinding barrier (FiberError)
    from user.rb:4:in `<top (required)>'
    from test.rb:4:in `block in <main>'
==== ruby-2.1.5
user.rb:4:in `yield': fiber called across stack rewinding barrier (FiberError)
    from user.rb:4:in `<top (required)>'
    from test.rb:4:in `block in <main>'
More sample codes are in this repo:
https://github.com/qqshfox/test_fiber
Is this intentional?
        
           Updated by jeremyevans0 (Jeremy Evans) over 6 years ago
          Updated by jeremyevans0 (Jeremy Evans) over 6 years ago
          
          
        
        
      
      - Status changed from Open to Closed
This issue was fixed between Ruby 2.2 and 2.3:
$ ruby23 test.rb  
User
$ ruby22 test.rb  
.../user.rb:4:in `yield': fiber called across stack rewinding barrier (FiberError)
        from .../user.rb:4:in `<top (required)>'
        from test.rb:4:in `block in <main>'
Actions