Repository navigation
Closed
Description
Description
When building .NET 10 applications in Docker on Apple M4 hardware, the .NET 10 SDK (version 10.0.101) crashes with "Illegal instruction (core dumped)" on ARM64 images. The crash occurs intermittently during various .NET CLI operations including dotnet new, dotnet add package, and dotnet build.
Environment:
- Host: macOS (Sequoia) on Apple M4 Pro
- Virtualization: macOS Virtualization.Framework (VZ) via Colima
- Colima config:
vmType: vz,arch: aarch64,rosetta: false
- Colima config:
- VM OS: Ubuntu 24.04.1 LTS (Noble Numbat)
- VM Architecture: aarch64 (native ARM64, not emulated)
- .NET SDK: 10.0.101
- Docker Image:
mcr.microsoft.com/dotnet/sdk:10.0(ARM64 variant, sha256:d1823fecac...)
Key Observations:
- ✅ Works perfectly when using
--platform linux/amd64(via Rosetta translation) - ❌ Fails on native ARM64 (
--platform linux/arm64) - The bug is intermittent but consistently reproducible with
--no-cachebuilds - Multi-project solutions with references trigger it more reliably than single projects
- Exit code: 132 (SIGILL - Illegal Instruction)
Impact:
Cannot build .NET 10 applications natively on ARM64 in macOS VZ environment. Workaround is to build for AMD64 and rely on Rosetta, but this defeats the purpose of native ARM64 support.
Reproduction Steps
docker run --rm --platform linux/arm64 mcr.microsoft.com/dotnet/sdk:10.0 \
sh -c 'dotnet new classlib -n Test'
The above fails intermittently but regularly, see sample output below:
> docker run --rm --platform linux/arm64 mcr.microsoft.com/dotnet/sdk:10.0 \
sh -c 'dotnet new classlib -n Test'
The template "Class Library" was created successfully.
Processing post-creation actions...
Restoring /Test/Test.csproj:
Determining projects to restore...
Restored /Test/Test.csproj (in 30 ms).
Restore succeeded.
> docker run --rm --platform linux/arm64 mcr.microsoft.com/dotnet/sdk:10.0 \
sh -c 'dotnet new classlib -n Test'
Illegal instruction (core dumped)
> docker run --rm --platform linux/arm64 mcr.microsoft.com/dotnet/sdk:10.0 \
sh -c 'dotnet new classlib -n Test'
The template "Class Library" was created successfully.
Processing post-creation actions...
Restoring /Test/Test.csproj:
Determining projects to restore...
Restored /Test/Test.csproj (in 33 ms).
Restore succeeded.
> docker run --rm --platform linux/arm64 mcr.microsoft.com/dotnet/sdk:10.0 \
sh -c 'dotnet new classlib -n Test'
Illegal instruction (core dumped)
Expected behavior
Build succeeds
Actual behavior
Build fails (intermittently)
Regression?
No response
Known Workarounds
Build an AMD64 image instead
Configuration
Using SDK 10.0
Other information
System Information
# Host CPU
$ sysctl machdep.cpu.brand_string
machdep.cpu.brand_string: Apple M4 Pro
# Docker/VM architecture
$ docker info | grep Architecture
Architecture: aarch64
# .NET SDK version in container
$ docker run --rm mcr.microsoft.com/dotnet/sdk:10.0 dotnet --version
10.0.101
# CPU features visible in container
$ docker run --rm mcr.microsoft.com/dotnet/sdk:10.0 cat /proc/cpuinfo | grep Features
Features: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 flagm2 frint svei8mm svebf16 bf16 afp sme smei16i64 smef64f64 smei8i32 smef16f32 smeb16f32 smef32f32 sme2 smei16i32 smebi32i32Reacted by Josh Lupo
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
dotnet-policy-service commentedon Dec 17, 2025
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
majoer commentedon Jan 9, 2026
I had a very similar error when building an image with Podman, running
dotnet buildfrom inside the container on a Mac with M4.I always saw one of two different errors. Which one i got seemed very random:
I dont know what the underlying problem is, but i found a workaround by making sure i create the Podman Machine with LibKrun instead of Apple HyperVisor:
psjamesh commentedon Jan 9, 2026
For now I've resorted to using Colima with Rosetta locally which means I can build and run amd64 images instead. It does mean in Kubernetes we will also need to run on amd64 which is unfortunate as arm64 offers a cost-saving.
janvorli commentedon Jan 12, 2026
I will try to repro it on my M1. @psjamesh or do you already know that it repros on M4 ony?
janvorli commentedon Jan 12, 2026
It doesn't repro on my M1, so it seems it is likely M4 specific.
janvorli commentedon Jan 14, 2026
@psjamesh I've asked a colleague to repro it on his devices using your repro steps - neither M2 nor M5 reproduced the problem in about 100 runs.
psjamesh commentedon Jan 15, 2026
Thanks @janvorli, I hadn't checked M1, M2 or M5 so thanks for doing that.
JulieLeeMSFT commentedon Feb 2, 2026
@janvorli, how is the test going?
janvorli commentedon Feb 2, 2026
@JulieLeeMSFT As I've reported above, I was unable to repro it on anything I could find. If you could find a M4 device, it would be great.
JulieLeeMSFT commentedon Feb 2, 2026
I thought a collegue with M4 was trying the repro.
@AndyAyersMS will try it on M4.
25 remaining items
docs(slice-0): r-063 + r-064 + dec-056 — dotnet10 sve2 sigill on appl…
fix(slice-0): dec-056 — dockerfile digest pins + defensive sve env + …
AndyAyersMS commentedon Apr 24, 2026
Note
This comment was generated with Copilot.
Analysis
The crash stack shows a recursive SIGILL:
Root cause: Apple M4 has SME but not SVE. Under the macOS Virtualization Framework (Colima/Podman VZ), the Linux kernel in the VM provides an
SVE_MAGICcontext record in signal frames — likely because SME's "streaming SVE" mode exposes SVE-like state. However the CPU does not support standalone SVE instructions.When a signal fires (e.g.
SIGUSR1activation injection),CONTEXTFromNativeContextat context.cpp:1258 sees the SVE record and callsCONTEXT_GetSveLengthFromOS(), which executesrdvl x0, #1(context2.S:304) — an SVE instruction. Since the CPU doesn't actually support SVE, this triggers SIGILL. The SIGILL handler then tries to capture context again, hitting the samerdvl, causing infinite recursion.The guard in
context.cpponly checks that the kernel provided an SVE signal frame record (sve && sve->head.size >= ...). It does not verify that the CPU actually supports SVE instructions. By contrast,codeman.cpp:1518properly guards withcpuFeatures & ARM64IntrinsicConstants_Svebefore callingGetSveLengthFromOS().Possible fix: The simplest option may be to use
sve->vlfrom the signal frame directly instead of callingrdvl, since the kernel already provides the vector length in the SVE context record. Alternatively, anAT_HWCAP/HWCAP_SVEcheck could guard therdvlcall.AndyAyersMS commentedon Apr 24, 2026
@janvorli new hypothesis above, see if it makes sense to you.
janvorli commentedon Apr 24, 2026
Thanks @AndyAyersMS, it seems to make sense. Using the sve->vl sounds reasonable.
AndyAyersMS commentedon Apr 24, 2026
I'll work up a fix and validate it on my M4.
ci: .NET 10 Server GC crash workaround on Apple Silicon + Otto-248 fl…
ci: .NET 10 Server GC crash workaround on Apple Silicon + Otto-248 fl…
ci: .NET 10 Server GC crash workaround on Apple Silicon (Otto-248) (#376
lemourin commentedon Apr 26, 2026
In case it's useful; I can 100% repro the SIGILL crashes in a linux vm running on mac with kernel version 6.18. With linux kernel 6.12 it doesn't crash ever.
Fix SIGILL crash on ARM64 platforms with SME but no SVE (dotnet#127398)
[release/10.0] Fix SIGILL crash on ARM64 platforms with SME but no SVE (
Fix SIGILL crash on ARM64 platforms with SME but no SVE (#127398)