-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello World app crashes on Arm32 Alpine 3.13 #47423
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsWhen attempting to run a .NET application on Arm32 Alpine 3.13, it crashes (core dump: core.zip). This repros on both .NET runtime 5.0.2 and 6.0.0-alpha.1.21069.7. This error does not happen when using the same architecture with Alpine 3.12. It also doesn't happen when using Arm64 Alpine 3.13. Repro
FROM arm32v7/alpine:3.13 AS runtime
RUN apk add --no-cache \
ca-certificates \
\
# .NET Core dependencies
krb5-libs \
libgcc \
libintl \
libssl1.1 \
libstdc++ \
zlib
ENV \
# Configure web servers to bind to port 80 when present
ASPNETCORE_URLS=http://+:80 \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true \
# Set the invariant mode since icu_libs isn't included (see https://github.com/dotnet/announcements/issues/20)
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
# Install .NET
ENV DOTNET_VERSION=5.0.2
RUN wget -O dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Runtime/$DOTNET_VERSION/dotnet-runtime-$DOTNET_VERSION-linux-musl-arm.tar.gz \
&& dotnet_sha512='e608a714767c8ddb6c397a0bd67e493c8546cd0d47c4c393f95d16a9e6aef0949c535a5ab8f0ccfe0642456f29c69d1b9a99561b37b9d24180bcea7e9417d5eb' \
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
&& mkdir -p /usr/share/dotnet \
&& tar -C /usr/share/dotnet -oxzf dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
&& rm dotnet.tar.gz
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim-arm32v7 as build
WORKDIR app
COPY *.csproj .
RUN dotnet restore
COPY . .
RUN dotnet build --no-restore
FROM build as publish
RUN dotnet publish --no-restore -c Release -o out
FROM runtime
WORKDIR /app
COPY --from=publish /app/out ./
ENTRYPOINT ["dotnet", "app.dll"]
Expected: Outputs Another resultI also found that adding code that makes a web request results in a NotTimeValid cert error with this exception stack:
You can repro this by modifying the static void Main(string[] args)
{
var task = new System.Net.Http.HttpClient().GetAsync("https://www.microsoft.com");
task.Wait();
task.Result.EnsureSuccessStatusCode();
} This repos in the same environment as described above and also works in the other environments that were mentioned (Alpine 3.12, Arm64 Alpine 3.13).
|
This is blocking Add support for Alpine 3.13. |
I can repro the problem, however the Alpine 3.13 docker image (even the original alpine:3.13) has apk broken, so I cannot install a debugger. Trying to install e.g. gdb:
I've found multiple reports of the same issue with Alpine 3.13 while people say that 3.12 works fine. I get the same behavior. One of such report is here: https://www.gitmemory.com/issue/alpinelinux/docker-alpine/135/761709893. I wonder how we have succeeded creating the mcr.microsoft.com/dotnet/nightly/runtime:5.0-alpine3.13-arm32v7 image then. @mthalman any idea? |
We don't require
Correction: |
Ok, it was caused by an outdated docker. I've reinstalled it from the docker's own repo and now I am able to install packages. |
Interestingly enough, after I've upgraded docker, your sample above started to work for me - it prints Hello World now instead of crashing:
|
My version of docker is now
|
@janvorli - I see you're running an arm64 machine. I'm using an arm32 machine (Raspberry Pi 4). I was using an older version of Docker (version 20.10.0). But even after upgrading it to 20.10.2, I still get the same crashing behavior. |
Hmm, that's strange. I'll dig out my RPi 3 and see if I can repro it over there. |
I have tried that on my Odroid XU4 (arm32 only device) with Ubuntu 20.04. The default docker reproed the issue, but after upgrading it to the one from the docker repo it worked fine (I had to use repo for bionic, as the one for focal didn't contain armhf packages for some reason). This time the docker version was 20.10.3. |
Thanks for pointing out those release notes. A few key things here from the release notes:
For my RPi, Raspbian stable the latest version available for libseccomp is 2.3.3, less than the required 2.4.2.
Again, confirming the old version of libseccomp in Raspbian.
I tried executing my container with this option and it worked. So I think all this confirms that these time64 requirements are the cause. One open question remains, however: this issue also repros on our build machines (NVIDIA Jetson) that technically meet the requirements as defined in the release notes. I'll continue to investigate that. |
Ok, it actually looks like I've been dealing with two separate issues here. The crash is definitely related to the time64 change in musl 1.2 By running on a compatible environment, that issue can be resolved except for the code sample that I provided above which makes a web request: static void Main(string[] args)
{
var task = new System.Net.Http.HttpClient().GetAsync("https://www.microsoft.com");
task.Wait();
task.Result.EnsureSuccessStatusCode();
} @janvorli, have you tried that code in your environment? When I run that in a supported environment, I get the following exception:
|
@mthalman I haven't tried this one, let me test it. |
I am hitting the same issue. Since it is also related to time (based on the exception), I was wondering if we are actually hitting another thing that the release notes mention for 32 bit platforms:
To check if it is the issue, I've built .NET Core 5 using crossbuild and Alpine 3.13 rootfs (it required several little hacks to get there). I've built it from the same commit as the runtime that was in the docker container. Then I've copied the files into /usr/share/dotnet/shared/Microsoft.NETCore.App/5.0.2 and the issue is gone. |
@janvorli what would be the right area path for the issue? PAL? |
@karelz I would use meta, as the fix involves changes in rootfs build script in arcade, a patch to the pal.h header and change in the dotnet-buildtools-prereqs-docker repo. |
What is the status of this? Is this something that can still get into Preview 2? |
@janvorli - I'm still seeing the same failure as above on the upcoming 5.0.7 release. I believe this was the release you were expecting the fix to be in. Here's the output of
|
My local verification in Alpine 3.13 armv7 docker container running on arm64 Linux with the test from above have worked fine. |
Everything is working fine now. |
When attempting to run a .NET application on Arm32 Alpine 3.13, it crashes (core dump: core.zip).
This repros on both .NET runtime 5.0.2 and 6.0.0-alpha.1.21069.7.
This error does not happen when using the same architecture with Alpine 3.12. It also doesn't happen when using Arm64 Alpine 3.13.
Repro
mkdir app && cd app
dotnet new console --no-restore
Dockerfile
and the following content:sudo docker build -t test .
sudo docker run --rm test
Expected: Outputs
Hello World!
Actual: App crashes
Another result
I also found that adding code that makes a web request results in a NotTimeValid cert error with this exception stack:
You can repro this by modifying the
Program.cs
file that gets generated in the above repro steps to include the following code:This repos in the same environment as described above and also works in the other environments that were mentioned (Alpine 3.12, Arm64 Alpine 3.13).
The text was updated successfully, but these errors were encountered: