diff options
| author | Luke Gruber <luke.gruber@shopify.com> | 2025-06-25 12:44:40 -0400 |
|---|---|---|
| committer | John Hawthorn <john@hawthorn.email> | 2025-07-03 13:33:10 -0700 |
| commit | cf4d37fbc079116453e69cf08ea8007d0e1c73e6 (patch) | |
| tree | 9e4420d55fcf76d73ede8c3e199d1a990bc7f575 /spec/ruby | |
| parent | 4f4408e98933f65f9d5b1752c2892218f2224de3 (diff) | |
Add locks around accesses/modifications to global encodings table
This fixes segfaults and errors of the type "Encoding not found" when
using encoding-related methods and internal encoding c functions across
ractors.
Example of a possible segfault in release mode or assertion error in debug mode:
```ruby
rs = []
100.times do
rs << Ractor.new do
"abc".force_encoding(Encoding.list.shuffle.first)
end
end
while rs.any?
r, obj = Ractor.select(*rs)
rs.delete(r)
end
```
Diffstat (limited to 'spec/ruby')
0 files changed, 0 insertions, 0 deletions
