Skip to content

Conversation

andrepiske
Copy link
Contributor

@andrepiske andrepiske commented Apr 26, 2025

Description

This provides a fix for #1134

Beginning with ruby 3.4, not all cases match the BLOCK_LABL_REGEXP regex (/\Ablock( \(\d+ levels\))* in (.+)\z/) anymore. This pull request fixes for cases when location.label (Thread::Backtrace::Location#label, implemented in ruby's vm_backtrace.c source file; see here) returns e.g. the string "Kernel#loop", which won't match the regex and crahes the app.

The change seems to have been introduced in Ruby here: ruby/ruby@61819c8#diff-cf27dccd423ca45138f1278ea6ce04558360203e869cc1fb1608047c606f29d0R195-R202 so I think it makes sense to handle those cases from now on.

See my comment in the original issue #1134 (comment) for a snippet that breaks. Without the fix, it would crash. With the fix, it shows up like this:

shot_g4GN0aDc

Since ruby 3.4, not all cases match BLOCK_LABL_REGEXP anymore
This fixes for those cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants