Description
I'm getting intermittent SIGSEGV: invalid memory reference
crashes when compiling projects. This has started happening when upgrading from 1.46.0 (stable) to 1.47.0 (stable) on MacOS.
For instance, compiling the master
branch of https://github.com/gfx-rs/wgpu-rs:
cargo run --example cube
error: could not compile syn.
Caused by: process didn't exit successfully: rustc --crate-name syn --edition=2018 /Users/rjacobs/.cargo/registry/src/github.tiyicn.workers.dev-1ecc6299db9ec823/syn-1.0.31/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="extra-traits"' --cfg 'feature="full"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'feature="quote"' --cfg 'feature="visit"' -C metadata=3015984c4aad08eb -C extra-filename=-3015984c4aad08eb --out-dir /Users/rjacobs/sandbox/wgpu-rs/target/debug/deps -L dependency=/Users/rjacobs/sandbox/wgpu-rs/target/debug/deps --extern proc_macro2=/Users/rjacobs/sandbox/wgpu-rs/target/debug/deps/libproc_macro2-ca449e9a62227554.rmeta --extern quote=/Users/rjacobs/sandbox/wgpu-rs/target/debug/deps/libquote-4e89379d9f53f035.rmeta --extern unicode_xid=/Users/rjacobs/sandbox/wgpu-rs/target/debug/deps/libunicode_xid-4f1ac68564fd7c97.rmeta --cap-lints allow --cfg syn_disable_nightly_tests
(signal: 11, SIGSEGV: invalid memory reference)`
If I simply start the build again with cargo run --example cube
eventually it will compile and run correctly. Also, in the above example it's syn
that fails, but other crates may also cause the crash randomly.
Sometimes I'm also getting panics in rustc instead of SIGSEGV. I assume this is related to miscompilation in an earlier stage. I can't really add too many other details since I'm no debugging expert on MacOS but I'm happy to run some debugging commands to help.
rustc --version --verbose
:
rustc 1.47.0 (18bf6b4 2020-10-07)
binary: rustc
commit-hash: 18bf6b4
commit-date: 2020-10-07
host: x86_64-apple-darwin
release: 1.47.0
LLVM version: 11.0