-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Frequent Killed: 9
with rust on M1 Mac
#162795
Comments
Can you replace |
I thought it might be related to my editor interacting with rust-analyzer somehow, but it looks like that's not the case: $ nix-shell --pure
[nix-shell:~/git/killed-9-example]$ cat src/main.rs
fn main() {
println!("Hello, world!");
}
[nix-shell:~/git/killed-9-example]$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.00s
Running `target/debug/killed-9-example`
Hello, world!
[nix-shell:~/git/killed-9-example]$ sed -i 's/world/you/' src/main.rs
[nix-shell:~/git/killed-9-example]$ cat src/main.rs
fn main() {
println!("Hello, you!");
}
[nix-shell:~/git/killed-9-example]$ cargo run
Compiling killed-9-example v0.1.0 (/Users/n8henrie/git/killed-9-example)
Finished dev [unoptimized + debuginfo] target(s) in 0.16s
Running `target/debug/killed-9-example`
Killed: 9
Yes: Before: [nix-shell:~/git/killed-9-example]$ rustc --version
rustc 1.58.1 After: $ sed -i 's/rustc/rustup/' shell.nix
$ echo '1.58.1' > rust-toolchain
$ nix-shell --pure
[nix-shell:~/git/killed-9-example]$ rustc --version
rustc 1.58.1 (db9d1b20b 2022-01-20)
[nix-shell:~/git/killed-9-example]$ cargo run
Compiling killed-9-example v0.1.0 (/Users/n8henrie/git/killed-9-example)
Finished dev [unoptimized + debuginfo] target(s) in 0.85s
Running `target/debug/killed-9-example`
Hello, you!
[nix-shell:~/git/killed-9-example]$ sed -i 's/you/world/' src/main.rs
[nix-shell:~/git/killed-9-example]$ cat src/main.rs
fn main() {
println!("Hello, world!");
}
[nix-shell:~/git/killed-9-example]$ cargo run
Compiling killed-9-example v0.1.0 (/Users/n8henrie/git/killed-9-example)
Finished dev [unoptimized + debuginfo] target(s) in 0.21s
Running `target/debug/killed-9-example`
Killed: 9 |
Ok. Is this not be a bug of the library/program rather than rustc/cargo? It does not look like it was cargo that was killed, but the program. You could try to attach lldb and report the backtrace to the crate author. |
Prior to your edit:
There are no external libraries or dependencies in the updated examples I've posted above. Post edit:
This is the default "hello world" provided by $ ls -A
shell.nix
$ \cat shell.nix
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
pkgs.mkShell {
nativeBuildInputs = [
cargo
cargo-edit
libiconv
openssl
pkg-config
rust-analyzer
rustup
rustfmt
darwin.apple_sdk.frameworks.Security
];
}
$ nix-shell --pure
[nix-shell:]$ cargo new foo
Created binary (application) `foo` package
[nix-shell:]$ cd foo
[nix-shell:foo]$ cargo run
Compiling foo v0.1.0 (foo)
Finished dev [unoptimized + debuginfo] target(s) in 1.01s
Running `target/debug/foo`
Hello, world!
[nix-shell:foo]$ sed -i 's/world/you/' src/main.rs
[nix-shell:foo]$ cargo run
Compiling foo v0.1.0 (foo)
Finished dev [unoptimized + debuginfo] target(s) in 0.19s
Running `target/debug/foo`
Killed: 9 |
Also, I don't see this behavior outside of $ cargo new foo
Created binary (application) `foo` package
$ cd foo/
$ cargo run
Compiling foo v0.1.0 (foo)
Finished dev [unoptimized + debuginfo] target(s) in 0.74s
Running `target/debug/foo`
Hello, world!
$ sed -i 's/world/you/' src/main.rs
$ cargo run
Compiling foo v0.1.0 (foo)
Finished dev [unoptimized + debuginfo] target(s) in 0.10s
Running `target/debug/foo`
Hello, you! |
I see. I cannot help here. I don't have the hardware to reproduce the bug. |
|
Thank you for the suggestion. I'll take a look and report back soon. |
The following lines look suspicious, but this is above my level of expertise. I don't understand why changing a single line in the source code would produce this error in nix-shell but not in MacOS.
Full output: $ log show --last 10m --debug --predicate 'eventMessage contains "killed-9-example"'
Timestamp Thread Type Activity PID TTL
2022-03-19 08:45:39.172822-0600 0x1a566 Default 0x0 0 0 kernel: (AppleMobileFileIntegrity) AMFI: '/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example' has no CMS blob?
2022-03-19 08:45:39.172829-0600 0x1a566 Default 0x0 0 0 kernel: (AppleMobileFileIntegrity) AMFI: '/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example': Unrecoverable CT signature issue, bailing out.
2022-03-19 08:45:39.173474-0600 0x1a568 Debug 0x0 0 0 kernel: (AppleSystemPolicy) Process (/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example) allowed via dev tool environment(/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal)
2022-03-19 08:45:39.173979-0600 0x1a568 Debug 0x0 0 0 kernel: (AppleSystemPolicy) Library (/nix/store/sv54j4kykmp0v3izfnd8ycl8kli4l2ij-libiconv-50/lib/libiconv.dylib) allowed in Process (/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example) via dev tool environment (/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal)
2022-03-19 08:45:39.174004-0600 0x1a568 Debug 0x0 0 0 kernel: (AppleSystemPolicy) Library (/nix/store/sv54j4kykmp0v3izfnd8ycl8kli4l2ij-libiconv-50/lib/libiconv.dylib) allowed in Process (/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example) via dev tool environment (/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal)
2022-03-19 08:45:39.174091-0600 0x1a568 Debug 0x0 0 0 kernel: (AppleSystemPolicy) Library (/nix/store/sv54j4kykmp0v3izfnd8ycl8kli4l2ij-libiconv-50/lib/libiconv-nocharset.dylib) allowed in Process (/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example) via dev tool environment (/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal)
2022-03-19 08:45:39.174114-0600 0x1a568 Debug 0x0 0 0 kernel: (AppleSystemPolicy) Library (/nix/store/sv54j4kykmp0v3izfnd8ycl8kli4l2ij-libiconv-50/lib/libiconv-nocharset.dylib) allowed in Process (/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example) via dev tool environment (/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal)
2022-03-19 08:45:39.174186-0600 0x1a568 Debug 0x0 0 0 kernel: (AppleSystemPolicy) Library (/nix/store/sv54j4kykmp0v3izfnd8ycl8kli4l2ij-libiconv-50/lib/libcharset.1.0.0.dylib) allowed in Process (/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example) via dev tool environment (/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal)
2022-03-19 08:45:39.174211-0600 0x1a568 Debug 0x0 0 0 kernel: (AppleSystemPolicy) Library (/nix/store/sv54j4kykmp0v3izfnd8ycl8kli4l2ij-libiconv-50/lib/libcharset.1.0.0.dylib) allowed in Process (/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example) via dev tool environment (/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal)
2022-03-19 08:45:54.948309-0600 0x1a86f Debug 0x0 0 0 kernel: (AppleSystemPolicy) Process (/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example) allowed via dev tool environment(/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal)
2022-03-19 08:45:54.948758-0600 0x1a86f Debug 0x0 0 0 kernel: (AppleSystemPolicy) Library (/nix/store/sv54j4kykmp0v3izfnd8ycl8kli4l2ij-libiconv-50/lib/libiconv.dylib) allowed in Process (/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example) via dev tool environment (/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal)
2022-03-19 08:45:54.948782-0600 0x1a86f Debug 0x0 0 0 kernel: (AppleSystemPolicy) Library (/nix/store/sv54j4kykmp0v3izfnd8ycl8kli4l2ij-libiconv-50/lib/libiconv.dylib) allowed in Process (/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example) via dev tool environment (/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal)
2022-03-19 08:45:54.948861-0600 0x1a86f Debug 0x0 0 0 kernel: (AppleSystemPolicy) Library (/nix/store/sv54j4kykmp0v3izfnd8ycl8kli4l2ij-libiconv-50/lib/libiconv-nocharset.dylib) allowed in Process (/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example) via dev tool environment (/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal)
2022-03-19 08:45:54.948879-0600 0x1a86f Debug 0x0 0 0 kernel: (AppleSystemPolicy) Library (/nix/store/sv54j4kykmp0v3izfnd8ycl8kli4l2ij-libiconv-50/lib/libiconv-nocharset.dylib) allowed in Process (/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example) via dev tool environment (/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal)
2022-03-19 08:45:54.948946-0600 0x1a86f Debug 0x0 0 0 kernel: (AppleSystemPolicy) Library (/nix/store/sv54j4kykmp0v3izfnd8ycl8kli4l2ij-libiconv-50/lib/libcharset.1.0.0.dylib) allowed in Process (/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example) via dev tool environment (/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal)
2022-03-19 08:45:54.948964-0600 0x1a86f Debug 0x0 0 0 kernel: (AppleSystemPolicy) Library (/nix/store/sv54j4kykmp0v3izfnd8ycl8kli4l2ij-libiconv-50/lib/libcharset.1.0.0.dylib) allowed in Process (/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example) via dev tool environment (/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal)
2022-03-19 08:45:54.949439-0600 0x1a86f Default 0x0 0 0 kernel: CODE SIGNING: cs_invalid_page(0x104ccc000): p=23225[killed-9-example] final status 0x23020200, denying page sending SIGKILL
2022-03-19 08:45:54.949452-0600 0x1a86f Default 0x0 0 0 kernel: CODE SIGNING: process 23225[killed-9-example]: rejecting invalid page at address 0x104ccc000 from offset 0x38000 in file "/Users/n8henrie/git/killed-9-example/target/debug/killed-9-example" (cs_mtime:1646679111.830753257 != mtime:1647701154.916071530) (signed:1 validated:1 tainted:1 nx:0 wpmapped:0 dirty:0 depth:0)
2022-03-19 08:45:54.949513-0600 0x1a86f Default 0x0 0 0 kernel: killed-9-example[23225] Corpse allowed 1 of 5
2022-03-19 08:45:55.486546-0600 0xa06f Default 0x0 1238 0 ReportCrash: Formulating fatal 309 report for corpse[23225] killed-9-example
2022-03-19 08:45:55.536960-0600 0x1a883 Default 0x0 23268 0 osanalyticshelper: (OSAnalytics) creating type 309 as /Users/n8henrie/Library/Logs/DiagnosticReports/.killed-9-example-2022-03-19-084555.ips
2022-03-19 08:45:55.650391-0600 0x1a883 Default 0x0 23268 0 osanalyticshelper: (OSAnalytics) Saved type '309(<private>)' report (1 of max 25) at /Users/n8henrie/Library/Logs/DiagnosticReports/killed-9-example-2022-03-19-084555.ips
2022-03-19 08:45:55.650962-0600 0x1a883 Default 0x0 23268 0 osanalyticshelper: xpc log creation type 309 result success: /Users/n8henrie/Library/Logs/DiagnosticReports/killed-9-example-2022-03-19-084555.ips
2022-03-19 08:45:55.651118-0600 0xa06f Default 0x0 1238 0 ReportCrash: (OSAnalytics) client log create type 309 result success: /Users/n8henrie/Library/Logs/DiagnosticReports/killed-9-example-2022-03-19-084555.ips
2022-03-19 08:45:55.651171-0600 0xa06f Default 0x0 1238 0 ReportCrash: no MetricKit for process killed-9-example type 309 bundleId (null)
2022-03-19 08:45:55.651405-0600 0xa06f Default 0x0 1238 7 ReportCrash: (CoreAnalytics) [com.apple.CoreAnalytics.stability-event:event-send] Sending event: com.apple.stability.crash {"exceptionCodes":"0x0000000000000032, 0x0000000104ccc000(\n 50,\n 4375494656\n)EXC_BAD_ACCESSSIGKILL (Code Signature Invalid)UNKNOWN_0x32 at 0x0000000104ccc000","incidentID":"1BCF2A6D-3234-4DF2-8E02-524D84272CF3","logwritten":1,"process":"killed-9-example","responsibleApp":"Terminal","terminationReasonExceptionCode":"0x2","terminationReasonNamespace":"CODESIGNING"}
2022-03-19 08:45:55.651663-0600 0x19e4c Default 0x0 643 7 analyticsd: [com.apple.CoreAnalytics.stability-event:event-recv] Received event: com.apple.stability.crash {"exceptionCodes":"0x0000000000000032, 0x0000000104ccc000(\n 50,\n 4375494656\n)EXC_BAD_ACCESSSIGKILL (Code Signature Invalid)UNKNOWN_0x32 at 0x0000000104ccc000","incidentID":"1BCF2A6D-3234-4DF2-8E02-524D84272CF3","logwritten":1,"process":"killed-9-example","responsibleApp":"Terminal","terminationReasonExceptionCode":"0x2","terminationReasonNamespace":"CODESIGNING"}
2022-03-19 08:45:55.656449-0600 0x19e4c Default 0x0 643 7 analyticsd: [com.apple.CoreAnalytics.stability-event:event-aggregated] Aggregated. Transform: StabilityCrashNumerator3WithBundleVersion Dirty: 1 Event: com.apple.stability.crash {"exceptionCodes":"0x0000000000000032, 0x0000000104ccc000(\n 50,\n 4375494656\n)EXC_BAD_ACCESSSIGKILL (Code Signature Invalid)UNKNOWN_0x32 at 0x0000000104ccc000","incidentID":"1BCF2A6D-3234-4DF2-8E02-524D84272CF3","logwritten":1,"process":"killed-9-example","responsibleApp":"Terminal","terminationReasonExceptionCode":"0x2","terminationReasonNamespace":"CODESIGNING","timestamp":1647701155628861}
2022-03-19 08:45:55.656556-0600 0x19e4c Default 0x0 643 7 analyticsd: [com.apple.CoreAnalytics.stability-event:event-aggregated] Aggregated. Transform: StabilityCrashNumerator3WithIncidentID Dirty: 1 Event: com.apple.stability.crash {"exceptionCodes":"0x0000000000000032, 0x0000000104ccc000(\n 50,\n 4375494656\n)EXC_BAD_ACCESSSIGKILL (Code Signature Invalid)UNKNOWN_0x32 at 0x0000000104ccc000","incidentID":"1BCF2A6D-3234-4DF2-8E02-524D84272CF3","logwritten":1,"process":"killed-9-example","responsibleApp":"Terminal","terminationReasonExceptionCode":"0x2","terminationReasonNamespace":"CODESIGNING","timestamp":1647701155628861}
2022-03-19 08:45:55.656654-0600 0x19e4c Default 0x0 643 7 analyticsd: [com.apple.CoreAnalytics.stability-event:event-aggregated] Aggregated. Transform: StabilityCrashNumerator3 Dirty: 1 Event: com.apple.stability.crash {"exceptionCodes":"0x0000000000000032, 0x0000000104ccc000(\n 50,\n 4375494656\n)EXC_BAD_ACCESSSIGKILL (Code Signature Invalid)UNKNOWN_0x32 at 0x0000000104ccc000","incidentID":"1BCF2A6D-3234-4DF2-8E02-524D84272CF3","logwritten":1,"process":"killed-9-example","responsibleApp":"Terminal","terminationReasonExceptionCode":"0x2","terminationReasonNamespace":"CODESIGNING","timestamp":1647701155628861} |
I have an M1 Mac, so I tried out your example repo, and couldn't reproduce the problem. |
@a-h thanks for chiming in! That's good to know, thanks for trying to reproduce. EDIT: Just to be sure, did you try it out a few times? It doesn't happen every time. |
@a-h Also -- multi-user install? $ nix --version
nix (Nix) 2.5pre20211007_844dd90 |
I was on I removed Nix from my Mac, and reinstalled which brought in However, still no problems for me. I tried it at least 10 times. I don't think it would make any difference about exactly which Mac I'm using, but I'm on an M1 Max MacBook Pro. I probably don't use Nix in the way it seems to be designed - to create individual, minimal, reproducible dev environments. I'm usually the only person on a team that's using it, so I mostly use it to configure my system as a global level, and use a shell.nix from time-to-time. However, my entire config is here: https://github.com/a-h/dotfiles in case there's anything useful in there for you. You don't have a virus scanner running do you? Killing a program randomly like that sounds like the sort of thing it might do. |
@n8henrie you might try updating your nix channels. I has similar issues with MacOS killing cargo cbuild due to code signing issues on the nixos-21.11 channel, but a more recent unstable worked. Unfortunately I couldn't get an example to fail with the test default.nixlet
bootstrap = import <nixpkgs> { };
stable = import
(bootstrap.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
# latest nixos-21.11 from https://channels.nix.gsc.io/nixos-21.11/history
rev = "d89f18a17e51532ed5f4d45297b0ddf11e46b9c8";
sha256 = "sha256-CbXZkiVTA0ByV/yncFHCAGIa/AfcSb0cjqzEa56rO+Y=";
# sha256 = bootstrap.lib.fakeSha256;
})
{ };
unstable = import
(bootstrap.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
# latest nixpkgs-unstable from https://channels.nix.gsc.io/nixpkgs-unstable/history
rev = "30d3d79b7d3607d56546dd2a6b49e156ba0ec634";
sha256 = "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=";
# sha256 = bootstrap.lib.fakeSha256;
})
{ };
old-unstable = import
(bootstrap.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
# latest nixpkgs-unstable from https://channels.nix.gsc.io/nixpkgs-unstable/history
rev = "d34f7085a90431b36547226735905f0bb69cbafa";
sha256 = "sha256-QqsfaWnJB4OT1ngvNnI3+dI3ByURgYNeC9vRq3AyfKw=";
# sha256 = bootstrap.lib.fakeSha256;
})
{ };
mkExample = pkgs: pkgs.callPackage "${stable.path}/pkgs/tools/video/rav1e/default.nix" {};
in
{
stable = mkExample stable;
unstable = mkExample unstable;
old-unstable = mkExample old-unstable;
}
nix build log
MacOS Crash Report
Versions
98bb5b7 is an older nixos-unstable. Why 98bb5b7? Because newer broke something else, lol (due to a different issue, maybe #160876) |
I can reproduce the problem on recent
But this only seems to be a transient error, and the resulting binary is valid if I try to run it again:
There's also been a case where the result cached on hydra is persistently invalid, but succeeds after rebuilding. Maybe it's unrelated to my reproduction. In the case where it's easily reproducible, is the resulting binary properly ad-hoc signed?
Versions
|
Ah, I wasn't persistent enough. I did think about scripting it, but didn't follow through. Using your little script, I was also able to reproduce the error after 843 times...
It seems unlikely that this is a problem with Nix though. Installing cargo etc. using an alternative mechanism, then running the same repeated test would find out. Because if it happens using a different installation mechanism, it can't be anything to do with Nix. |
Nope. Again, thanks for your efforts here.
No luck. Could using nix-darwin be an issue here? $ sudo -i nix-channel --list
darwin https://github.com/LnL7/nix-darwin/archive/master.tar.gz
nixpkgs https://nixos.org/channels/nixpkgs-unstable
$ sudo -i nix-channel --update
unpacking channels...
$ nix-shell --pure
[nix-shell:~/git/killed-9-example]$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/killed-9-example`
Killed: 9 Tried Odd, it's basically instant for me, and resulting binary is no good if I try to re-execute. Looks like codesigning worked. $ git checkout src/main.rs
Updated 0 paths from the index
$ nix-shell --pure
[nix-shell:~/git/killed-9-example]$ cargo clean
[nix-shell:~/git/killed-9-example]$ i=0; while cargo run; do sed -i "s/world[0-9]*/world$((i++))/" src/main.rs; done
Compiling killed-9-example v0.1.0 (/Users/n8henrie/git/killed-9-example)
Finished dev [unoptimized + debuginfo] target(s) in 0.50s
Running `target/debug/killed-9-example`
Hello, world!
Compiling killed-9-example v0.1.0 (/Users/n8henrie/git/killed-9-example)
Finished dev [unoptimized + debuginfo] target(s) in 0.19s
Running `target/debug/killed-9-example`
Killed: 9
[nix-shell:~/git/killed-9-example]$ ./target/debug/killed-9-example
Killed: 9
[nix-shell:~/git/killed-9-example]$ codesign
bash: codesign: command not found
[nix-shell:~/git/killed-9-example]$ exit
exit
$ codesign -vv ./target/debug/killed-9-example
./target/debug/killed-9-example: valid on disk
./target/debug/killed-9-example: satisfies its Designated Requirement I don't seem to have [nix-shell:~/git/killed-9-example]$ command -v cargo-cbuild
[nix-shell:~/git/killed-9-example]$ command -v cargo
/nix/store/sakd69ff7clis6b5w46cxjblgkl7r904-cargo-1.58.1/bin/cargo
[nix-shell:~/git/killed-9-example]$ command -v rustc
/nix/store/sfia0kg9dz6ii1i20jh14ijdpxky98sm-rustup-1.24.3/bin/rustc
[nix-shell:~/git/killed-9-example]$ exit
exit
$ codesign -vv /nix/store/sfia0kg9dz6ii1i20jh14ijdpxky98sm-rustup-1.24.3/bin/rustc
/nix/store/sfia0kg9dz6ii1i20jh14ijdpxky98sm-rustup-1.24.3/bin/rustc: code object is not signed at all
$ codesign -vv /nix/store/sakd69ff7clis6b5w46cxjblgkl7r904-cargo-1.58.1/bin/cargo
/nix/store/sakd69ff7clis6b5w46cxjblgkl7r904-cargo-1.58.1/bin/cargo: code object is not signed at all
Well I'll be darned, you're right -- same crash outside of nix. Sorry to waste so much time! I've never seen it outside of nix so I was surprised. Ends up, I think it's perhaps a problem with I've now added the toolchain file and an example crasher script to the repo, though I'm also closing the issue as it looks like a rust problem and not nix. Thanks so much to all for your help and again sorry for the time spent! |
Well, it works outside of nix now ( $ rustc --version
rustc 1.59.0 (9d1b2106e 2022-02-23)
$ nix-shell --pure
[nix-shell:~/git/killed-9-example]$ rustc --version
rustc 1.58.1
[nix-shell:~/git/killed-9-example]$ cat rust-toolchain.toml
[toolchain]
# channel = "1.58.1"
channel = "stable"
[nix-shell:~/git/killed-9-example]$ ./crashme.sh
Updated 1 path from the index
Compiling killed-9-example v0.1.0 (/Users/n8henrie/git/killed-9-example)
Finished dev [unoptimized + debuginfo] target(s) in 0.32s
Running `target/debug/killed-9-example`
Hello, world!
Compiling killed-9-example v0.1.0 (/Users/n8henrie/git/killed-9-example)
Finished dev [unoptimized + debuginfo] target(s) in 0.15s
Running `target/debug/killed-9-example`
./crashme.sh: line 10: 75979 Killed: 9 cargo run Some seemingly related issues:
I suppose I should still close, with the only pending issue being to wait for nixpkgs-unstable to update to 1.59.0? |
#165406 has the rustc update iirc. |
I'm wondering if this may have been related to using michaeleisel/zld#110 the whole time; today I started getting the same crashes outside of nix, using rustc 1.60.0. I've updated my example repo to a flake: https://github.com/n8henrie/killed-9-example Interestingly, I can run Why is that? I had thought that Should I be using something else for highly reproducibility / pure-ness with nix flakes? |
zld 1.3.4 has been released and includes a fix for this issue: https://github.com/michaeleisel/zld/releases/tag/1.3.4 |
Describe the bug
A clear and concise description of what the bug is.
I'm writing my first
shell.nix
:It runs a (currently trivial) Rust script:
The code runs and works as expected. Sometimes. Unfortunately, I find that when I make a few trivial changes,
cargo run
results inKilled: 9
.cargo clean && cargo run
and it usually works again.I made an example repo https://github.com/n8henrie/killed-9-example -- though it looks like an even more trivial example reproduces the bug (example below).
Steps To Reproduce
Steps to reproduce the behavior:
An even simpler example, with no Rust dependencies:
Expected behavior
A clear and concise description of what you expected to happen.
cargo run
works withoutKilled: 9
Screenshots
If applicable, add screenshots to help explain your problem.
I think the above examples should suffice
Notify maintainers
@Mic92 @LnL7 @zowoq
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: