Skip to content
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

Crash with rosetta in 0.6.0 (regression from 0.5.6) #855

Closed
1 of 5 tasks
lejoko opened this issue Nov 13, 2023 · 13 comments
Closed
1 of 5 tasks

Crash with rosetta in 0.6.0 (regression from 0.5.6) #855

lejoko opened this issue Nov 13, 2023 · 13 comments
Labels
not yet reproduced The issue reported is not yet experienced by someone else

Comments

@lejoko
Copy link

lejoko commented Nov 13, 2023

Description

Crash in Rosetta when running official mysql:5.7 image:

$ docker run -it --rm mysql:5.7
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
rosetta error: unhandled auxillary vector type 28
$

Version

Colima Version: 0.6.0
Lima Version: 0.18.0
Qemu Version: 8.1.2

Operating System

  • macOS Intel <= 12 (Monterrey)
  • macOS Intel >= 13 (Ventura)
  • macOS M1 <= 12 (Monterrey)
  • macOS M1 >= 13 (Ventura)
  • Linux

Output of colima status

$ colima status -p rosetta
INFO[0000] colima [profile=rosetta] is running using macOS Virtualization.Framework 
INFO[0000] arch: aarch64                                
INFO[0000] runtime: docker                              
INFO[0000] mountType: virtiofs                          
INFO[0000] socket: unix:///Users/joel/.colima/rosetta/docker.sock 
$ cat ~/.colima/rosetta/colima.yaml |grep -v "^ *#\|^ *$"
cpu: 8
disk: 60
memory: 8
arch: aarch64
runtime: docker
hostname: colima
kubernetes:
  enabled: false
  version: v1.28.3+k3s2
  k3sArgs:
    - --disable=traefik
autoActivate: true
network:
  address: false
  dns: []
  dnsHosts: {}
forwardAgent: false
docker: {}
vmType: vz
rosetta: true
mountType: virtiofs
mountInotify: true
cpuType: ""
provision: []
sshConfig: true
mounts: []
env: {}
$

Reproduction Steps

  1. Start colima with rosetta activated (as per described config)
  2. run docker run -it --rm mysql:5.7
  3. observe rosetta crashing

Expected behaviour

A running mysql 5.7 container

Additional context

It used to work in Colima 0.5.6

@lejoko
Copy link
Author

lejoko commented Nov 13, 2023

Tested with (just upgraded) Colima 0.6.1 in the same conditions as above and nothing changed.

@abiosoft
Copy link
Owner

This actually worked for me.

docker run -it --rm --platform linux/amd64 mysql:5.7

@lejoko
Copy link
Author

lejoko commented Nov 13, 2023

I'm on a M2 MacBook Pro With Ventura 13.6.2, all updates applied to both system and brew. Are you maybe on Sonoma ? I was reluctant to upgrade to Sonoma...

@abiosoft abiosoft added the not yet reproduced The issue reported is not yet experienced by someone else label Nov 13, 2023
@abiosoft
Copy link
Owner

@lejoko ideally you should specify the --platform linux/amd64 flag.

@lejoko
Copy link
Author

lejoko commented Nov 13, 2023

It's the same with the --platform linux/amd64. It only removes the warning, but it still crash with the same error. On what OS version did you test ?

@abiosoft
Copy link
Owner

Sonoma 14.1 on an m1 mac mini.

@tmapes
Copy link

tmapes commented Nov 13, 2023

I ran into this on a different image (but could actually run mysql:5.7 fine) on 13.6.

Seems like it was fixed by Apple in 14.1

@lejoko
Copy link
Author

lejoko commented Nov 13, 2023

Apparently it also works for me with Sonoma 14.1.1. That specific problem seem to exist only with Ventura. I'm currently testing other potentially problematic images.

By the way, big thanks for Colima!!

@elementalvoid
Copy link

elementalvoid commented Nov 13, 2023

Someone on my team has also experienced this with an AMD64 MySQL container running on an ARM Mac and the vz/rosetta hypervisor.

There's a similar report and some good insights from another project here: utmapp/UTM#5567. They also note that Sonoma 14.1 fix!


Edit: I have also confirmed that my teammate is not on Sonoma.

@lejoko
Copy link
Author

lejoko commented Nov 14, 2023

Ok. Everything related to Colima works for me with Sonoma 14.1.1 (I still have crashes with rosetta but they're not related to Colima)

@lejoko lejoko closed this as completed Nov 14, 2023
@Westacular
Copy link

This comment indicates that the issue was fixed in UTM for a macOS 13.5.1 user by adding --preserve yes to the update-binfmts command.

The relevant Apple documentation effectively says to use --preserve yes for macOS 14 but --preserve no on macOS 13, somewhat contradicting that solution.

Colima doesn't use update-binfmts, and instead injects the equivalent string to binfmt_misc directly, here. The string it's using does not include the P flag (see docs), so it is doing the equivalent of --preserve no.

I'm curious what would happen if that were changed by adding the P flag.

Things are already working in macOS 14, where the Apple docs suggest it should be added; things aren't working in macOS 13 where the Apple docs suggest it should not be added, but anecdotally, adding it does fix this issue. 🤷

md-scalgo added a commit to neic/dotfiles that referenced this issue Dec 21, 2023
@Curtisjk
Copy link

Curtisjk commented Jan 9, 2024

I came across this issue today with colima 0.6.7 and Ventura 13.6.3, so is definitely not fixed.

Does anyone know how to apply a workaround?

@yous
Copy link

yous commented Jan 9, 2024

Direct use of lima doesn't have this issue in Ventura.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not yet reproduced The issue reported is not yet experienced by someone else
Projects
None yet
Development

No branches or pull requests

7 participants