runtime: `Segmentation fault (core dumped)` at runtime in ARM64 self-contained application
Description
Segmentation fault (core dumped)when running a .NET Core self-contained, single file application within ARM64 containermcr.microsoft.com/dotnet/runtime-deps:6.0.0-preview.7that was compiled using AMD64mcr.microsoft.com/dotnet/sdk:6.0.100-preview.7Segmentation fault (core dumped)when running a .NET Core self-contained, single file application within ARM64 containermcr.microsoft.com/dotnet/sdk:6.0.100-preview.7or that was compiled using ARM64mcr.microsoft.com/dotnet/sdk:6.0.100-preview.7(in that same container).
Repro steps for sdk images (ARM64):
Works as expected (preview.5):
sudo docker run -it mcr.microsoft.com/dotnet/sdk:6.0.100-preview.5 bash
git clone https://github.com/lynx-chess/lichess-challenger && cd lichess-challenger
dotnet publish src/LichessChallenger/LichessChallenger.csproj -c Release --runtime linux-arm64 --self-contained -o artifacts/
cd artifacts
export LICHESS_API_TOKEN="*"
export LICHESS_USERNAME="eduherminio"
./LichessChallenger
Segmentation fault (core dumped) at compile time (preview.6):
docker run -it mcr.microsoft.com/dotnet/sdk:6.0.100-preview.6 bash
git clone https://github.com/lynx-chess/lichess-challenger && cd lichess-challenger
dotnet publish src/LichessChallenger/LichessChallenger.csproj -c Release --runtime linux-arm64 --self-contained -o artifacts/ # Segmentation fault (core dumped)
Segmentation fault (core dumped) at runtime (preview.7):
docker run -it mcr.microsoft.com/dotnet/sdk:6.0.100-preview.7 bash
git clone https://github.com/lynx-chess/lichess-challenger && cd lichess-challenger
dotnet publish src/LichessChallenger/LichessChallenger.csproj -c Release --runtime linux-arm64 --self-contained -o artifacts/
cd artifacts
export LICHESS_API_TOKEN="*"
export LICHESS_USERNAME="eduherminio"
./LichessChallenger # Segmentation fault (core dumped)
Repro steps for runtime-props images (ARM64):
Works (preview 6, artifact compiled using AMD preview 6):
sudo docker run -it mcr.microsoft.com/dotnet/runtime-deps:6.0.0-preview.6 bash
apt-get update && apt-get install -y wget unzip
mkdir app && cd app
wget https://github.com/lynx-chess/lichess-challenger/releases/download/v0.1.2/lichess-challenger-0.1.2-linux-arm64.zip
unzip lichess-challenger-0.1.2-linux-arm64.zip
chmod +x LichessChallenger
export LICHESS_API_TOKEN="*"
export LICHESS_USERNAME="eduherminio"
./LichessChallenger
Works (preview 7, artifact compiled using AMD preview 6):
sudo docker run -it mcr.microsoft.com/dotnet/runtime-deps:6.0.0-preview.7 bash
apt-get update && apt-get install -y wget unzip
mkdir app && cd app
wget https://github.com/lynx-chess/lichess-challenger/releases/download/v0.1.2/lichess-challenger-0.1.2-linux-arm64.zip
unzip lichess-challenger-0.1.2-linux-arm64.zip
chmod +x LichessChallenger
export LICHESS_API_TOKEN="*"
export LICHESS_USERNAME="eduherminio"
./LichessChallenger
Segmentation fault (core dumped) at runtime (preview 6 and 7, artifact compiled using preview 7):
sudo docker run -it mcr.microsoft.com/dotnet/runtime-deps:6.0.0-preview.7 bash
apt-get update
apt-get install -y wget unzip
mkdir app && cd app
wget https://github.com/lynx-chess/lichess-challenger/releases/download/v0.1.6/lichess-challenger-0.1.3-linux-arm64.zip
unzip lichess-challenger-0.1.3-linux-arm64.zip
chmod +x LichessChallenger
export LICHESS_API_TOKEN="*"
export LICHESS_USERNAME="eduherminio"
./LichessChallenger
Configuration
- .NET Version:
- mcr.microsoft.com/dotnet/sdk:6.0.100-preview.7
- mcr.microsoft.com/dotnet/runtime-deps:6.0.0-preview.7
- Architecture: ARM64
- Repository used in the repro steps, including Dockerfile and GitHub action used to build the images.
Regression?
Yes, working as expected in preview.5 and preview.6.
Other information
Works flawlessly for AMD64.
Example of an image based on mcr.microsoft.com/dotnet/runtime-deps:6.0.0-preview.7 with this error: ghcr.io/lynx-chess/lichess-challenger:0.1.3
Example of an image based on mcr.microsoft.com/dotnet/runtime-deps:6.0.0-preview.6 without this error: ghcr.io/lynx-chess/lichess-challenger:0.1.2 (it was built using an AMD64 container, therefore the compile-time error didn’t affect it).
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 21 (20 by maintainers)
Hmm. There were very little changes between P7 and RC in the area of single-file, but there were a lot of changes in other part of the runtime. There is a possibility that some unrelated bug was causing this. In particular, if it is due to something like uninitialized data, then a bug could show up only in some environments/builds. These are notoriously hard to find and fix, but also very rare.
I think I will close this issue as right now I do not see a lot of actionable directions to take. We should watch this scenario carefully to be sure the bug does not come back later.
Thanks a lot @eduherminio.
That sounds a lot like this is a problem with “Single-file” - @VSadov, could you please take a look.