diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2025-04-22 18:55:55 +0900 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2025-04-22 23:23:35 +0200 |
| commit | 7c30bd50df8617063c99630112e1015ec5a743c3 (patch) | |
| tree | 82d6ee74826dd9ef50e8801b5d49045ba926d70b /include/ruby/internal/encoding/coderange.h | |
| parent | 9fc5a5dbedf70d6026ff8b76a57297b8021c5dcd (diff) | |
Add missing lock in `rb_gc_impl_define_finalizer`
`objspace->finalizer_table` must be synchronized,
otherwise concurrent insertion from multiple ractors
will cause a crash.
Repro:
```ruby
ractors = 5.times.map do |i|
Ractor.new do
100_000.times.map do
o = Object.new
ObjectSpace.define_finalizer(o, ->(id) {})
o
end
end
end
ractors.each(&:take)
```
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13151
Diffstat (limited to 'include/ruby/internal/encoding/coderange.h')
0 files changed, 0 insertions, 0 deletions
