-
Notifications
You must be signed in to change notification settings - Fork 375
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
[PROF-10967] Fix profiler not loading due to "rb_obj_info" symbol not found #4161
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… found **What does this PR do?** This PR fixes a bug introduced in #4020, specifically in f581076 . We started using the `rb_obj_info` to print debug information about objects in some cases, BUT I failed to notice that this API is not really available on Ruby 2.5 and 3.3 (but is on all others, which is why it tripped me). This manifested in the following error reported by a customer: > WARN -- datadog: [datadog] Profiling was requested but is not > supported, profiling disabled: There was an error loading the > profiling native extension due to 'RuntimeError Failure to load > datadog_profiling_native_extension.3.3.5_x86_64-linux-musl due > to Error relocating > /app/vendor/bundle/ruby/3.3.0/gems/datadog-2.6.0/lib/datadog/profiling/../../datadog_profiling_native_extension.3.3.5_x86_64-linux-musl.so: > rb_obj_info: symbol not found' at > '/app/vendor/bundle/ruby/3.3.0/gems/datadog-2.6.0/lib/datadog/profiling/load_native_extension.rb:41:in `<main>'' This PR fixes this issue by never referencing `rb_obj_info` on those Rubies. Since this API is only used for printing information during errors, this should be fine (and is better than the alternative of not printing info on any Rubies). **Motivation:** Fix profiling not loading in certain situations on Ruby 2.5 and 3.3. **Additional Notes:** Interestingly, this issue did not show up on glibc systems. I guess musl libc is being a bit more eager about trying to resolve symbols? **How to test the change?** This change includes test coverage. Disabling the added check in `extconf.rb` will produce a failing test.
Strech
approved these changes
Nov 26, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👏🏼
The `rb_obj_info` got re-exposed later in the 3.4 development cycle, so our test that was still running with 3.4.0-preview1 was failing because it still had not been changed.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4161 +/- ##
==========================================
+ Coverage 97.77% 97.78% +0.01%
==========================================
Files 1353 1353
Lines 81785 81796 +11
Branches 4141 4143 +2
==========================================
+ Hits 79963 79983 +20
+ Misses 1822 1813 -9 ☔ View full report in Codecov by Sentry. |
TonyCTHsu
pushed a commit
that referenced
this pull request
Nov 28, 2024
…nfo-usage [PROF-10967] Fix profiler not loading due to "rb_obj_info" symbol not found
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR fixes a bug introduced in #4020, specifically in f581076 .
We started using the
rb_obj_info
to print debug information about objects in some cases, BUT I failed to notice that this API is not really available on Ruby 2.5 and 3.3 (but is on all others, which is why it tripped me).This manifested in the following error reported by a customer:
WARN -- datadog: [datadog] Profiling was requested but is not supported, profiling disabled: There was an error loading the profiling native extension due to 'RuntimeError Failure to load datadog_profiling_native_extension.3.3.5_x86_64-linux-musl due to Error relocating /app/vendor/bundle/ruby/3.3.0/gems/datadog-2.6.0/lib/datadog/profiling/../../datadog_profiling_native_extension.3.3.5_x86_64-linux-musl.so: rb_obj_info: symbol not found' at '/app/vendor/bundle/ruby/3.3.0/gems/datadog-2.6.0/lib/datadog/profiling/load_native_extension.rb:41:in `<main>''
This PR fixes this issue by never referencing
rb_obj_info
on those Rubies. Since this API is only used for printing information during errors, this should be fine (and is better than the alternative of not printing info on any Rubies).Motivation:
Fix profiling not loading in certain situations on Ruby 2.5 and 3.3.
Change log entry
Fix profiling not loading in certain situations on Ruby 2.5 and 3.3
Additional Notes:
Interestingly, this issue did not show up on glibc systems. I guess musl libc is being a bit more eager about trying to resolve symbols?
How to test the change?
This change includes test coverage. Disabling the added check in
extconf.rb
will produce a failing test.