General

Profile

jhawthorn (John Hawthorn)

  • Login: jhawthorn
  • Registered on: 12/22/2016
  • Last sign in: 08/06/2026

Issues

open closed Total
Assigned issues 27 71 98
Reported issues 6 30 36

Projects

Project Roles Registered on
Ruby Committer 11/25/2021

Activity

08/06/2026

07:29 PM Ruby Bug #22200: ObjectSpace._id2ref can return a different object than the id's owner on Ruby 4.0 (stale id2ref_tbl entry for objects with generic fields)
My example is just one way to crash the VM with `_id2ref`, I'm sure there are others.
Eregon (Benoit Daloze) wrote in #note-7:
> And we have in practice unique `object_id`s, so there is no collision in practice.
In practice, yes, ...
jhawthorn (John Hawthorn)
07:55 AM Ruby Bug #22200: ObjectSpace._id2ref can return a different object than the id's owner on Ruby 4.0 (stale id2ref_tbl entry for objects with generic fields)
navidemad (Navid Emad) wrote:
> On Ruby 4.0.x, `ObjectSpace._id2ref(id)` can return a **different, unrelated live object** instead of raising `RangeError`, after the object that owned the id has been garbage collected and its heap slot r...
jhawthorn (John Hawthorn)

08/05/2026

12:45 AM Ruby Misc #22221: DevMeeting-2026-08-06
* [Bug #22216] Special variables (ex. Regexp backref and IO lastline) are thread-unsafe in some cases, incompatible with Ractor
* Are we okay making this either thread-local or fiber-local? It's already Fiber-local at the top-level (o...
jhawthorn (John Hawthorn)
12:43 AM Ruby Bug #22216: Special variables (ex. Regexp backref and IO lastline) are thread-unsafe in some cases, incompatible with Ractor
Here's an example I think folks would expect to be thread safe, but fails on current CRuby after just a few iterations (thanks to the Thread.pass)
``` ruby
def test_it
proc { |str|
str =~ /(.)(.)(.)/
Thread.pass # Commen...
jhawthorn (John Hawthorn)
12:37 AM Ruby Bug #22216: Special variables (ex. Regexp backref and IO lastline) are thread-unsafe in some cases, incompatible with Ractor
Just a note on the Ractor-incompatibility, I think that's actually a much smaller problem. We should only hit that via `Ractor.shareable_proc`, which is a point we can set svar as we want (or is a flag we could check for). We could fix t... jhawthorn (John Hawthorn)
12:30 AM Ruby Bug #22216: Special variables (ex. Regexp backref and IO lastline) are thread-unsafe in some cases, incompatible with Ractor
I've started prototyping this in https://github.com/ruby/ruby/pull/18200 (needs testing and benchmarking still) jhawthorn (John Hawthorn)
12:16 AM Ruby Bug #22216: Special variables (ex. Regexp backref and IO lastline) are thread-unsafe in some cases, incompatible with Ractor
I think I'm _somewhat_ sold on it being Fiber-local. There may be some incompatibilities, but the existing behaviour is already strange.
Here's the first case I was worried about. If you get an Enumerator with lazy or an iterating metho...
jhawthorn (John Hawthorn)

08/01/2026

07:32 AM Ruby Revision 12c1ddef (git): [ruby/stringio] Fix thread safety of strio_free
(https://github.com/ruby/stringio/pull/223)
Follow up to #222
This refcount previously wasn't thread safe (and shouldn't have been
declared `RUBY_TYPED_THREAD_SAFE_FREE`), but it's easy enough to fix
using ruby/atomic.h (Ruby 3.0+)
ht...
jhawthorn (John Hawthorn)

07/31/2026

12:13 AM Ruby Bug #22216: Special variables (ex. Regexp backref and IO lastline) are thread-unsafe in some cases, incompatible with Ractor
I've wanted to fix this for a while. We should do what TruffleRuby does and others have described. Of the options ko1 proposed, I think with both these tables need to hold weak references (making them essentially the same thing) otherwis... jhawthorn (John Hawthorn)

07/28/2026

05:47 PM Ruby Revision 3ab7644a (git): Add writebarrier for Array#reverse
jhawthorn (John Hawthorn)

Also available in: Atom