runtime icon indicating copy to clipboard operation
runtime copied to clipboard

System.Runtime.Tests SIGSEGV crash on ARM64 Linux (azurelinux.3.arm64)

Open ViveliDuCh opened this issue 7 months ago • 5 comments

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1365474 Build error leg or test failing: System.Runtime.Tests.WorkItemExecution Pull request: https://github.com/dotnet/runtime/pull/126428

Error Message

SIGSEGV crash during System.Runtime.Tests execution on ARM64 Linux (azurelinux.3.arm64.open). The test process crashed with signal 11 (illegal memory access) early in test execution, before any test results were produced. The crash dump shows hundreds of unsymbolized frames, indicating a likely JIT or GC bug on ARM64.

{
  "ErrorMessage": ["Discovering: System.Runtime.Tests","exit code 139"],
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Stack trace

[createdump] Gathering state for process 5962 dotnet
[createdump] Crashing thread 1778 signal 11 (000b)
[createdump] Writing crash report to file /datadisks/disk1/dumps/coredump.5962.dmp.crashreport.json
[createdump] Crash report successfully written
[createdump] Writing minidump with heap to file /datadisks/disk1/dumps/coredump.5962.dmp
[createdump] Written 528019456 bytes (128911 pages) to core file
[createdump] Target process is alive
[createdump] Dump successfully written in 913ms
waitpid() returned successfully (wstatus 00000000) WEXITSTATUS 0 WTERMSIG 0
./RunTests.sh: line 175:  5962 Segmentation fault      (core dumped) "$RUNTIME_PATH/dotnet" exec --runtimeconfig System.Runtime.Tests.runtimeconfig.json --depsfile System.Runtime.Tests.deps.json xunit.console.dll System.Runtime.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=AdditionalTimezoneChecks -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing $RSP_FILE
/datadisks/disk1/work/997F0892/w/A0DB093F/e
----- end Fri Apr 3 04:27:57 PM UTC 2026 ----- exit code 139 ----------------------------------------------------------
exit code 139 means SIGSEGV Illegal memory access. Deref invalid pointer, overrunning buffer, stack overflow etc. Core dumped.
ulimit -c value: unlimited
cat /proc/sys/kernel/core_pattern: /datadisks/disk1/dumps/core.%u.%p
cat /proc/sys/kernel/core_uses_pid: 1
cat: /proc/sys/kernel/coredump_filter: No such file or directory
cat /proc/sys/kernel/coredump_filter:
Looking around for any Linux dumps...

Known issue validation

Build: :mag_right: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1365474 Error message validated: [exit code 139] Result validation: :white_check_mark: Known issue matched with the provided build. Validation performed at: 4/3/2026 9:10:56 PM UTC

Report

Build Definition Test Pull Request
1365983 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126520
1365958 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126509
1365963 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126515
1365887 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#125396
1365856 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126385
1365829 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution dotnet/runtime#125955
1365706 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126512
1365474 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126428

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
8 8 8

Known issue validation

Build: :mag_right: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1365474 Error message validated: [Discovering: System.Runtime.Tests exit code 139] Result validation: :white_check_mark: Known issue matched with the provided build. Validation performed at: 4/4/2026 1:32:38 AM UTC

Report

Build Definition Test Pull Request
1365983 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126520
1365958 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126509
1365963 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126515
1365887 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#125396
1365856 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126385
1365829 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution dotnet/runtime#125955
1365706 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126512
1365474 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126428

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
8 8 8

Report

Build Definition Test Pull Request
1366116 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126514
1366060 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126445
1366029 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126521
1365983 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126520
1365958 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126509
1365963 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126515
1365887 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#125396
1365856 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126385
1365829 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution dotnet/runtime#125955
1365706 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126512
1365474 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#126428

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
11 11 11

ViveliDuCh avatar Apr 03 '26 21:04 ViveliDuCh

Tagging subscribers to this area: @agocke See info in area-owners.md if you want to be subscribed.

dotnet-policy-service avatar Apr 03 '26 21:04 dotnet-policy-service

@mangod9 Could you please run your crash analyzer skill on this?

jkotas avatar Apr 04 '26 01:04 jkotas

Yeah was just doing it, hasn't completely found a root cause yet, but here is the initial analysis:

Potential Root Cause: PR #117583 ("Inline CORINFO_HELP_ARRADDR_ST helper call, remove WriteBarrier
FCall")

Merged: 2026-04-02T20:23:28Z by @EgorBo — less than 24 hours before the crash.

What the PR Changed (25 files)

 1. JIT inlining of StelemRef: New impConvertToUserCallAndMarkForInlining() converts the
CORINFO_HELP_ARRADDR_ST helper call to a managed StelemRef call marked for inlining
(importer.cpp, importercalls.cpp)
 2. WriteBarrier FCall → Intrinsic: Removed CastHelpers.WriteBarrier InternalCall, replaced
with RuntimeHelpers.WriteBarrier marked [Intrinsic], expanded by JIT as StoreInd TYP_REF with
 GTF_IND_TGT_HEAP (importercalls.cpp line 3645-3651)
 3. Removed JIT_WriteBarrier_Callable from ARM64 (and all other arch) assembly files — the
old ABI bridge from standard calling convention to the write barrier's custom ABI (x14/x15
args)
 4. Morph fallback: If inlining doesn't happen, call is converted back to CT_HELPER
(morph.cpp line 6470-6477)

Crash Path Analysis

 SZArrayHelper.set_Item<__Canon>  → [stelem.ref → inlined StelemRef]
   └── elementType = GetMethodTable(array)->ElementType  →  0x18c0 (CORRUPTED!)
   └── StelemRef_Helper(ref element, 0x18c0, obj)
       └── StelemRef_Helper_NoCacheLookup(ref element, 0x18c0, obj)
           └── IsInstanceOfAny_NoCacheLookup(0x18c0, obj)  → SIGSEGV

Key evidence: No StelemRef frame in the stack = confirmed inlined.

MethodTable Layout (Checked ARM64, 64-bit)

With DebugClassNamePtr = 8:

 - ElementTypeOffset = 0x30 + 8 = 0x38
 - The inlined code should load from MT + 0x38 to get the element type MethodTable*

The corrupted value 0x18c0 (6336) is:

 - Too small to be a valid heap pointer (should be ~0xf6c3xxxxxxxx)
 - Doesn't match any obvious MethodTable field value at known offsets
 - Likely produced by incorrect ARM64 code generation in the inlined StelemRef

Two Hypotheses

Hypothesis A (Most likely): JIT ARM64 codegen bug when inlining StelemRef

 - When StelemRef is inlined into SZArrayHelper.set_Item<__Canon> (a shared generic method
reached via interface dispatch), the combined code complexity could expose a register
allocation or instruction scheduling bug specific to ARM64
 - The elementType computation (GetMethodTable intrinsic → field load at offset 0x38) may use
 a stale or incorrect register in the inlined context

Hypothesis B: GC corruption from WriteBarrier intrinsic

 - If the StoreInd TYP_REF with GTF_IND_TGT_HEAP generates incorrect write barrier code on
ARM64, the GC could fail to track object references, leading to heap corruption after
compaction
 - Less likely since only one test is affected

mangod9 avatar Apr 04 '26 01:04 mangod9

cc @EgorBo

jkotas avatar Apr 04 '26 01:04 jkotas

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch See info in area-owners.md if you want to be subscribed.

dotnet-policy-service avatar Apr 04 '26 01:04 dotnet-policy-service