* [ruby-core:101731] [Ruby master Bug#17477] Ractor and pp incompatibility
@ 2020-12-27 8:14 shatrov
2020-12-27 16:20 ` [ruby-core:101749] " eregontp
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: shatrov @ 2020-12-27 8:14 UTC (permalink / raw)
To: ruby-core
Issue #17477 has been reported by kirs (Kir Shatrov).
----------------------------------------
Bug #17477: Ractor and pp incompatibility
https://bugs.ruby-lang.org/issues/17477
* Author: kirs (Kir Shatrov)
* Status: Open
* Priority: Normal
* ruby -v: 3.0.0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
```ruby
r = Ractor.new do
pp("foobar")
end
Ractor.select(r)
```
fails with:
```
#<Thread:0x00007f973414a050 run> terminated with exception (report_on_exception is true):
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:167:in `require'
from notractor.rb:8:in `block in <main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from notractor.rb:8:in `block in <main>'
<internal:ractor>:345:in `select': thrown by remote Ractor. (Ractor::RemoteError)
from notractor.rb:11:in `<main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:167:in `require'
from notractor.rb:8:in `block in <main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from notractor.rb:8:in `block in <main>'
```
This is easy to fix by calling `require 'pp'` in the top from the main Ractor - but I don't think it is expected for developers. We should optimize for developer's happiness and either make it just work or make it clear that everything should be required beforehand.
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:101749] [Ruby master Bug#17477] Ractor and pp incompatibility
2020-12-27 8:14 [ruby-core:101731] [Ruby master Bug#17477] Ractor and pp incompatibility shatrov
@ 2020-12-27 16:20 ` eregontp
2020-12-28 2:25 ` [ruby-core:101766] " duerst
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: eregontp @ 2020-12-27 16:20 UTC (permalink / raw)
To: ruby-core
Issue #17477 has been updated by Eregon (Benoit Daloze).
I doubt `require` can ever be supported in a Ractor, see #17420.
It seems there is no good solution for this, and besides this problem not only happens with `pp` but with any kind of "autoloaded" library/gem.
----------------------------------------
Bug #17477: Ractor and pp incompatibility
https://bugs.ruby-lang.org/issues/17477#change-89573
* Author: kirs (Kir Shatrov)
* Status: Open
* Priority: Normal
* ruby -v: 3.0.0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
```ruby
r = Ractor.new do
pp("foobar")
end
Ractor.select(r)
```
fails with:
```
#<Thread:0x00007f973414a050 run> terminated with exception (report_on_exception is true):
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:167:in `require'
from notractor.rb:8:in `block in <main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from notractor.rb:8:in `block in <main>'
<internal:ractor>:345:in `select': thrown by remote Ractor. (Ractor::RemoteError)
from notractor.rb:11:in `<main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:167:in `require'
from notractor.rb:8:in `block in <main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from notractor.rb:8:in `block in <main>'
```
This is easy to fix by calling `require 'pp'` in the top from the main Ractor - but I don't think it is expected for developers. We should optimize for developer's happiness and either make it just work or make it clear that everything should be required beforehand.
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:101766] [Ruby master Bug#17477] Ractor and pp incompatibility
2020-12-27 8:14 [ruby-core:101731] [Ruby master Bug#17477] Ractor and pp incompatibility shatrov
2020-12-27 16:20 ` [ruby-core:101749] " eregontp
@ 2020-12-28 2:25 ` duerst
2020-12-28 6:47 ` [ruby-core:101769] " marcandre-ruby-core
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: duerst @ 2020-12-28 2:25 UTC (permalink / raw)
To: ruby-core
Issue #17477 has been updated by duerst (Martin Dürst).
My preference would be to make `require` work everywhere, but always be executed in the main Reactor. That would just be part of the semantics of `require`.
----------------------------------------
Bug #17477: Ractor and pp incompatibility
https://bugs.ruby-lang.org/issues/17477#change-89593
* Author: kirs (Kir Shatrov)
* Status: Open
* Priority: Normal
* ruby -v: 3.0.0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
```ruby
r = Ractor.new do
pp("foobar")
end
Ractor.select(r)
```
fails with:
```
#<Thread:0x00007f973414a050 run> terminated with exception (report_on_exception is true):
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:167:in `require'
from notractor.rb:8:in `block in <main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from notractor.rb:8:in `block in <main>'
<internal:ractor>:345:in `select': thrown by remote Ractor. (Ractor::RemoteError)
from notractor.rb:11:in `<main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:167:in `require'
from notractor.rb:8:in `block in <main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from notractor.rb:8:in `block in <main>'
```
This is easy to fix by calling `require 'pp'` in the top from the main Ractor - but I don't think it is expected for developers. We should optimize for developer's happiness and either make it just work or make it clear that everything should be required beforehand.
--
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:101769] [Ruby master Bug#17477] Ractor and pp incompatibility
2020-12-27 8:14 [ruby-core:101731] [Ruby master Bug#17477] Ractor and pp incompatibility shatrov
2020-12-27 16:20 ` [ruby-core:101749] " eregontp
2020-12-28 2:25 ` [ruby-core:101766] " duerst
@ 2020-12-28 6:47 ` marcandre-ruby-core
2020-12-29 9:12 ` [ruby-core:101805] " shatrov
2021-01-05 1:41 ` [ruby-core:101921] " ko1
4 siblings, 0 replies; 6+ messages in thread
From: marcandre-ruby-core @ 2020-12-28 6:47 UTC (permalink / raw)
To: ruby-core
Issue #17477 has been updated by marcandre (Marc-Andre Lafortune).
I wrote a similar opinion to Martin Dürst's in #17420. I propose that we comment there (simply because the issue is older and more general)
----------------------------------------
Bug #17477: Ractor and pp incompatibility
https://bugs.ruby-lang.org/issues/17477#change-89597
* Author: kirs (Kir Shatrov)
* Status: Open
* Priority: Normal
* ruby -v: 3.0.0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
```ruby
r = Ractor.new do
pp("foobar")
end
Ractor.select(r)
```
fails with:
```
#<Thread:0x00007f973414a050 run> terminated with exception (report_on_exception is true):
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:167:in `require'
from notractor.rb:8:in `block in <main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from notractor.rb:8:in `block in <main>'
<internal:ractor>:345:in `select': thrown by remote Ractor. (Ractor::RemoteError)
from notractor.rb:11:in `<main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:167:in `require'
from notractor.rb:8:in `block in <main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from notractor.rb:8:in `block in <main>'
```
This is easy to fix by calling `require 'pp'` in the top from the main Ractor - but I don't think it is expected for developers. We should optimize for developer's happiness and either make it just work or make it clear that everything should be required beforehand.
--
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:101805] [Ruby master Bug#17477] Ractor and pp incompatibility
2020-12-27 8:14 [ruby-core:101731] [Ruby master Bug#17477] Ractor and pp incompatibility shatrov
` (2 preceding siblings ...)
2020-12-28 6:47 ` [ruby-core:101769] " marcandre-ruby-core
@ 2020-12-29 9:12 ` shatrov
2021-01-05 1:41 ` [ruby-core:101921] " ko1
4 siblings, 0 replies; 6+ messages in thread
From: shatrov @ 2020-12-29 9:12 UTC (permalink / raw)
To: ruby-core
Issue #17477 has been updated by kirs (Kir Shatrov).
marcandre (Marc-Andre Lafortune) wrote in #note-4:
> I wrote a similar opinion to Martin Dürst's in #17420. I propose that we comment there (simply because the issue is older and more general)
Thanks, I wasn't aware of #17420. Should I close this ticket?
----------------------------------------
Bug #17477: Ractor and pp incompatibility
https://bugs.ruby-lang.org/issues/17477#change-89632
* Author: kirs (Kir Shatrov)
* Status: Open
* Priority: Normal
* ruby -v: 3.0.0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
```ruby
r = Ractor.new do
pp("foobar")
end
Ractor.select(r)
```
fails with:
```
#<Thread:0x00007f973414a050 run> terminated with exception (report_on_exception is true):
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:167:in `require'
from notractor.rb:8:in `block in <main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from notractor.rb:8:in `block in <main>'
<internal:ractor>:345:in `select': thrown by remote Ractor. (Ractor::RemoteError)
from notractor.rb:11:in `<main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:167:in `require'
from notractor.rb:8:in `block in <main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from notractor.rb:8:in `block in <main>'
```
This is easy to fix by calling `require 'pp'` in the top from the main Ractor - but I don't think it is expected for developers. We should optimize for developer's happiness and either make it just work or make it clear that everything should be required beforehand.
--
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:101921] [Ruby master Bug#17477] Ractor and pp incompatibility
2020-12-27 8:14 [ruby-core:101731] [Ruby master Bug#17477] Ractor and pp incompatibility shatrov
` (3 preceding siblings ...)
2020-12-29 9:12 ` [ruby-core:101805] " shatrov
@ 2021-01-05 1:41 ` ko1
4 siblings, 0 replies; 6+ messages in thread
From: ko1 @ 2021-01-05 1:41 UTC (permalink / raw)
To: ruby-core
Issue #17477 has been updated by ko1 (Koichi Sasada).
Status changed from Open to Closed
continue to discuss on #17420.
----------------------------------------
Bug #17477: Ractor and pp incompatibility
https://bugs.ruby-lang.org/issues/17477#change-89767
* Author: kirs (Kir Shatrov)
* Status: Closed
* Priority: Normal
* ruby -v: 3.0.0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
```ruby
r = Ractor.new do
pp("foobar")
end
Ractor.select(r)
```
fails with:
```
#<Thread:0x00007f973414a050 run> terminated with exception (report_on_exception is true):
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:167:in `require'
from notractor.rb:8:in `block in <main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from notractor.rb:8:in `block in <main>'
<internal:ractor>:345:in `select': thrown by remote Ractor. (Ractor::RemoteError)
from notractor.rb:11:in `<main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:167:in `require'
from notractor.rb:8:in `block in <main>'
<internal:/opt/rubies/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from notractor.rb:8:in `block in <main>'
```
This is easy to fix by calling `require 'pp'` in the top from the main Ractor - but I don't think it is expected for developers. We should optimize for developer's happiness and either make it just work or make it clear that everything should be required beforehand.
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-01-05 1:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-27 8:14 [ruby-core:101731] [Ruby master Bug#17477] Ractor and pp incompatibility shatrov
2020-12-27 16:20 ` [ruby-core:101749] " eregontp
2020-12-28 2:25 ` [ruby-core:101766] " duerst
2020-12-28 6:47 ` [ruby-core:101769] " marcandre-ruby-core
2020-12-29 9:12 ` [ruby-core:101805] " shatrov
2021-01-05 1:41 ` [ruby-core:101921] " ko1
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).