Skip to content

[BUG]: Datadog Profiler fails to start on Ruby 4.0.6 with "TypeError: wrong argument 0 for 'string' (expected a RUBY_T_STRING) at datadog_ruby_common.h:63:in `char_slice_from_ruby_string'" #6045

Description

@ivoanjo

Update: datadog-ruby_core_source 3.5.3 is out with the fix. Bumping that dependency version fixes the issue.


We've spotted that the Datadog Ruby profiler fails to start with Ruby 4.0.6 with an error such as

W, [2026-07-15T08:55:20.244469 #57892] WARN -- datadog: [datadog] CpuAndWallTimeWorker thread error. Operation: "rescued_sample_from_postponed_job" Cause: TypeError: wrong argument 0 for 'string' (expected a RUBY_T_STRING) at datadog_ruby_common.h:63:in `char_slice_from_ruby_string' Location:
W, [2026-07-15T08:55:20.244551 #57892] WARN -- datadog: [datadog] Detected issue with profiler (worker component), stopping profiling. See previous log messages for details.
W, [2026-07-15T08:55:21.233667 #57892] WARN -- datadog: [datadog] IdleSamplingHelper thread error. Cause: TypeError: wrong argument 0 for 'string' (expected a RUBY_T_STRING) at datadog_ruby_common.h:63:in `char_slice_from_ruby_string' Location: .rvm/gems/ruby-4.0.6/gems/datadog-2.37.0/lib/datadog/profiling/collectors/idle_sampling_helper.rb:42:in 'Datadog::Profiling::Collectors::IdleSamplingHelper._native_idle_sampling_loop'

This is due a small change in the Ruby 4.0.6 internal structures that needs a matching update from our side.

Metadata

Metadata

Assignees

Labels

bugInvolves a bugprofilingInvolves Datadog profiling

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions