[#109207] [Ruby master Feature#18915] New error class: NotImplementedYetError or scope change for NotImplementedYet — Quintasan <noreply@...>
Issue #18915 has been reported by Quintasan (Michał Zając).
18 messages
2022/07/14
[ruby-core:109162] [Ruby master Bug#18902] Thread#value crash if the thread was killed because of a fork
From:
"byroot (Jean Boussier)" <noreply@...>
Date:
2022-07-07 14:22:13 UTC
List:
ruby-core #109162
Issue #18902 has been reported by byroot (Jean Boussier).
----------------------------------------
Bug #18902: Thread#value crash if the thread was killed because of a fork
https://bugs.ruby-lang.org/issues/18902
* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.2.0dev, ruby 3.1.2p20, ruby 3.0.3p157, ruby 2.7.5p203
* Backport: 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED
----------------------------------------
Reproduction script
```ruby
thr = Thread.new { sleep 10}
fork do
p thr.status # =>false
p thr.join # => #<Thread:0x00000001008ae480 /tmp/thread-join.rb:1 dead>
p thr.value # Assertion Failed: ./vm_core.h:1303:VM_ENV_FLAGS:FIXNUM_P(flags) (or crash if RUBY_DEBUG isn't set)
end
```
What happens is that `rb_thread_t->value` is initialized to `Qundef`, so when the thread is killed by a fork, `Thread#value` tries to return `Qundef` which laters crash the VM.
I have a patch incomming.
--
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>