-
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
Segmentation fault when running in emulated amd64 container on M1 Mac #94909
Comments
Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions Issue DetailsDescriptionThis is a stripped down repro of Azure/bicep#10245, which has been reported by a number of our users trying to use a VSCode extension in an amd64 emulated devcontainer image. It seems like the usage of Regex.Match is causing a segmentation fault when run in an amd64 image emulated on an M1 Mac. Reproduction StepsOpen a docker container run -it --platform=linux/amd64 mcr.microsoft.com/vscode/devcontainers/python:0-3.10-bullseye bash Run the following to repro the issue: wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x ./dotnet-install.sh
./dotnet-install.sh --channel 7.0
git clone https://github.com/anthony-c-martin/dotnet-regex-rosetta-repro.git
cd dotnet-regex-rosetta-repro
/root/.dotnet/dotnet run Expected behaviorThe console app should log "Success!" Actual behaviorThe following is logged:
Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
Setting
But I don't believe that is a stable work around. I am assuming this has something to do with double memory mapping. If I am not mistaken, Docker uses QEMU emulation to run x86_64 on Apple Silicon, and .NET is not supported in QEMU. |
Yup, this was discussed here: |
Thanks! I'll make sure we document that qemu is unsupported. It would be amazing if there's a way to detect this and warn the user (not sure how feasible however). To make sure I'm understanding correctly, the following are both required to support the scenario:
@stephentoub do you happen to have an explanation for why the env var is required? Is this to work around an issue in Rosetta2? Are you aware of any recommended approaches to detecting an emulated environment? |
as a sidenote, I use the docker build in github actions here for .NET 8 armv8 docker build and the build issue was fixed by applying
in the Dockerfile |
Note that this will be better in .NET 9: #102509 |
Fixed by #102509 |
Description
This is a stripped down repro of Azure/bicep#10245, which has been reported by a number of our users trying to use a VSCode extension in an amd64 emulated devcontainer image.
It seems like the usage of Regex.Match is causing a segmentation fault when run in an amd64 image emulated on an M1 Mac.
Reproduction Steps
Open a
bash
prompt in an amd64 Docker container on an M1 Mac:Run the following to repro the issue:
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh chmod +x ./dotnet-install.sh ./dotnet-install.sh --channel 7.0 git clone https://github.com/anthony-c-martin/dotnet-regex-rosetta-repro.git cd dotnet-regex-rosetta-repro /root/.dotnet/dotnet run
Expected behavior
The console app should log "Success!"
Actual behavior
The following is logged:
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: