Skip to content

Getting SIGSEGV with Rust 1.47.0 on macos #77849

Closed as not planned
Closed as not planned
@sagacity

Description

@sagacity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-spuriousArea: Spurious failures in builds (spuriously == for no apparent reason)C-bugCategory: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcE-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.O-macosOperating system: macOST-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions