Skip to content

fix async-sample mutex#107

Merged
richardstartin merged 1 commit into
mainfrom
rgs/async-sample-mutex-interleaved-test
Jun 12, 2024
Merged

fix async-sample mutex#107
richardstartin merged 1 commit into
mainfrom
rgs/async-sample-mutex-interleaved-test

Conversation

@richardstartin

Copy link
Copy Markdown
Contributor

What does this PR do?:
Fixes a bug ensuring we don't re-enter AsyncGetCallTrace

Motivation:

Additional Notes:

How to test the change?:

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Unsure? Have a question? Request a review!

@github-actions

Copy link
Copy Markdown
Contributor

🔧 Report generated by pr-comment-scanbuild

Scan-Build Report

User:runner@fv-az1501-79
Working Directory:/home/runner/work/java-profiler/java-profiler/ddprof-lib/src/test/make
Command Line:make -j4 clean all
Clang Version:Ubuntu clang version 14.0.0-1ubuntu1.1
Date:Wed Jun 12 13:35:19 2024

Bug Summary

Bug TypeQuantityDisplay?
All Bugs6
Logic error
Assigned value is garbage or undefined1
Dereference of null pointer2
Result of operation is garbage or undefined1
Unused code
Dead initialization1
Dead nested assignment1

Reports

Bug Group Bug Type ▾ File Function/Method Line Path Length
Logic errorAssigned value is garbage or undefineddwarf.cppparseInstructions23520
Unused codeDead initializationlivenessTracker.cppcleanup_table451
Unused codeDead nested assignmentvmStructs.cppcheckNativeBinding8181
Logic errorDereference of null pointerflightRecorder.cppflush14078
Logic errorDereference of null pointersafeAccess.hload3518
Logic errorResult of operation is garbage or undefineddwarf.hgetSLeb14225

@github-actions

Copy link
Copy Markdown
Contributor

🔧 Report generated by pr-comment-cppcheck

CppCheck Report

Warnings (5)

Style Violations (160)

@richardstartin
richardstartin merged commit fe9f51f into main Jun 12, 2024
@github-actions github-actions Bot added this to the 1.8.0 milestone Jun 12, 2024
_acquired = try_acquire();
}

AsyncSampleMutex(AsyncSampleMutex& other) = delete;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NIT: if we delete this one, we can adjust the other constructors (rule of 5) to ensure we can not copy/move or use = operators.

{
// Async events
AsyncSampleMutex mutex;
AsyncSampleMutex mutex(ProfiledThread::current());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Injecting the dependency is a good idea!

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.

3 participants