-
-
Notifications
You must be signed in to change notification settings - Fork 12.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
(complicated) GUI applications running through Rosetta segfault #209242
Comments
Instead of I could get Chrome itself seems to also be very angry:
|
Okay, that crash seems to be a qemu bug: https://gitlab.com/qemu-project/qemu/-/issues/1147 |
@flokli I found this thread by googling '0x0000800000022800' 😄 I'm getting a very similar stack trace when doing this: $ nix shell github:oxalica/rust-overlay#packages.x86_64-linux.rust
$ cargo --version
Segmentation fault (core dumped)
$ gdb cargo
(gdb) r
Starting program: /nix/store/qz8gvkxcyiidg4rrrlgif65ca9r8xka9-rust-default-1.67.0/bin/cargo
warning: Selected architecture i386:x86-64 is not compatible with reported target architecture aarch64
warning: Architecture rejected target-supplied description
Program received signal SIGSEGV, Segmentation fault.
0x0000800000022800 in ?? ()
(gdb) b
Breakpoint 1 at 0x800000022800
(gdb) bt
#0 0x0000800000022800 in ?? ()
#1 0x00008000000766bc in ?? ()
#2 0x0000ffffffffd440 in ?? ()
#3 0x3000702d2d720030 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?) Weirdly this doesn't happen when I do also if I run the program using I'm also using the rosetta nixos module. My hypothesis is some sort of impurity that leads to an incorrect binary... |
Discovered something interesting:
It seems rosetta can't handle the interpreter being patched for dynamic libraries. Perhaps it doesn't use the We could work around this by changing the binfmt. @flokli can you try the above commands for your programs and see if that resolves things? |
@bouk what exactly should i try? I don't have a differently linked signal-desktop binary... |
Try running this:
|
Ah, you mean manually invoking the interpreter from the interpreter field... Interesting, I'll try and report back. |
Doing some
Only the first 792 bytes of the binary are
So it seems that rosetta tries to read |
I've submitted the following bug report to Apple under FB11984253:
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/running-nixos-on-macos-with-rosetta-segfaults/25351/1 |
@bouk - any progress with FB11984253 on Apple side? |
Nope, haven't heard anything from Apple. |
I gave it a try and made https://github.com/zhaofengli/rosetta-spice to patch Rosetta to fix the problem, and there is a NixOS module that will configure everything. It hooks sys_mmap to map enough of the binary until PT_INTERP. Hopefully this will all become obsolete soon - I want things to work now so I got my hands dirty 😛 As a bonus, it also allows you to use AOT without needing the host to configure it. This requires either macOS Sonoma or setting WIth AOT enabled:
|
Looks like the segfault no longer occurs on Sonoma Beta 5 (23A5312d)! If you don't want to upgrade to the beta or want to try AOT, you can use rosetta-spice to get the version (the segfault fix no longer has an effect). |
Can we confirm that this issue is indeed fixed in the released version of Sonoma, and close this issue? |
I just setup a VM running on UTM with rosetta and after installing ida-free it just works via X11 forwarding. Not sure how that affects it but seems to work just fine |
I set up a aarch64-linux graphical NixOS system (nixpkgs master) inside UTM.
Rosetta is enabled, and I can successfully run a x86_64-linux
xclock
.Most of the system is already aarch64-linux, but some applications are available for x86_64-linux only (Electron apps mostly).
I created a "forced x86_64-linux overlay" in my
overlay.nix
:… and then referred to all x86_64 only applications via
pkgsx86_64.$packageName
.Unfortunately, all these applications segfault :-/
gdb
isn't very helpful obviously:I'm somewhat suspecting some weird cross-arch graphics driver interactions, but am a bit lost. Anyone got some ideas?
cc @toonn @alyssais @sandydoo
The text was updated successfully, but these errors were encountered: