Repository navigation
Description
Description
On Linux x64 with DOTNET_PerfMapEnabled=2 (or 1), .NET 10.0.11 produces a jitdump file (/tmp/jit-<pid>.dump) containing exactly 2 records — both startup stubs, the second truncated — and no JIT_CODE_LOAD records for any managed method. This breaks perf inject --jit, samply symbolication, and Intel PT decode of managed code. The perfmap text file (PerfMapEnabled=1) is unaffected and lists all methods.
I searched open issues for "jitdump" and found no existing report of this. Upd: it's #120419 which is closed, hence the miss.
Reproduction Steps
dotnet new console -o hello && cd hello && dotnet build -c Release
DOTNET_PerfMapEnabled=2 ./bin/Release/net10.0/hello
ls -la /tmp/jit-*.dump
Count the records (any jitdump parser; quick check below):
import struct
data = open("/tmp/jit-<pid>.dump","rb").read()
off, counts = 40, {}
while off + 16 <= len(data):
rid, tsz = struct.unpack("<II", data[off:off+8])
if tsz == 0: break
counts[rid] = counts.get(rid, 0) + 1
off += tsz
print(len(data), counts)Expected behavior
A jitdump containing JIT_CODE_LOAD records for the JIT-compiled managed methods (on .NET 8.0.30, the identical hello-world run produces 540,982 bytes / 1,360 records).
Actual behavior
33,281 bytes / 2 records, deterministically (byte-identical size across runs and across applications). Parsing shows:
JIT_CODE_LOAD"stub InitThreadManagerPerfMapData<JIT_CopiedWriteBarriers>", 272 code bytes — intact;JIT_CODE_LOAD"stub ReportStubBlock" whose header claims 65,536 code bytes, but the file ends at 33,281 bytes — the record is truncated mid-write;- nothing further, ever, although the same run with
PerfMapEnabled=1lists hundreds of methods in the perfmap.
Regression?
Yes — bisected across shipped runtimes (same machine, same hello-world binary via dotnet exec --fx-version):
| Runtime | jitdump | Verdict |
|---|---|---|
| 8.0.30 | 540,982 B / 1,360 records | GOOD |
| 9.0.0 | 95,217 B / 291 records | GOOD |
| 9.0.19 | 93,836 B / 287 records | GOOD |
| 10.0.0-preview.1.25080.5 | 100,687 B / 308 records | GOOD |
| 10.0.0-preview.2.25163.2 | 99,666 B / 305 records | GOOD |
| 10.0.0-preview.3.25171.5 | 99,647 B / 305 records | GOOD |
| 10.0.0-preview.4.25258.110 | 33,251 B / 2 records | BAD |
| 10.0.0-preview.5 … rc.2 | 33,251–33,281 B / 2 records | BAD |
| 10.0.0 (GA), 10.0.11 | 33,281 B / 2 records | BAD |
The only commit touching src/coreclr/vm/perfmap.cpp in the preview.3→preview.4 window is a45396c "Enhance logging of stubs through the PerfMap on Linux" (#113943) — which introduced the stub-block logging that produces the truncated ReportStubBlock<Unknown> record observed above, and also introduced the PerfMapStubGranularity config used in the workaround below.
Known Workarounds
DOTNET_PerfMapStubGranularity=4 (disable stub logging) fully restores method logging: the same hello-world produces 93,364 bytes / 280 records; a JIT-heavy app produces 1,758 records including OSR/tier versions.
Configuration
- .NET 10.0.11 (regression vs 8.0.30), installed via dotnet-install script
- Ubuntu 24.04 (kernel 6.8.0-138-generic), x86_64 (Xeon W-2295), bare metal
- Reproduces with and without
DOTNET_EnableWriteXorExecute=0
Other information
Analysis (hypothesis, from reading release/10.0 sources)
PerfMap::LogStubs(reached viaReportStubBlock) logs an entire stub code block including its code bytes throughPAL_PerfJitDump_LogMethod, whichwritevs{ &record, symbol, pCode/codeSize }(src/coreclr/pal/src/misc/perfjitdump.cpp).- The 64KB stub block appears not to be fully readable (reserved > committed?), so the gather write stops short and then fails — consistent with the truncated record observed.
- The failure path calls
FatalError(), which setsenabled = falsepermanently; every subsequent method record is silently dropped. The perfmap path never includes code bytes, which is why it is unaffected.
Suggested directions (happy to discuss/test): treat a failed record as skippable rather than fatal (or at least log the failure once); and/or avoid including code bytes for block-granularity stub records, or validate readability of the range first.
Activity
dotnet-policy-service commentedon Aug 29, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
alf239 commentedon Aug 29, 2026
Updated with bisected versions.
alf239 commentedon Aug 29, 2026
@davidwrighton may be interested it would seem?
[-]Jitdump contains only 2 stub records and no methods on .NET 10 (Linux x64) — writer silently disabled after truncated stub-block record; regression from .NET 8[/-][+]Jitdump contains only 2 stub records and no methods on .NET 10 (Linux x64) — writer silently disabled after truncated stub-block record; regression from .NET 9[/+]dotnet-policy-service commentedon Aug 30, 2026
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.
alf239 commentedon Aug 30, 2026
Apparently, this is #120419, fixed in main by #122274 but not backported to release/10.0.
Digging further: the truncated
ReportStubBlock<Unknown>record is produced by the block-granularity stub reporting introduced in #113943 (matching my bisect to 10.0.0-preview.4).ReportStubBlockfires when a stub code-heap block is created — at that point the 64KB region is reserved but mostly uncommitted. On release/10.0,PerfJitDumpState::LogMethodunconditionally includes{pCode, codeSize}in thewritev iovec;the kernel copies the committed prefix (the truncated record in the file ends exactly at that boundary) and then fails, andFatalError()permanently disables the writer — hence 2 records and no methods, forever.#122274 (March 2026) fixes this in main by not reporting code bytes for block records (
reportCodeBlock=false); I verified understraceon a main build that the same record is written withiov_len=0and method records flow normally with default settings. However the fix is milestone 11.0.0 and release/10.0 (through 10.0.11) still reproduces.Since .NET 10 is LTS and this silently breaks
DOTNET_PerfMapEnabled=1/2(perf prefers a present-but-empty jitdump over the perfmap, per #122274's description), could #122274 be considered for 10.0.x servicing? It's a small, contained diff (20 insertions, 3 files).Happy to validate a backport build — I have the repro environment standing.
steveisok commentedon Sep 1, 2026
I triggered a backport of #122274 and we'll try to work it into .NET 10.
[release/10.0] Avoid writing jitdump code for block data (#133048)
alf239 commentedon Sep 2, 2026
Legendary, thank you!
alf239 commentedon Oct 18, 2026
I think it's closed by #133048 going out in https://github.com/dotnet/runtime/releases/tag/v10.0.13 — will check shortly