Skip to content

Conversation

@ivoanjo
Copy link
Member

@ivoanjo ivoanjo commented Nov 25, 2025

What does this PR do?

This PR disables the heap profiling feature when running on Ruby 4 as right now it can trigger the crash reported in
https://bugs.ruby-lang.org/issues/21710 .

Motivation:

Until either https://bugs.ruby-lang.org/issues/21710 gets fixed or we change the heap profiler to use the new
rb_gc_mark_weak API it's not safe to enable the heap profiling feature on Ruby 4.

Change log entry

Yes. Disable heap profiling on Ruby 4 preview due to incompatibility

Additional Notes:

I'm preparing a PR with other, smaller fixes for the profiler Ruby 4 support, but I decided to split this one by itself so we could have a separate, clear, changelog entry about this change, as well as a single PR to discuss this subject.

How to test the change?

We don't yet have Ruby 4 in CI, so this can only be tested locally or by mocking the RUBY_VERSION.

…ibility

**What does this PR do?**

This PR disables the heap profiling feature when running on Ruby 4 as
right now it can trigger the crash reported in
https://bugs.ruby-lang.org/issues/21710 .

**Motivation:**

Until either https://bugs.ruby-lang.org/issues/21710 gets fixed or
we change the heap profiler to use the new
[`rb_gc_mark_weak` API](https://bugs.ruby-lang.org/issues/19783)
it's not safe to enable the heap profiling feature on Ruby 4.

**Additional Notes:**

I'm preparing a PR with other, smaller fixes for the profiler
Ruby 4 support, but I decided to split this one by itself so we
could have a separate, clear, changelog entry about this change,
as well as a single PR to discuss this subject.

**How to test the change?**

We don't yet have Ruby 4 in CI, so this can only be tested locally or
by mocking the `RUBY_VERSION`.
@ivoanjo ivoanjo requested review from a team as code owners November 25, 2025 11:19
@github-actions github-actions bot added the profiling Involves Datadog profiling label Nov 25, 2025
@datadog-official
Copy link

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 90.91%
Total Coverage: 95.17% (-0.00%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 662eed8 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

Copy link
Member

@lloeki lloeki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ivoanjo ivoanjo merged commit c823ca8 into master Nov 25, 2025
545 checks passed
@ivoanjo ivoanjo deleted the ivoanjo/prof-13115-disable-heap-profiling-ruby-4-preview branch November 25, 2025 13:30
@github-actions github-actions bot added this to the 2.23.0 milestone Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

profiling Involves Datadog profiling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants