[ruby-core:93622] [Ruby master Bug#10567] A fiber issue with `autoload`: `fiber called across stack rewinding barrier (FiberError)`

From: merch-redmine@...
Date: 2019-07-09 01:32:07 UTC
List: ruby-core #93622
Issue #10567 has been updated by jeremyevans0 (Jeremy Evans).

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>'
```

----------------------------------------
Bug #10567: A fiber issue with `autoload`: `fiber called across stack rewinding barrier (FiberError)`
https://bugs.ruby-lang.org/issues/10567#change-79226

* Author: qqshfox (Hanfei Shen)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby-2.1.5
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
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?



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next