Skip to content

Commit

Permalink
s390x: set DOTNET_EnableWriteXorExecute=0
Browse files Browse the repository at this point in the history
Github Actions Runner.Listener x86_64 binary version 2.321.0 has been
crashing with segfault on startup when emulated on s390x [1].

Ilya pointed out, that the root cause of this crash is most likely a
qemu issue [2].

.NET 8 turns on "write xor execute" feature [3] by default.
And GH actions runner 2.320.0->2.321.0 update includes an upgrade to
.NET 8 [4].

Ilya suggested opting out of this feature in our environment to
mitigate the failure.

I tested this with manually built runner immage on one for s390x BPF
CI hosts: the runner doesn't crash.

[1] actions/runner#3583
[2] https://gitlab.com/qemu-project/qemu/-/issues/2600
[3]
https://devblogs.microsoft.com/dotnet/announcing-net-6-preview-7/#runtime:-w^x-(write-xor-execute)-support-for-all-platforms-and-architectures
[4] actions/runner#3500

Suggested-by: Ilya Leoshkevich <[email protected]>
Signed-off-by: Ihor Solodrai <[email protected]>
  • Loading branch information
theihor committed Nov 28, 2024
1 parent c19215c commit 1e64ad6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion s390x.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN apt-get update && apt-get -y install \
apt-get install -y cpu-checker qemu-kvm qemu-utils qemu-system-x86 qemu-system-s390x qemu-system-arm qemu-guest-agent ethtool keyutils iptables gawk

# amd64 Github Actions Runner.
ARG version=2.320.0
ARG version=2.321.0
ARG homedir=/actions-runner
# Copy scripts from myoung34/docker-github-actions-runner
RUN curl -L https://raw.githubusercontent.com/myoung34/docker-github-actions-runner/${version}/entrypoint.sh -o /entrypoint.sh && chmod 755 /entrypoint.sh
Expand All @@ -62,6 +62,9 @@ COPY --from=ld-prefix / /usr/x86_64-linux-gnu/
RUN ln -fs ../lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /usr/x86_64-linux-gnu/lib64/
RUN ln -fs /etc/resolv.conf /usr/x86_64-linux-gnu/etc/
ENV QEMU_LD_PREFIX=/usr/x86_64-linux-gnu
# mitigates .NET 8 crash in qemu emulation
# see https://gitlab.com/qemu-project/qemu/-/issues/2600
ENV DOTNET_EnableWriteXorExecute=0

ENTRYPOINT ["/entrypoint.sh"]
CMD ["./bin/Runner.Listener", "run", "--startuptype", "service"]

0 comments on commit 1e64ad6

Please sign in to comment.