Skip to content

fix(build): link vmStructs inline definitions in assertion-enabled builds#641

Merged
rkennke merged 1 commit into
mainfrom
rkennke/fix-aarch64-gtest-crashprotection-link
Jul 8, 2026
Merged

fix(build): link vmStructs inline definitions in assertion-enabled builds#641
rkennke merged 1 commit into
mainfrom
rkennke/fix-aarch64-gtest-crashprotection-link

Conversation

@rkennke

@rkennke rkennke commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Problem

crashProtectionActive() and cast_to() are declared inline in vmStructs.h — where the VMNMethod / cast accessors odr-use them inside assert(...) — but they are defined only in vmStructs.inline.h. A translation unit that includes the light vmStructs.h without the .inline.h counterpart therefore odr-uses those inline functions with no visible definition.

  • In NDEBUG builds the asserts compile out, so the main release .so links fine.
  • The gtest targets keep assertions on, so crashProtectionActive() is left unresolved at link time.

It surfaces first on hotspotStackFrame_aarch64.o (on x86_64 the reference is optimized away, so CI stayed green), which breaks every aarch64 gtest link — e.g.:

Undefined symbols for architecture arm64:
  "crashProtectionActive()", referenced from:
      VM::initProfilerBridge(...) in vmEntry.o
      HotspotStackFrame::unwindCompiled(...) in hotspotStackFrame_aarch64.o
      ...
ld: symbol(s) not found for architecture arm64

This is independent of any feature work — it reproduces on a clean main.

Fix

Include vmStructs.inline.h in the TUs that odr-use the accessors (hotspotStackFrame_aarch64.cpp, hotspotStackFrame_x64.cpp, vmEntry.cpp), matching the codebase's existing .h / .inline.h split. vmEntry.cpp's now-redundant direct vmStructs.h include is dropped since .inline.h pulls it in.

Verification

./gradlew :ddprof-lib:buildGtestRelease now links (previously failed on arm64); confirmed on macOS/aarch64.

🤖 Generated with Claude Code

…ilds

crashProtectionActive() and cast_to() are declared inline in vmStructs.h
(where the VMNMethod / cast accessors odr-use them inside assert(...)) but
defined only in vmStructs.inline.h. TUs that include the light vmStructs.h
without the .inline.h counterpart therefore odr-use those inline functions
with no visible definition. In NDEBUG builds the asserts compile out, so the
main release .so links; but the gtest targets keep assertions on, leaving
crashProtectionActive() unresolved at link time. It surfaced first on
hotspotStackFrame_aarch64.o (x86_64 optimizes the reference away, so CI stayed
green), breaking every aarch64 gtest link.

Include vmStructs.inline.h in the TUs that odr-use the accessors
(hotspotStackFrame_{aarch64,x64}.cpp, vmEntry.cpp), matching the codebase's
.h / .inline.h split. vmEntry.cpp's redundant direct vmStructs.h include is
dropped since the .inline.h pulls it in.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rkennke
rkennke requested a review from a team as a code owner July 8, 2026 09:34

@jbachorik jbachorik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

I wonder if we should run asan/tsun regularly for each PR ...

@rkennke

rkennke commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 8, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-08 09:41:29 UTC ℹ️ Start processing command /merge


2026-07-08 09:41:36 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 27m (p90).


2026-07-08 11:41:24 UTC 🚨 MergeQueue: This merge request is in error

error while getting head build completion result

Details

Error: There was an error while retrieving the result for pipeline 123471539

FullStacktrace:
child workflow execution error (type: mergequeue_private.MergeQueue_WaitForChecksOrUntilIsFinal, workflowID: wait_checks_186a93dfc8c30f8b0ecb4a80b852be514b7e9dac, runID: 019f411a-df41-7cd8-bb0f-80a638e4517a, initiatedEventID: 59, startedEventID: 61): child workflow execution error (type: mergequeue.MergeQueue_WaitForCompletionOfRef, workflowID: 019f411a-df41-7cd8-bb0f-80a638e4517a_8, runID: 019f411a-dfe8-79a8-a892-2052c50b4198, initiatedEventID: 8, startedEventID: 10): There was an error while retrieving the result for pipeline 123471539 (type: FlowError, retryable: false): There was an error while retrieving the result for pipeline 123471539

@dd-octo-sts

dd-octo-sts Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #28939841079 | Commit: 8fe42b0 | Duration: 15m 13s (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-07-08 11:59:36 UTC

@datadog-official

datadog-official Bot commented Jul 8, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 4 Pipeline jobs failed

DataDog/java-profiler | reliability-chaos-aarch64: [profiler+tracer, tcmalloc, 21.0.3-tem]   View in Datadog   GitLab

DataDog/java-profiler | reliability-chaos-aarch64: [profiler, tcmalloc, 21.0.3-tem]   View in Datadog   GitLab

DataDog/java-profiler | reliability-chaos-amd64: [profiler+tracer, tcmalloc, 21.0.3-tem]   View in Datadog   GitLab

View all 4 failed jobs.

ℹ️ Info

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 57aca28 | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Reliability & Chaos Results

All reliability & chaos checks passed Pipeline: https://gitlab.ddbuild.io/DataDog/java-profiler/-/pipelines/123475201

@rkennke
rkennke merged commit 94a60e5 into main Jul 8, 2026
350 of 388 checks passed
@rkennke
rkennke deleted the rkennke/fix-aarch64-gtest-crashprotection-link branch July 8, 2026 13:24
@github-actions github-actions Bot added this to the 1.47.0 milestone Jul 8, 2026
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.

2 participants