[#107867] Fwd: [ruby-cvs:91197] 8f59482f5d (master): add some tests for Unicode Version 14.0.0 — Martin J. Dürst <duerst@...>
To everybody taking care of continuous integration:
3 messages
2022/03/13
[#108090] [Ruby master Bug#18666] No rule to make target 'yaml/yaml.h', needed by 'api.o' — duerst <noreply@...>
Issue #18666 has been reported by duerst (Martin D端rst).
7 messages
2022/03/28
[#108117] [Ruby master Feature#18668] Merge `io-nonblock` gems into core — "Eregon (Benoit Daloze)" <noreply@...>
Issue #18668 has been reported by Eregon (Benoit Daloze).
22 messages
2022/03/30
[ruby-core:108076] [Ruby master Misc#18662] Fiber scheduling and Module#autoload
From:
"fxn (Xavier Noria)" <noreply@...>
Date:
2022-03-25 20:17:56 UTC
List:
ruby-core #108076
Issue #18662 has been updated by fxn (Xavier Noria).
https://bugs.ruby-lang.org/issues/18663 is the same, human race condition :D. We could close one of the two, at your discretion.
----------------------------------------
Misc #18662: Fiber scheduling and Module#autoload
https://bugs.ruby-lang.org/issues/18662#change-97034
* Author: fxn (Xavier Noria)
* Status: Open
* Priority: Normal
----------------------------------------
Looks like Fiber context-switching does not synchronize constant reference access. This script using the `async` gem demonstrates the issue:
```ruby
require 'tempfile'
require 'async'
Tempfile.create(['foo', '.rb']) do |file|
file.write(<<~RUBY)
sleep 0.01
class C
end
RUBY
file.close
autoload :C, file.path
Async do |task|
3.times do |i|
task.async { p C }
end
end.wait
end
```
As you'll, it raises `NameError`s.
The `sleep` call in `c.rb` is just an artificial way to trigger a context switch, but we learned that the `debug` gem does trigger it due to a TracePoint on `script_compiled` it installs. Check this other script that also reproduces the error:
```ruby
require 'tempfile'
require 'async'
require 'debug'
Tempfile.create(['foo', '.rb']) do |file|
file.write(<<~RUBY)
class C
def self.call_me
end
end
RUBY
file.close
autoload :C, file.path
Async do |task|
5.times do |i|
task.async do
p C.call_me
end
end
end.wait
end
```
See https://github.com/ruby/debug/issues/580 for details.
I didn't tag this as "bug" because I do not know how you'd consider this. On one hand, blocking fibers are switched by the programmer, but non-blocking ones are by a contract interface + scheduler.
What do you think? Could something be done?
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>