Issues when trying to run amd64 binaries under Rosetta 2 on Linux

I am trying to run an executable on Rosetta 2 that has been compiled to run on amd64.

My current setup is:

  • MacbookPro with M2 Pro chip.
  • Docker that is running an Ubuntu 20.04 container with the virtualization features enabled and the setting on for "Use Rosetta for x86/amd64 emulation on Apple Silicon" enabled.
  • When running the application, I was initially warned about missing libs. I have added these to the container in the relevant directories and the application now has no missing deps that I can see.
  • When running the executable, I am getting the error shown below and I'm unsure how I can get past this or if I have done something wrong in the steps I have mentioned.
*** stack smashing detected ***: terminated
Aborted

As a final attempt to get this to work, I made a very simple hello world C program, this also displayed the error shown above.

I think based on the error before all libs are present that Rosetta is being called correctly and that this is not an issue with my Rosetta install.

If anyone has any suggestions it would be greatly appreciated.

From the result, it looks like it could be a mismatch between the libraries and the linker. Can you verify the linker and libc in use are compatible?

The second error could be because the libraries are not where the binary expect them to be.

I'm experiencing a similar issue on macOS Sonoma using Parallels with Ubuntu 22.04. All dependencies of the X64 binary are available but the execution fails with the following error:

2976 Illegal instruction (core dumped)

which creates a core file:

/var/lib/apport/coredump/core._media_psf_RosettaLinux_rosetta.1000.

suggesting that Rosetta is indeed used.

Any suggestion how to progress from here? Thanks!

Issues when trying to run amd64 binaries under Rosetta 2 on Linux
 
 
Q