fix(build): link vmStructs inline definitions in assertion-enabled builds#641
Conversation
…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>
jbachorik
left a comment
There was a problem hiding this comment.
LGTM!
I wonder if we should run asan/tsun regularly for each PR ...
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
error while getting head build completion result DetailsError: There was an error while retrieving the result for pipeline 123471539 FullStacktrace: |
CI Test ResultsRun: #28939841079 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 32 | Failed: 0 Updated: 2026-07-08 11:59:36 UTC |
|
Reliability & Chaos Results✅ All reliability & chaos checks passed Pipeline: https://gitlab.ddbuild.io/DataDog/java-profiler/-/pipelines/123475201 |
Problem
crashProtectionActive()andcast_to()are declaredinlineinvmStructs.h— where theVMNMethod/castaccessors odr-use them insideassert(...)— but they are defined only invmStructs.inline.h. A translation unit that includes the lightvmStructs.hwithout the.inline.hcounterpart therefore odr-uses those inline functions with no visible definition.NDEBUGbuilds the asserts compile out, so the main release.solinks fine.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.:This is independent of any feature work — it reproduces on a clean
main.Fix
Include
vmStructs.inline.hin the TUs that odr-use the accessors (hotspotStackFrame_aarch64.cpp,hotspotStackFrame_x64.cpp,vmEntry.cpp), matching the codebase's existing.h/.inline.hsplit.vmEntry.cpp's now-redundant directvmStructs.hinclude is dropped since.inline.hpulls it in.Verification
./gradlew :ddprof-lib:buildGtestReleasenow links (previously failed on arm64); confirmed on macOS/aarch64.🤖 Generated with Claude Code