-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo build : failed to "SIGSEGV: invalid memory reference" #6489
Comments
Hm this definitely looks quite bad! This looks like both Cargo and/or rustc may be segfaulting. The backtrace you've got here though is from SIGUSR1 which is expected (in a rustc process). Would it be possible to get a backtrace from the actual segfault? |
(it may be best to enable core dumps and then rerun rustc and debug the core dump) |
Closing due to incomplete information. |
@dwijnand Would it be possible to reopen this issue? I'm encountering this error consistently when attempting to do a I've observed this on nightlies goes back to at least nightly-2018-12-26, but also the most recent nightly-2019-03-1. I'm using macOS 10.12.6. I'd be happy to provide more information, though currently as @alexcrichton mentions, I'm only seeing the backtrace for the SIGUSR1 signal, not the original SIGSEGV. How might I use lldb to get the backtrace for the SIGSEGV signal? At the moment I'm doing |
Sure! Have you tried enabling core dumps? |
@dwijnand I was able to generate a core dump for the crash. Viewing the backtrace of the core dump in LLDB doesn't seem to include any other information than what I saw when I used lldb to debug the running process. Is there some something specific I might look for within the core dump which would help narrow this down? Edit: I realized the problem was likely in a different thread. Of the 6 threads recorded in the core dump, only one wasn't within libsystem_kernel.dylib. It's backtrace is here: https://gist.github.com/ConnorGray/681e22756b147a4e8afa1b90447d6d4b |
This seems to be related to LTO. I noticed that setting |
I'm seeing this too. Some information (OSX 10.14.3) cargo trace
So I think that it's in rustc...
|
I'm getting this on raspi when doing
I can provide any other info if you tell me how to get it :) |
@cztomsik Have you tried getting a core dump? Can you tell if it is |
@ehuss that helped, thank you! |
Same problem here with RPi4. @ehuss's suggestion worked: [profile.release]
codegen-units=1 |
ARM toolchain issue has been fixed on nightly so OP issue cause is still unknown. |
@mati865 FWIW I was getting this error on nightly while attempting to build a project.
|
Had this error only when compiling with --release in a Raspberry Pi 3 with a 64 bits kernel. |
for Raspberry Pi 1 Model B Rev 2, armv6l add codegen-units=1 in Cargo.toml, for me this dont work:
|
I'm closing this as it seems like all of these are issues with rustc itself encountering a seg fault, not cargo. If anyone runs into issues with rustc crashing, I encourage you to file an issue at https://github.com/rust-lang/rust/issues. |
This code compiles well:
Here are 2030 dereference operations. But 2031 operation (one more *&) raise an error SIGSEGV: invalid memory reference. |
Problem
I made new project A by using cargo new A, and then cd into A, there was an error when execute cargo build as shown below:
Steps
Possible Solution(s)
Notes
Output of
cargo version
:The text was updated successfully, but these errors were encountered: