General

Profile

jhawthorn (John Hawthorn)

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

Issues

open closed Total
Assigned issues 26 72 98
Reported issues 6 30 36

Projects

Project Roles Registered on
Ruby Committer 11/25/2021

Activity

08/06/2026

09:48 PM Ruby Revision 089f0bbe (git): Revert "Fix ObjectSpace._id2ref returning wrong object for generic-field type…"
This reverts commit 966f531e2b2e896f8f36beb8b933407d2df3e208. jhawthorn (John Hawthorn)
09:48 PM Ruby Revision e59509d8 (git): Add test for _id2ref on geniv
jhawthorn (John Hawthorn)
09:48 PM Ruby Revision 2bf7ecb7 (git): Disable warnings in test
jhawthorn (John Hawthorn)
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)

Also available in: Atom