You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(walkvm): unwind through virtual thread continuation boundaries
Fixes walkVM to correctly traverse JVM virtual thread (Project Loom)
continuation boundaries, exposing carrier thread frames in wall-clock
profiles.
Two unwind paths are implemented:
- Path A (enterSpecial): CPU-bound VTs that never yield — all frames
are thawed; the profiler traverses the enterSpecial nmethod by
identity to reach carrier frames via ContinuationEntry.
- Path B (cont_returnBarrier): blocking VTs that park/unpark — when
remounted with frozen frames in the StackChunk, cont_returnBarrier
is the return PC of the bottommost thawed frame. Checked before
CodeHeap::findNMethod() since it is a JVM stub, not an nmethod.
By default a synthetic "JVM Continuation" root frame (BCI_NATIVE_FRAME)
is inserted at the boundary so the sample is not marked truncated.
With wextend=vt_carrier the profiler walks through to carrier frames;
failures emit BCI_ERROR (truthful truncation). The wextend argument is
string-parsed and extensible for future flags.
Additional changes:
- Add carrier_frames bit to StackWalkFeatures (uses one padding bit)
- Use FRAME_PC_SLOT for architecture-portable carrier frame extraction
- Split VMContinuationEntry into DECLARE_V21_TYPES_DO to prevent
assert(type_size() > 0) on JDK <21 debug builds; expand at all
four declare/init/read/verify sites
- Three new counters: WALKVM_CONT_BARRIER_HIT, WALKVM_ENTER_SPECIAL_HIT,
WALKVM_CONT_ENTRY_NULL
- isValidFP / isValidSP helpers with unit tests in stackWalker_ut.cpp
- DDPROF_DISABLE_CONT_UNWIND env var for negative testing (DEBUG only)
- Integration tests: VirtualThreadWallClockTest covers both paths on
JDK 21+ with wextend=vt_carrier
Resolves SCP-1110
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments