Skip to content
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

fix: Incorrect string comparison in the profiler caused constructor instrumentation to fail on Linux #2912

Merged
merged 6 commits into from
Dec 5, 2024

Conversation

tippmar-nr
Copy link
Member

@tippmar-nr tippmar-nr commented Dec 4, 2024

Thank you for submitting a pull request. Please review our contributing guidelines and code of conduct.

Description

The profiler is supposed to allow instrumentation of constructors, but we found that the string comparison operator being used didn't work correctly under Linux. This PR changes the comparison to use a cross-platform version of wcscmp() instead.

Fixes #2918

Author Checklist

  • Unit tests, Integration tests, and Unbounded tests completed
  • Performance testing completed with satisfactory results (if required)

Reviewer Checklist

  • Perform code review
  • Pull request was adequately tested (new/existing tests, performance tests)

@tippmar-nr tippmar-nr requested a review from a team as a code owner December 4, 2024 17:48
nr-ahemsath
nr-ahemsath previously approved these changes Dec 4, 2024
chore: Update Profiler NuGet Package Reference to v10.34.0.10.

Co-authored-by: tippmar-nr <120425148+tippmar-nr@users.noreply.github.com>
nrcventura
nrcventura previously approved these changes Dec 4, 2024
@tippmar-nr tippmar-nr enabled auto-merge (squash) December 4, 2024 19:26
chore: Update Profiler NuGet Package Reference to v10.34.0.14.

Co-authored-by: tippmar-nr <120425148+tippmar-nr@users.noreply.github.com>
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.41%. Comparing base (56c8165) to head (4163fec).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2912      +/-   ##
==========================================
- Coverage   81.42%   81.41%   -0.01%     
==========================================
  Files         465      465              
  Lines       29563    29563              
  Branches     3278     3278              
==========================================
- Hits        24071    24069       -2     
- Misses       4698     4699       +1     
- Partials      794      795       +1     
Flag Coverage Δ
Agent 82.34% <ø> (-0.01%) ⬇️
Profiler 73.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...t/NewRelic/Profiler/MethodRewriter/Instrumentors.h 47.05% <ø> (ø)

... and 2 files with indirect coverage changes

@tippmar-nr tippmar-nr changed the title fix: Use correct string comparison in Linux profiler when checking for constructor name fix: Incorrect string comparison caused constructor instrumentation to fail on Linux Dec 5, 2024
@tippmar-nr tippmar-nr disabled auto-merge December 5, 2024 16:42
@tippmar-nr tippmar-nr enabled auto-merge (squash) December 5, 2024 16:43
@tippmar-nr tippmar-nr changed the title fix: Incorrect string comparison caused constructor instrumentation to fail on Linux fix: Incorrect string comparison in the profiler caused constructor instrumentation to fail on Linux Dec 5, 2024
@tippmar-nr tippmar-nr merged commit 49a71c5 into main Dec 5, 2024
95 checks passed
@tippmar-nr tippmar-nr deleted the fix/profiler-ctor-name-check branch December 5, 2024 21:26
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.

Constructor instrumentation doesn't work on Linux
5 participants