Skip to content

C++ unit tests for reference-chain tracking - #799

Draft
jbachorik wants to merge 1 commit into
jb/rc-4-profiler-wiringfrom
jb/rc-5-gtest
Draft

jbachorik wants to merge 1 commit into
jb/rc-4-profiler-wiringfrom
jb/rc-5-gtest

Conversation

@jbachorik

@jbachorik jbachorik commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?:
Adds the C++ unit tests for reference chains (622 cases): frontier-table behavior, BFS expansion and cursor advancement, chain resolution/improvement (including the cycle guard), leak-candidate selection and the heap-floor OOM projection, referencechains arguments parsing, stale-leaf handling, and JFR round-tripping of chain events. Also extends the existing liveness-tracker and line-number-table tests.

Motivation:
Test layer for PROF-15341, stacked on the engine it verifies.

Additional Notes:
Stacked on #798. All gtest binaries pass (2 skipped by design).

How to test the change?:
./gradlew :ddprof-lib:gtestDebug — the tests in this PR are exactly the ones it adds/extends.

For Datadog employees:

  • This PR doesn't touch any of that.
  • JIRA: PROF-15341

@dd-octo-sts

dd-octo-sts Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Scan-Build Report

User:runner@runnervmlun5p
Working Directory:/home/runner/work/java-profiler/java-profiler/ddprof-lib/src/test/make
Command Line:make -j4 all
Clang Version:Ubuntu clang version 18.1.3 (1ubuntu1)
Date:Thu Sep 17 20:07:36 2026

Bug Summary

Bug TypeQuantityDisplay?
All Bugs4
C++ move semantics
Use-after-move1
Logic error
Dereference of null pointer1
Result of operation is garbage or undefined1
Unused code
Dead increment1

Reports

Bug Group Bug Type ▾ File Function/Method Line Path Length
Unused codeDead incrementreferenceChains.cppcollectStaticFieldAnchorsForRotation36771
Logic errorDereference of null pointerfaultInjection.cppcrashNow242
Logic errorResult of operation is garbage or undefinedlivenessTracker.cppsecondsToOOM138324
C++ move semanticsUse-after-movereferenceChains.cppbuildCanaryChainEvent608368

@datadog-datadog-prod-us1

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #35270221640 | Commit: 0fa7bb5 | Duration: 16m 24s (longest job)

All 32 test jobs passed

Status Overview

JDK glibc-aarch64/debug glibc-amd64/debug musl-aarch64/debug musl-amd64/debug
8 - - -
8-ibm - - -
8-j9 - -
8-librca - -
8-orcl - - -
11 - - -
11-j9 - -
11-librca - -
17 - -
17-graal - -
17-j9 - -
17-librca - -
21 - -
21-graal - -
21-librca - -
25 - -
25-graal - -
25-librca - -

Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled

Summary: Total: 32 | Passed: 32 | Failed: 0


Updated: 2026-09-17 22:23:36 UTC

@dd-octo-sts

dd-octo-sts Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

All 40 integration tests passed

📊 Dashboard · 👷 Pipeline · 📦 0573cdad

staleLeaf handling and the line-number-table copy boundary tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant