Closed pattobrien closed 1 year ago
As I have already indicated in https://github.com/dart-lang/sdk/issues/48420 we are not going to be debugging this ourselves because there is a strong indication that its a bug in emulation layer - so there is very little we can do about it.
/cc @athomas could you close this?
The bug was apparently fixed in Docker Desktop 4.26.0 for Mac, but it seems to persist in Dart.
https://www.docker.com/blog/docker-desktop-4-26/
Building package executables... (1.4s)
===== CRASH =====
si_signo=Segmentation fault(11), si_code=1, si_addr=0x7fff4050adb0
version=3.1.3 (stable) (Tue Sep 26 14:25:13 2023 +0000) on "linux_x64"
pid=245, thread=253, isolate_group=main(0x5555578ce570), isolate=main(0x5555578d0dd0)
os=linux, arch=x64, comp=no, sim=no
isolate_instructions=ffff950b4000, vm_instructions=55555739dd20
fp=7ffff59fd680, sp=7ffff59fd630, pc=5555574ebd19
pc 0x00005555574ebd19 fp 0x00007ffff59fd680 dart::DeoptInfo::UnpackInto+0x139
pc 0x00005555574e9d71 fp 0x00007ffff59fd710 dart::DeoptContext::FillDestFrame+0x71
pc 0x00005555575ea813 fp 0x00007ffff59fdcd0 DLRT_DeoptimizeFillFrame+0xb3
pc 0x0000ffff94f83398 fp 0x00007ffff59fdce8 Unknown symbol
pc 0x00007ffff7790a01 fp 0x00007ffff59fdd00 Unknown symbol
-- End of DumpStackTrace
@kerberjg
The bug was apparently fixed in Docker Desktop 4.26.0 for Mac, but it seems to persist in Dart.
Can you check if you have "Use Virtualization framework" and "Use Rosetta for x86/AMD64 emulation on Apple Silicon" enabled in "General" tab of Docker settings?
I confirm they’re both enabled
Thanks @kerberjg. It's a bummer it does not work. See https://github.com/dart-lang/sdk/issues/54446#issuecomment-1875995351 for the current state.
Thanks to @parlough experimenting with some things we now have an idea of what was causing this (see comment) and are going to make a change to the VM which should work around this problem.
Unfortunately we have missed the release cutoff for 3.3, but I am planning to request cherry pick later.
See reproducible repo here: https://github.com/pattobrien/docker_dart_build_failure
Docker + Dart Build Failure
When building a Dart app for linux/amd64 on a MacOS (M1) machine, the build fails with a seg fault error (11). However, when changing the dart sdk version in pubspec.yaml to use hyphen syntax (rather than carat), the build succeeds.
I believe carat syntax has become the new default as of Dart 3 when running
dart create
, so its likely that the switch will cause more people to see the issue over time.FWIW - I found several issues that mentioned similar seg faults with workarounds or insufficient reproducibility steps, so I dug into reproducing the issue. Hope this info helps out.
Requirements
A MacOS (M1) machine with docker installed.
Steps to reproduce
Requirements: MacOS (M1)
dart create docker_dart_build_failure
, which defaults to using carat syntax for the dart sdk env variable).docker build --platform=linux/amd64 .
to run the docker build command.Observed Error
Seg fault error (11) when compiling the dart app.