-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
1.77 produced release binaries die w/ SIGKILL on macos 14.4 #122902
Comments
The issue seems to have started in $ cargo +nightly-2024-01-18 run --release
Finished release [optimized] target(s) in 0.16s
Running `target/release/demo`
Killed: 9 But this one works using $ cargo +nightly-2024-01-17 run --release
Finished release [optimized] target(s) in 0.16s
Running `target/release/demo`
Hello, world! |
I have the exact same software versions, but I am unable to reproduce this. Could you try running the binaries under |
lldb reports that it's an invalid mach-o file. $ cargo +1.77 run --release
Finished release [optimized] target(s) in 0.02s
Running `target/release/demo`
Killed: 9
$ lldb target/release/demo
(lldb) target create "target/release/demo"
Current executable set to '/Users/greg/scratch/demo/target/release/demo' (arm64).
(lldb) r
error: Malformed Mach-o file
(lldb) However, objdump seems to show that the mach-o file is fine: $ file target/release/demo
target/release/demo: Mach-O executable arm64
$ objdump -f target/release/demo
target/release/demo: file format mach-o-arm64
architecture: aarch64, flags 0x00000012:
EXEC_P, HAS_SYMS
start address 0x0000000000001ad0 lldb works with a $ cargo +1.77 run --profile dev
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
Running `target/debug/demo`
Hello, world!
$ lldb target/debug/demo
(lldb) target create "target/debug/demo"
Current executable set to '/Users/greg/scratch/demo/target/debug/demo' (arm64).
(lldb) r
Process 14925 launched: '/Users/greg/scratch/demo/target/debug/demo' (arm64)
Hello, world!
Process 14925 exited with status = 0 (0x00000000)
(lldb) |
That looks like a linker issue. Do you have any linker overrides (e.g. in |
Nothing there. I
Still see the same SIGKILL from the OP. In case it matters, on a MacBook Apple M2 Pro |
Ok, so it's the default linker. What does |
|
I have a suspicion it might involve having the wrong |
Good suspicion! Indeed, a homebrew strip is found first. However, tweaking the path doesn't seem to fix the problem: $ which strip
/opt/homebrew/opt/binutils/bin/strip
$ PATH=/usr/bin:$PATH which strip
/usr/bin/strip
$ PATH=/usr/bin:$PATH cargo +1.77 run --release
Finished release [optimized] target(s) in 0.02s
Running `target/release/demo`
Killed: 9 |
You will need to run |
UPDATE: I forgot to do a clean before re-doing the build. Indeed changing the path for strip does fix the issue: $ cargo clean
Removed 17 files, 1.0MiB total
$ PATH=/usr/bin:$PATH cargo +1.77 run --release
Compiling demo v0.1.0 (/Users/greg/scratch/demo)
Finished release [optimized] target(s) in 0.78s
Running `target/release/demo`
Hello, world! Thank you! |
It might be related to this issue: |
I think that's a different issue. The issue that @joboet and @ehuss helped track down was due to using my machine using It may be nice if cargo warned if Thanks again for the help, folks! |
Setup
This command works with
1.76
This command fails with SIGKILL with
1.77
I expected to see this happen: I expected to see "Hello, world!" printed.
Instead, this happened: The attempt to execute
target/release/demo
was killed by SIGKILL.Note: This problem only seems to happen with
--release
profile builds.cargo +1.77 run --profile dev
works fine.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: