runtime: Intermittent SIGILL on build, restore and/or publish
Hi All,
Describe the bug
Repro repo: https://github.com/ksitarek/sigill_dotnet_docker (plain console app with hello world)
Intermittent Illegal Instruction on various commands such as dotnet restore, dotnet build, dotnet publish when ran on official docker sdk image.
Seem to be working outside of docker (aka plain build via Rider).
To Reproduce
- Clone repo https://github.com/ksitarek/sigill_dotnet_docker
- Attempt
DOCKER_BUILDKIT=0 docker build . --no-cache(might require couple of tries, as sometimes it “just works”)
Exceptions (if any)
Illegal instruction
Further technical details
- Happens regularly on Apple M4 Max
- Does not happen on Apple M2
❯ DOCKER_BUILDKIT=0 docker build . --no-cache
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0
environment-variable.
Sending build context to Docker daemon 9.216kB
Step 1/18 : FROM mcr.microsoft.com/dotnet/runtime:9.0 AS base
---> 4fb8b01c8a0d
Step 2/18 : USER $APP_UID
---> Running in 4c226e3d8f88
---> Removed intermediate container 4c226e3d8f88
---> d2d42b51fb96
Step 3/18 : WORKDIR /app
---> Running in 911b3e8c95c1
---> Removed intermediate container 911b3e8c95c1
---> faf61b2ce781
Step 4/18 : FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
---> 3fcf6f1e809c
Step 5/18 : ARG BUILD_CONFIGURATION=Release
---> Running in 0b2927713c0c
---> Removed intermediate container 0b2927713c0c
---> 1b95917bc1bd
Step 6/18 : WORKDIR /src
---> Running in 2e3304a49655
---> Removed intermediate container 2e3304a49655
---> 89c273297771
Step 7/18 : COPY ["ConsoleApp1/ConsoleApp1.csproj", "ConsoleApp1/"]
---> de94c9a92034
Step 8/18 : RUN dotnet restore "ConsoleApp1/ConsoleApp1.csproj"
---> Running in ecafd1770e36
Determining projects to restore...
Restored /src/ConsoleApp1/ConsoleApp1.csproj (in 26 ms).
---> Removed intermediate container ecafd1770e36
---> b90d6820a3d0
Step 9/18 : COPY . .
---> fbef895cd601
Step 10/18 : WORKDIR "/src/ConsoleApp1"
---> Running in 080297ca64c3
---> Removed intermediate container 080297ca64c3
---> 90eccb1786f0
Step 11/18 : RUN dotnet build "ConsoleApp1.csproj" -c $BUILD_CONFIGURATION -o /app/build
---> Running in 2d569a8b64c4
Determining projects to restore...
All projects are up-to-date for restore.
Illegal instruction
The command '/bin/sh -c dotnet build "ConsoleApp1.csproj" -c $BUILD_CONFIGURATION -o /app/build' returned a non-zero code: 132
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 21 (9 by maintainers)
Ok, let’s close this for now. Please reopen if it occurs again. Thanks for validating!
I tried several times on new Docker version and haven’t observed any issue, thanks for letting me know - I abandoned docker for my project due to these issues. I guess its time to get back using it and observe more.
I have now gone back and used older
mcr.microsoft.com/dotnet/sdk:9.0images, likesha256:84fd557bebc64015e731aca1085b92c7619e49bdbe247e57392a43d92276f617orsha256:6894a71619e08b47ef9df7ff1f436b21d21db160e5d864e180c294a53d7a12f2and did a bunch ofdocker build --no-cache .runs after each other and I cannot replicate the crash. Maybe this was a Docker problem all this time? I have not considered this… (sorry), I know a couple of days ago there was an update, I’m onDocker Desktop 4.38.0 (181591); Engine: 27.5.1which is the latest you can get on MacOS afaik.@ksitarek I have cloned your repo. Keep in mind that
However even with that, It built successfully.
Using `sha256:84fd557bebc64015e731aca1085b92c7619e49bdbe247e57392a43d92276f617` also worked fine
Even with Buildkit it works.
Unfortunately, for me it failed on first try 😦
@rainersigwald do we have any known problems with MSBuild on m4 Macs, or should be bring the runtime folks in to consult on this one?
I also can reproduce it most of the time. Is really rare that it works. Is exactly as described. The issue started a couple of weeks ago. In Mac M1 it works without problems. Mac M4 is the problem.
On another (much more complex project, but same setup with pretty much same Dockerfile) I was somehow able to catch following error:
/usr/share/dotnet/sdk/9.0.101/Roslyn/Microsoft.CSharp.Core.targets(89,5): error MSB6006: "csc.dll" exited with code 132.This might be red herring, but 132 seem to match SIGILL.