General

Profile

luke-gru (Luke Gruber)

  • Login: luke-gru
  • Email: luke.gru@gmail.com
  • Registered on: 08/19/2011
  • Last sign in: 05/29/2026

Issues

open closed Total
Assigned issues 2 22 24
Reported issues 14 52 66

Projects

Project Roles Registered on
Ruby Committer 06/19/2025

Activity

06/09/2026

09:37 PM Ruby Bug #22098: THREAD_EVENT_RESUMED runs without GVL held
It really depends on what "holding the GVL" means. Right now, `ruby_thread_has_gvl_p()` can return `false` in hooks for this event. This is what can cause a deadlock.
The stack trace for the deadlock looks like this:
```
frame #3: ...
luke-gru (Luke Gruber)
09:23 PM Ruby Bug #22098 (Open): THREAD_EVENT_RESUMED runs without GVL held
Today, it's possible to get a deadlock when allocating during a hook for this event. I attached a reproduction script using the `gvltools` gem. One way to fix it would be to not allocate during this hook and change the documentation to b... luke-gru (Luke Gruber)
04:55 PM Ruby Bug #22096: Freeing a mutex locked by a fiber inside fiber scheduler can crash
mame (Yusuke Endoh) wrote in #note-3:
> Is it difficult to write a regression test for this?
I have [another PR](https://github.com/ruby/ruby/pull/17208/) for a similar issue that has 2 regressions tests. Those tests also cover this bug...
luke-gru (Luke Gruber)

06/08/2026

06:23 PM Ruby Bug #22096 (Closed): Freeing a mutex locked by a fiber inside fiber scheduler can crash
While freeing a locked mutex, if there is a waiter for the mutex it could call `rb_fiber_scheduler_unblock` which calls into Ruby code.
The function `rb_mutex_unlock_th` was a footgun because it was used during normal Ruby code and al...
luke-gru (Luke Gruber)

05/13/2026

06:28 PM Ruby Feature #22067: New RUBY_TYPED_THREAD_SAFE_FREE bit to declare thread safe dfree functions
Thank you for your input Peter and Kunshan, I greatly appreciate it. As you may know, I am no GC expert :)
### Parallel marking
For parallel marking, I agree that the vast majority of all TypedData mark functions are thread-safe. I was...
luke-gru (Luke Gruber)

05/12/2026

07:55 PM Ruby Feature #22067: New RUBY_TYPED_THREAD_SAFE_FREE bit to declare thread safe dfree functions
Our current implementation of parallel sweeping has the sweep thread run both concurrently with the mutator and in parallel with the Ruby GC thread. I would prefer a bit that represents the safety in both situations. For MMTk, since it d... luke-gru (Luke Gruber)
03:08 PM Ruby Feature #22067 (Open): New RUBY_TYPED_THREAD_SAFE_FREE bit to declare thread safe dfree functions
CRuby `TypedData` types are used internally in the VM and in C extensions. Currently any `dfree` functions, which usually are declared `RUBY_TYPED_FREE_IMMEDIATELY`, are run with the VM lock held and a VM barrier stopping all ractors and... luke-gru (Luke Gruber)

04/29/2026

05:16 PM Ruby Bug #22016: ruby segfaults regularly
Can you please provide the output of `lscpu` and/or `uname -a` along with the version of `gcc`? What happens when you install this exact Ruby version without pkgsrc, like from git or a tarball? Thanks. luke-gru (Luke Gruber)

04/17/2026

05:50 PM Ruby Bug #21993: `rb_gc_update_tbl_refs` is incorrectly documented as the dcompact pair for `rb_mark_tbl_no_pin`, and is unsafe for `st_table`s with non-VALUE keys
Oh yeah, thanks. There's even a helpful comment for it. I think changing `rb_gc_update_tbl_refs` to only move values probably makes sense. We could add something like `rb_mark_hash_nopin_values` where it marks values for moving but pins ... luke-gru (Luke Gruber)

04/16/2026

11:03 PM Ruby Bug #21993: `rb_gc_update_tbl_refs` is incorrectly documented as the dcompact pair for `rb_mark_tbl_no_pin`, and is unsafe for `st_table`s with non-VALUE keys
Looking into this further, it looks like `gc_update_table_refs` is only used once internally, with the finalizer_table. It looks to me like it's used wrong there because the key (finalized object) is not pinned so can be moved, but the s... luke-gru (Luke Gruber)

Also available in: Atom