Skip to content

Fix nightly asan builds - #212

Merged
jbachorik merged 8 commits into
mainfrom
jb/nightly_fixes
May 20, 2025
Merged

jbachorik merged 8 commits into
mainfrom
jb/nightly_fixes

Conversation

@jbachorik

@jbachorik jbachorik commented May 19, 2025 •

Copy link
Copy Markdown
Collaborator

What does this PR do?:
The PR addresses a handful of issues causing our nightly sanitizer runs to fail

Motivation:
Well, we want to have the CI green such that we can capture any new error :)

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.
  • JIRA: PROF-11808

Unsure? Have a question? Request a review!

@jbachorik
jbachorik requested a review from r1viollet May 19, 2025 11:43
@github-actions

github-actions Bot commented May 19, 2025 •

Copy link
Copy Markdown
Contributor

🔧 Report generated by pr-comment-cppcheck

CppCheck Report

Errors (2)

Warnings (4)

Style Violations (295)

@github-actions

github-actions Bot commented May 19, 2025 •

Copy link
Copy Markdown
Contributor

🔧 Report generated by pr-comment-scanbuild

@jbachorik
jbachorik requested a review from MattAlp May 19, 2025 15:39
Comment thread ddprof-lib/build.gradle
def content = file.getText('UTF-8')
def original = content

// Add no_sanitize to unwindStub

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.

why not add compiler directives ? because this is upstream I assume

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yep. It's upstream.
I am not thrilled by this but the find-replace turned out to be the least intrusive measure - I will try proposing to add the directive upstream. Ideally, we should not be patching the upstream code.

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.

Good idea! tell me if this can not make it upstream. we can revisit how we include these changes (wrapper around the header on Datadog side)?

compilerArgs.add('-D__musl__')
}
compilerArgs.add('-std=c++14')
compilerArgs.add('-std=c++17')

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.

nice

// snappy is problematic on musl; we are not running it
assertTrue(isMusl || libraryCounters.containsKey("SNAPPY"), "no snappy-java samples");
// for some reason it is not also appearing in sanitized runs
assertTrue(isMusl || isSanitizer || libraryCounters.containsKey("SNAPPY"), "no snappy-java samples");

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.

That's a curious discovery

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yep. The assertion was failing reliably on sanitized runs :/

@Test
public void test() throws Throwable {
assumeFalse(Platform.isJ9() && Platform.isJavaVersion(17)); // JVMTI::GetClassSignature() is reliably crashing on a valid 'class' instance ¯\_(ツ)_/¯
assumeFalse(Platform.isJ9() && isAsan()); // running this test on j9 and asan is weirdly crashy

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.

Is this the same crashing as the j9jit issue discussed this morning? Ideally, we could use ASan for J9 as well.

@jbachorik jbachorik May 20, 2025 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, this might have something to do with J9 mishandling jmethodids or something similar. I could not get the stacktrace for what was happening, as the attempt to get stacktrace in asan also crashed :/
The other issue is about crash when parsing a j9 library elf file.

Comment thread ddprof-lib/build.gradle Resolved
@jbachorik
jbachorik merged commit 718678a into main May 20, 2025
@jbachorik
jbachorik deleted the jb/nightly_fixes branch May 20, 2025 06:43
@github-actions github-actions Bot added this to the 1.26.0 milestone May 20, 2025
@zhengyu123 zhengyu123 added the fixed_version: v_1.26.0 Version this PR's fix shipped in label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixed_version: v_1.26.0 Version this PR's fix shipped in

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants