Skip to content

Fix FrameInfo#block_identifier #1137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrepiske
Copy link

@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.

1 participant