rust-lang / cargo

The Rust package manager
https://doc.rust-lang.org/cargo
Apache License 2.0
12.8k stars 2.43k forks source link

cargo build : failed to "SIGSEGV: invalid memory reference" #6489

Closed magj2006 closed 4 years ago

magj2006 commented 5 years ago

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:

$ cargo build
   Compiling A v0.1.0 (/app01/users/magj/project/A)                                                                                                      
error: Could not compile `A`.                                                                                                                                             

To learn more, run the command again with --verbose.
$ cargo fix
    Checking A v0.1.0 (/app01/users/magj/project/A)                                                                                                      
child failed with signal `11`                                                                                                                                             
error: Could not compile `A`.                                                                                                                                             
warning: build failed, waiting for other jobs to finish...
child failed with signal `11`                                                                                                                                             
error: Could not compile `A`.                                                                                                                                             

To learn more, run the command again with --verbose.
$ cargo build --verbose
   Compiling A v0.1.0 (/app01/users/magj/project/A)                                                                                                      
     Running `rustc --edition=2018 --crate-name A src/main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=f597d7ad360532a8 -C extra-filename=-f597d7ad360532a8 --out-dir /app01//users/magj/project/A/target/debug/deps -C incremental=/app01/users/magj/project/A/target/debug/incremental -L dependency=/app01/users/magj/project/A/target/debug/deps`
error: Could not compile `A`.                                                                                                                                             

Caused by:
  process didn't exit successfully: `rustc --edition=2018 --crate-name A src/main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=f597d7ad360532a8 -C extra-filename=-f597d7ad360532a8 --out-dir /app01/users/magj/project/A/target/debug/deps -C incremental=/app01/users/magj/project/A/target/debug/incremental -L dependency=/app01/users/magj/project/A/target/debug/deps` (signal: 11, SIGSEGV: invalid memory reference)

$ gdb --args cargo build
GNU gdb (GDB) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from cargo...done.
(gdb) run
Starting program: /app01/users/magj/bin/cargo build
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x2aaaacc00700 (LWP 56200)]                                                                                                                                   
[New Thread 0x2aaaace01700 (LWP 56201)]
   Compiling A v0.1.0 (/app01/users/magj/project/A)
[Thread 0x2aaaace01700 (LWP 56201) exited]                                                                                                                                

Program received signal SIGUSR1, User defined signal 1.
[Switching to Thread 0x2aaaacc00700 (LWP 56200)]
0x00002aaaab35b6d5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
(gdb) bt
#0  0x00002aaaab35b6d5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x0000555555e15163 in std::sys::unix::condvar::Condvar::wait::he5d25300ddf74601 () at libstd/sys/unix/condvar.rs:80
#2  std::sys_common::condvar::Condvar::wait::h36b32ede1d96b90b () at libstd/sys_common/condvar.rs:51
#3  std::sync::condvar::Condvar::wait::h4bc1b24c6087215a () at libstd/sync/condvar.rs:214
#4  std::thread::park::h4316a33db2f197df () at libstd/thread/mod.rs:820
#5  0x0000555555e0f892 in std::sync::mpsc::blocking::WaitToken::wait::hd5c4ebd205aa384b () at libstd/sync/mpsc/blocking.rs:81
#6  0x0000555555a40acd in _$LT$std..sync..mpsc..oneshot..Packet$LT$T$GT$$GT$::recv::hf03aac5aa501ba7e ()
#7  0x0000555555a3fa18 in _$LT$std..sync..mpsc..IntoIter$LT$T$GT$$u20$as$u20$core..iter..iterator..Iterator$GT$::next::h85a8d2011d6296d2 ()
#8  0x0000555555a435cd in std::sys_common::backtrace::__rust_begin_short_backtrace::hf94da93f63b244bf ()
#9  0x0000555555a4384e in std::panicking::try::do_call::hb9f2e6075a7c45ed ()
#10 0x0000555555e3830a in __rust_maybe_catch_panic () at libpanic_unwind/lib.rs:102
#11 0x0000555555a3c86f in _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::h517f8682259ec2ba ()
#12 0x0000555555e21f2e in _$LT$alloc..boxed..Box$LT$$LP$dyn$u20$alloc..boxed..FnBox$LT$A$C$$u20$Output$u3d$R$GT$$u20$$u2b$$u20$$u27$a$RP$$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::he3acfc8f1203786f () at liballoc/boxed.rs:682
#13 std::sys_common::thread::start_thread::h5213f803a61d7811 () at libstd/sys_common/thread.rs:24
#14 0x0000555555e0e396 in std::sys::unix::thread::Thread::new::thread_start::he89121f566d2a8c7 () at libstd/sys/unix/thread.rs:90
#15 0x00002aaaab357dc5 in start_thread () from /lib64/libpthread.so.0
#16 0x00002aaaab8781cd in clone () from /lib64/libc.so.6

Steps

Possible Solution(s)

Notes

Output of cargo version:

$ uname -a
Linux cs-test-app1 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux
$ cargo --version
cargo 1.31.0 (339d9f9c8 2018-11-16)
$ rustc --version
rustc 1.31.0 (abe02cefd 2018-12-04)

$ cat Cargo.toml 
[package]
name = "A"
version = "0.1.0"
authors = ["bill"]
edition = "2018"

[dependencies]
alexcrichton commented 5 years ago

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?

alexcrichton commented 5 years ago

(it may be best to enable core dumps and then rerun rustc and debug the core dump)

dwijnand commented 5 years ago

Closing due to incomplete information.

ConnorGray commented 5 years ago

@dwijnand Would it be possible to reopen this issue? I'm encountering this error consistently when attempting to do a --release build.

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 $ lldb cargo -- build --release.

dwijnand commented 5 years ago

Sure! Have you tried enabling core dumps?

ConnorGray commented 5 years ago

@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

ConnorGray commented 5 years ago

This seems to be related to LTO. I noticed that setting lto = false in Cargo.toml tended to reduce the likelihood that rustc would crash (though it didn't eliminate the crash completely).

gpit2286 commented 5 years ago

I'm seeing this too. Some information (OSX 10.14.3)

cargo trace

(lldb) bt all
  thread #2, queue = 'com.apple.main-thread'
    frame #0: 0x00007fff6ec527de libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff6ed0c593 libsystem_pthread.dylib`_pthread_cond_wait + 724
    frame #2: 0x00000001007aff80 cargo`std::sys::unix::condvar::Condvar::wait_timeout::hc1bbc99fd3616761 + 208
    frame #3: 0x000000010079cb68 cargo`std::thread::park_timeout::hb04c910dfbcca186 + 248
    frame #4: 0x00000001007a9f57 cargo`std::sync::mpsc::blocking::WaitToken::wait_max_until::he5aa9b5001bd097a + 87
    frame #5: 0x0000000100789da5 cargo`_$LT$std..sync..mpsc..oneshot..Packet$LT$T$GT$$GT$::recv::h5797dcd09ce9dbf1 + 85
    frame #6: 0x00000001007889c5 cargo`_$LT$std..sync..mpsc..Receiver$LT$T$GT$$GT$::recv_timeout::h97a2cb15c668a984 + 549
    frame #7: 0x0000000100787806 cargo`jobserver::imp::Helper::join::he28af5f51c10e586 + 102
    frame #8: 0x0000000100784a7f cargo`_$LT$jobserver..HelperThread$u20$as$u20$core..ops..drop..Drop$GT$::drop::hc05c5ae4d205558f + 191
    frame #9: 0x00000001002b1ed2 cargo`core::ptr::real_drop_in_place::h9487410ee9109221 + 18
    frame #10: 0x00000001002bfdef cargo`cargo::core::compiler::context::Context::compile::h12168cdbdc2cfe4e + 6207
    frame #11: 0x00000001000d9f33 cargo`cargo::ops::cargo_compile::compile_ws::hc1a6bb0de8c384aa + 14787
    frame #12: 0x00000001000d652a cargo`cargo::ops::cargo_compile::compile::ha69a636edc80ac08 + 122
    frame #13: 0x00000001000467a2 cargo`cargo::commands::build::exec::h80144508ef32210f + 578
    frame #14: 0x000000010001129b cargo`cargo::cli::main::h23579e2f5e22ae84 + 5563
    frame #15: 0x0000000100029e7b cargo`cargo::main::hafdbb414b27f444c + 235
    frame #16: 0x00000001000200f6 cargo`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h74b219aa195d0f6c + 6
    frame #17: 0x00000001007ade98 cargo`std::panicking::try::do_call::h1543c64bbfd6c027 + 24
    frame #18: 0x00000001007b905f cargo`__rust_maybe_catch_panic + 31
    frame #19: 0x00000001007ae97e cargo`std::rt::lang_start_internal::hd070a182d6176167 + 542
    frame #20: 0x000000010002c469 cargo`main + 41
    frame #21: 0x0000000100001034 cargo`start + 52
  thread #5
    frame #0: 0x00007fff6ec50b6a libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x00007fff6ed08630 libsystem_pthread.dylib`_pthread_wqthread + 446
    frame #2: 0x00007fff6ed08405 libsystem_pthread.dylib`start_wqthread + 13
* thread #6, stop reason = signal SIGUSR1
  * frame #0: 0x00007fff6ed0c59c libsystem_pthread.dylib`_pthread_cond_wait + 733
    frame #1: 0x000000010079c842 cargo`std::thread::park::h3d770211b4a430da + 242
    frame #2: 0x00000001007a9ec1 cargo`std::sync::mpsc::blocking::WaitToken::wait::hb94190616ee3cc2d + 49
    frame #3: 0x00000001007830c9 cargo`_$LT$std..sync..mpsc..stream..Packet$LT$T$GT$$GT$::recv::h933a2feeca24b3b0 + 489
    frame #4: 0x0000000100788be2 cargo`_$LT$std..sync..mpsc..Receiver$LT$T$GT$$GT$::recv::h45df0b1664903370 (.llvm.17736806307366420415) + 210
    frame #5: 0x000000010078ad59 cargo`std::sys_common::backtrace::__rust_begin_short_backtrace::h0c3d1717295deb13 + 137
    frame #6: 0x0000000100784c40 cargo`std::panicking::try::do_call::hb3dd956c0e1b3857 (.llvm.4514649043081763802) + 80
    frame #7: 0x00000001007b905f cargo`__rust_maybe_catch_panic + 31
    frame #8: 0x00000001007857c6 cargo`_$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::hd4475af79a24e5e9 + 230
    frame #9: 0x00000001007b84dc cargo`std::sys::unix::thread::Thread::new::thread_start::hc3f61f8af56a1b60 + 140
    frame #10: 0x00007fff6ed09305 libsystem_pthread.dylib`_pthread_body + 126
    frame #11: 0x00007fff6ed0c26f libsystem_pthread.dylib`_pthread_start + 70
    frame #12: 0x00007fff6ed08415 libsystem_pthread.dylib`thread_start + 13

So I think that it's in rustc...

* thread #3, name = 'rustc', stop reason = EXC_BAD_ACCESS (code=1, address=0x5728156b0)
    frame #0: 0x0000000102677887 librustc-79c48485db1a4136.dylib`rustc::ty::context::TyCtxt::_intern_substs::h679a8dc06bc63caf + 1767
librustc-79c48485db1a4136.dylib`rustc::ty::context::TyCtxt::_intern_substs::h679a8dc06bc63caf:
->  0x102677887 <+1767>: cmpq   %r13, (%rax)
    0x10267788a <+1770>: jne    0x1026778b0               ; <+1808>
    0x10267788c <+1772>: xorl   %ecx, %ecx
    0x10267788e <+1774>: nop    
Target 0: (rustc) stopped.
(lldb) bt all
  thread #2, queue = 'com.apple.main-thread'
    frame #0: 0x00007fff6ec5194e libsystem_kernel.dylib`__ulock_wait + 10
    frame #1: 0x00007fff6ed0d70a libsystem_pthread.dylib`_pthread_join + 356
    frame #2: 0x00000001041bde10 libstd-1590f05cd6cedb39.dylib`std::sys::unix::thread::Thread::join::h3ad7cf3e5cdcf27a + 16
    frame #3: 0x000000010037fcb2 librustc_driver-65d0203648e647d9.dylib`_$LT$std..thread..JoinHandle$LT$T$GT$$GT$::join::hf17ec97feca578d3 + 66
    frame #4: 0x00000001003da451 librustc_driver-65d0203648e647d9.dylib`rustc_driver::run::he176119423bf4b49 + 2273
    frame #5: 0x00000001003e690e librustc_driver-65d0203648e647d9.dylib`rustc_driver::main::hc8d9d73a2f93f66c + 14
    frame #6: 0x0000000100001526 rustc`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hce1626de3dbfa00c + 6
    frame #7: 0x00000001041aeac8 libstd-1590f05cd6cedb39.dylib`std::panicking::try::do_call::h1543c64bbfd6c027 + 24
    frame #8: 0x00000001041bef8f libstd-1590f05cd6cedb39.dylib`__rust_maybe_catch_panic + 31
    frame #9: 0x00000001041af5ae libstd-1590f05cd6cedb39.dylib`std::rt::lang_start_internal::hd070a182d6176167 + 542
    frame #10: 0x0000000100001589 rustc`main + 41
    frame #11: 0x0000000100001514 rustc`start + 52
* thread #3, name = 'rustc', stop reason = EXC_BAD_ACCESS (code=1, address=0x5728156b0)
  * frame #0: 0x0000000102677887 librustc-79c48485db1a4136.dylib`rustc::ty::context::TyCtxt::_intern_substs::h679a8dc06bc63caf + 1767
    frame #1: 0x0000000102a77d6c librustc-79c48485db1a4136.dylib`_$LT$core..result..Result$LT$T$C$$u20$E$GT$$u20$as$u20$rustc..ty..context..InternIteratorElement$LT$T$C$$u20$R$GT$$GT$::intern_with::h1db39c1ad2928bb5 + 492
    frame #2: 0x0000000102a770ff librustc-79c48485db1a4136.dylib`_$LT$rustc..ty..sty..TraitRef$LT$$u27$tcx$GT$$u20$as$u20$rustc..ty..relate..Relate$LT$$u27$tcx$GT$$GT$::relate::h9c801be3e38ec0ce + 287
    frame #3: 0x000000010297245c librustc-79c48485db1a4136.dylib`rustc::infer::InferCtxt::commit_if_ok::h96d51c49c95bf6fa + 236
    frame #4: 0x0000000102b2ae58 librustc-79c48485db1a4136.dylib`rustc::traits::select::SelectionContext::match_impl::h1ff7adcc862c0121 + 2088
    frame #5: 0x0000000102973117 librustc-79c48485db1a4136.dylib`rustc::infer::InferCtxt::in_snapshot::h5fda6c4cf5ee981c + 103
    frame #6: 0x0000000102b25bef librustc-79c48485db1a4136.dylib`rustc::traits::select::SelectionContext::confirm_candidate::hb033a3e14ab5b05e + 3471
    frame #7: 0x0000000102b1c767 librustc-79c48485db1a4136.dylib`rustc::traits::select::SelectionContext::select::h49180dc77d2c119a + 247
    frame #8: 0x00000001027e2c7d librustc-79c48485db1a4136.dylib`_$LT$rustc_data_structures..obligation_forest..ObligationForest$LT$O$GT$$GT$::process_obligations::h72c4bf8fd8b5664b + 2685
    frame #9: 0x0000000102a7065d librustc-79c48485db1a4136.dylib`_$LT$rustc..traits..fulfill..FulfillmentContext$LT$$u27$tcx$GT$$u20$as$u20$rustc..traits..engine..TraitEngine$LT$$u27$tcx$GT$$GT$::select_where_possible::hb6b0305e429ebb99 + 253
    frame #10: 0x0000000100f2d545 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::select_obligations_where_possible::hc0d04459fe1f43e0 + 101
    frame #11: 0x0000000100f3077e librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::expected_inputs_for_expected_output::h3786bf8c08a7233b + 174
    frame #12: 0x0000000100f2dd33 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_method_argument_types::h9b1a6f6082b4f2de + 611
    frame #13: 0x0000000100f356d1 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_kind::h5d4ee71274674291 (.llvm.12095338763138991660) + 15681
    frame #14: 0x0000000100f318e9 librustc    frame #14: 0x0000000100f318e9 librustc    frame #14: 0x0000000100f318e9 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs::ha53b308b4d6fe823 (.llvm.12095338763138991660) + 105
    frame #15: 0x0000000100f31ff6 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_kind::h5d4ee71274674291 (.llvm.12095338763138991660) + 1638
    frame #16: 0x0000000100f318e9 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs::ha53b308b4d6fe823 (.llvm.12095338763138991660) + 105
    frame #17: 0x0000000100f31ff6 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_kind::h5d4ee71274674291 (.llvm.12095338763138991660) + 1638
    frame #18: 0x0000000100f318e9 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs::ha53b308b4d6fe823 (.llvm.12095338763138991660) + 105
    frame #19: 0x0000000100f31ff6 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_kind::h5d4ee71274674291 (.llvm.12095338763138991660) + 1638
    frame #20: 0x0000000100f318e9 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs::ha53b308b4d6fe823 (.llvm.12095338763138991660) + 105
    frame #21: 0x0000000100f31ff6 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_kind::h5d4ee71274674291 (.llvm.12095338763138991660) + 1638
    frame #22: 0x0000000100f318e9 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs::ha53b308b4d6fe823 (.llvm.12095338763138991660) + 105
    frame #23: 0x0000000100f31ff6 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_kind::h5d4ee71274674291 (.llvm.12095338763138991660) + 1638
    frame #24: 0x0000000100f318e9 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs::ha53b308b4d6fe823 (.llvm.12095338763138991660) + 105
    frame #25: 0x0000000100f31ff6 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_kind::h5d4ee71274674291 (.llvm.12095338763138991660) + 1638
    frame #26: 0x0000000100f318e9 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs::ha53b308b4d6fe823 (.llvm.12095338763138991660) + 105
    frame #27: 0x0000000100f31ff6 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_kind::h5d4ee71274674291 (.llvm.12095338763138991660) + 1638
    frame #28: 0x0000000100f318e9 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs::ha53b308b4d6fe823 (.llvm.12095338763138991660) + 105
    frame #29: 0x0000000100f3cbf6 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_decl_initializer::h29bb99070d80f179 + 86
    frame #30: 0x0000000100f3ccba librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_decl_local::hd5d1a0e2b221a721 + 90
    frame #31: 0x0000000100f3cdfc librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_stmt::h9056d248799d078e + 172
    frame #32: 0x0000000100f3d2ec librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_block_with_expected::h3acf05f39908b896 + 1100
    frame #33: 0x0000000100f31b89 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_kind::h5d4ee71274674291 (.llvm.12095338763138991660) + 505
    frame #34: 0x0000000100f318e9 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs::ha53b308b4d6fe823 (.llvm.12095338763138991660) + 105
    frame #35: 0x0000000100f3098d librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::FnCtxt::check_return_expr::h2647c6452edbe870 + 93
    frame #36: 0x0000000100f1fac2 librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::check_fn::hb4561720b89d261b + 2898
    frame #37: 0x0000000100ff009a librustc_typeck-526032d939762c9a.dylib`rustc::ty::context::GlobalCtxt::enter_local::h2f85641aa5a74c46 + 3322
    frame #38: 0x0000000100f1e4ab librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::typeck_tables_of::h8ad4b41faf9df4aa (.llvm.12095338763138991660) + 571
    frame #39: 0x0000000100e7a38c librustc_typeck-526032d939762c9a.dylib`rustc::ty::query::__query_compute::typeck_tables_of::h17d23b9d4620c81a + 124
    frame #40: 0x0000000100f4a52f librustc_typeck-526032d939762c9a.dylib`rustc::ty::query::_$LT$impl$u20$rustc..ty..query..config..QueryAccessors$LT$$u27$tcx$GT$$u20$for$u20$rustc..ty..query..queries..typeck_tables_of$LT$$u27$tcx$GT$$GT$::compute::h47fa829b82c3775a + 31
    frame #41: 0x0000000100ee40ae librustc_typeck-526032d939762c9a.dylib`rustc::dep_graph::graph::DepGraph::with_task_impl::hd219c1fcc8f021d6 (.llvm.7198567315042786583) + 494
    frame #42: 0x0000000100f6157c librustc_typeck-526032d939762c9a.dylib`rustc::ty::query::plumbing::_$LT$impl$u20$rustc..ty..context..TyCtxt$LT$$u27$a$C$$u20$$u27$gcx$C$$u20$$u27$tcx$GT$$GT$::get_query::h0d66f219efd6849b + 4444
    frame #43: 0x0000000101008756 librustc_typeck-526032d939762c9a.dylib`rustc::ty::_$LT$impl$u20$rustc..ty..context..TyCtxt$LT$$u27$a$C$$u20$$u27$gcx$C$$u20$$u27$tcx$GT$$GT$::par_body_owners::hd438beb4b1cd86b1 + 214
    frame #44: 0x0000000100f1df8e librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check::typeck_item_bodies::hcf863fef1ee22fad (.llvm.12095338763138991660) + 62
    frame #45: 0x0000000100e7a7e7 librustc_typeck-526032d939762c9a.dylib`rustc::ty::query::__query_compute::typeck_item_bodies::h8e9c107295a74344 + 119
    frame #46: 0x0000000100f4a61c librustc_typeck-526032d939762c9a.dylib`rustc::ty::query::_$LT$impl$u20$rustc..ty..query..config..QueryAccessors$LT$$u27$tcx$GT$$u20$for$u20$rustc..ty..query..queries..typeck_item_bodies$LT$$u27$tcx$GT$$GT$::compute::h6e0866654ca3630b + 28
    frame #47: 0x0000000100ed9df1 librustc_typeck-526032d939762c9a.dylib`rustc::dep_graph::graph::DepGraph::with_task_impl::h488c09e5cdd42279 (.llvm.7198567315042786583) + 481
    frame #48: 0x0000000100fd7780 librustc_typeck-526032d939762c9a.dylib`rustc::ty::query::plumbing::_$LT$impl$u20$rustc..ty..context..TyCtxt$LT$$u27$a$C$$u20$$u27$gcx$C$$u20$$u27$tcx$GT$$GT$::get_query::hcad58674cbd45149 + 14160
    frame #49: 0x0000000100ea8bcb librustc_typeck-526032d939762c9a.dylib`rustc::util::common::time::h947391bb1a0b9dba + 75
    frame #50: 0x000000010104eaae librustc_typeck-526032d939762c9a.dylib`rustc_typeck::check_crate::h7b968271d98fd777 + 702
    frame #51: 0x000000010061bdc5 librustc_interface-5137221809cd46f8.dylib`rustc_interface::passes::analysis::h127b13de301f28b2 + 229
    frame #52: 0x0000000100378af3 librustc_driver-65d0203648e647d9.dylib`rustc::ty::query::__query_compute::analysis::h54869d706e38fe8d + 115
    frame #53: 0x000000010039e31c librustc_driver-65d0203648e647d9.dylib`rustc::ty::query::_$LT$impl$u20$rustc..ty..query..config..QueryAccessors$LT$$u27$tcx$GT$$u20$for$u20$rustc..ty..query..queries..analysis$LT$$u27$tcx$GT$$GT$::compute::hcbffa61282cdb50c + 28
    frame #54: 0x00000001003cb5f1 librustc_driver-65d0203648e647d9.dylib`rustc::dep_graph::graph::DepGraph::with_task_impl::h6d030d2fdcb32de6 (.llvm.9498519978283708487) + 481
    frame #55: 0x00000001003a426b librustc_driver-65d0203648e647d9.dylib`rustc::ty::query::plumbing::_$LT$impl$u20$rustc..ty..context..TyCtxt$LT$$u27$a$C$$u20$$u27$gcx$C$$u20$$u27$tcx$GT$$GT$::get_query::haa9dbb8cae47a270 + 5195
    frame #56: 0x0000000100453b4c librustc_driver-65d0203648e647d9.dylib`_$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::with::he5f67a92c22e25f6 + 604
    frame #57: 0x00000001003a9565 librustc_driver-65d0203648e647d9.dylib`rustc::ty::context::TyCtxt::create_and_enter::h228d09a0fd825652 + 7813
    frame #58: 0x00000001004455e1 librustc_driver-65d0203648e647d9.dylib`rustc_driver::driver::compile_input::h91c41fba4f0f4269 + 15073
    frame #59: 0x00000001003dba6f librustc_driver-65d0203648e647d9.dylib`rustc_driver::run_compiler_with_pool::hd528f674eaf2dfeb + 4207
    frame #60: 0x00000001003b70ec librustc_driver-65d0203648e647d9.dylib`_$LT$scoped_tls..ScopedKey$LT$T$GT$$GT$::set::h7de35e842336308a + 316
    frame #61: 0x00000001003da8f9 librustc_driver-65d0203648e647d9.dylib`rustc_driver::run_compiler::h5a60e5876527dca4 + 377
    frame #62: 0x00000001003cbc52 librustc_driver-65d0203648e647d9.dylib`syntax::with_globals::h831f95ff6d13caff + 418
    frame #63: 0x00000001041bef8f libstd-1590f05cd6cedb39.dylib`__rust_maybe_catch_panic + 31
    frame #64: 0x000000010038b64e librustc_driver-65d0203648e647d9.dylib`_$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::hf4b68ed5ea158606 + 126
    frame #65: 0x00000001041bdd6c libstd-1590f05cd6cedb39.dylib`std::sys::unix::thread::Thread::new::thread_start::hc3f61f8af56a1b60 + 140
    frame #66: 0x00007fff6ed09305 libsystem_pthread.dylib`_pthread_body + 126
    frame #67: 0x00007fff6ed0c26f libsystem_pthread.dylib`_pthread_start + 70
    frame #68: 0x00007fff6ed08415 libsystem_pthread.dylib`thread_start + 13
imac:ois-api-rs kylebaldwin$ cargo --version
cargo 1.34.0-nightly (5c6aa46e6 2019-02-22)
imac:ois-api-rs kylebaldwin$ rustc --version
rustc 1.35.0-nightly (f22dca0a1 2019-03-05)
cztomsik commented 5 years ago

I'm getting this on raspi when doing --release builds

cargo --version
cargo 1.38.0 (23ef9a4ef 2019-08-20)

rustc --version
rustc 1.38.0 (625451e37 2019-09-23)

I can provide any other info if you tell me how to get it :)

ehuss commented 5 years ago

@cztomsik Have you tried getting a core dump? Can you tell if it is cargo or rustc that is crashing? If it is rustc, I would suggest filing an issue at https://github.com/rust-lang/rust/issues with any backtrace information you can provide. Have you looked at some of the open issues like https://github.com/rust-lang/rust/issues/62896/? Have you tried setting codegen-units=1?

cztomsik commented 5 years ago

@ehuss that helped, thank you!

joaomoreno commented 5 years ago

Same problem here with RPi4. @ehuss's suggestion worked:

[profile.release]
codegen-units=1
mati865 commented 5 years ago

ARM toolchain issue has been fixed on nightly so codegen-units=1 is no longer required there. If everything goes as expected next stable release will be fixed.

OP issue cause is still unknown.

radicand commented 4 years ago

@mati865 FWIW I was getting this error on nightly while attempting to build a project. codegen-units=1 solved it for me for now. This is on a 4GB Raspberry Pi 4 running an arm64 kernel.

prisma-engine $ rustup run nightly rustc --version
rustc 1.42.0-nightly (da3629b05 2019-12-29)

prisma-engine $ cargo build --release --verbose
   Compiling autocfg v0.1.7
       Fresh cfg-if v0.1.10
   Compiling libc v0.2.66
   Compiling proc-macro2 v1.0.6
     Running `rustc --crate-name autocfg /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/autocfg-0.1.7/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=22745adbf570c9f8 -C extra-filename=-22745adbf570c9f8 --out-dir /home/pi/prisma-engine/target/release/deps -L dependency=/home/pi/prisma-engine/target/release/deps --cap-lints allow`
     Running `rustc --crate-name build_script_build /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.66/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=84c1f0b90dcb183c -C extra-filename=-84c1f0b90dcb183c --out-dir /home/pi/prisma-engine/target/release/build/libc-84c1f0b90dcb183c -L dependency=/home/pi/prisma-engine/target/release/deps --cap-lints allow`
   Compiling unicode-xid v0.2.0
     Running `rustc --crate-name build_script_build --edition=2018 /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.6/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="proc-macro"' -C metadata=f5610f1708737a22 -C extra-filename=-f5610f1708737a22 --out-dir /home/pi/prisma-engine/target/release/build/proc-macro2-f5610f1708737a22 -L dependency=/home/pi/prisma-engine/target/release/deps --cap-lints allow`
     Running `rustc --crate-name unicode_xid /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-xid-0.2.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 --cfg 'feature="default"' -C metadata=bc8746146b0e988b -C extra-filename=-bc8746146b0e988b --out-dir /home/pi/prisma-engine/target/release/deps -L dependency=/home/pi/prisma-engine/target/release/deps --cap-lints allow`
error: could not compile `unicode-xid`.

Caused by:
[workspace]
  process didn't exit successfully: `rustc --crate-name unicode_xid /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-xid-0.2.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 --cfg 'feature="default"' -C metadata=bc8746146b0e988b -C extra-filename=-bc8746146b0e988b --out-dir /home/pi/prisma-engine/target/release/deps -L dependency=/home/pi/prisma-engine/target/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: could not compile `libc`.

Caused by:
  process didn't exit successfully: `rustc --crate-name build_script_build /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.66/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=84c1f0b90dcb183c -C extra-filename=-84c1f0b90dcb183c --out-dir /home/pi/prisma-engine/target/release/build/libc-84c1f0b90dcb183c -L dependency=/home/pi/prisma-engine/target/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: could not compile `proc-macro2`.

Caused by:
  process didn't exit successfully: `rustc --crate-name build_script_build --edition=2018 /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.6/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="proc-macro"' -C metadata=f5610f1708737a22 -C extra-filename=-f5610f1708737a22 --out-dir /home/pi/prisma-engine/target/release/build/proc-macro2-f5610f1708737a22 -L dependency=/home/pi/prisma-engine/target/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: could not compile `autocfg`.

Caused by:
  process didn't exit successfully: `rustc --crate-name autocfg /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/autocfg-0.1.7/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=22745adbf570c9f8 -C extra-filename=-22745adbf570c9f8 --out-dir /home/pi/prisma-engine/target/release/deps -L dependency=/home/pi/prisma-engine/target/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
JM2707 commented 4 years ago

Had this error only when compiling with --release in a Raspberry Pi 3 with a 64 bits kernel. codegen-units=1 also solved it for me. I am running rustc 1.40.

efirshik commented 4 years ago

for Raspberry Pi 1 Model B Rev 2, armv6l add codegen-units=1 in Cargo.toml, for me this dont work:

HEAD is now at ae1a3b8 Merge pull request #315 from CryZe/fix-single-line-title Compiling scopeguard v1.1.0 error: could not compile scopeguard. Caused by: process didn't exit successfully: rustc --crate-name scopeguard /home/pi/.cargo/registry/src/github.com-1ecc6 299db9ec823/scopeguard-1.1.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-ty pe lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C metadata=aaa01562cf39c493 -C extra-filenam e=-aaa01562cf39c493 --out-dir /home/pi/darksplit/livesplit-core/livesplit-core/target/release/deps -L dependency =/home/pi/darksplit/livesplit-core/livesplit-core/target/release/deps --cap-lints allow (signal: 11, SIGSEGV: i nvalid memory reference) cp: cannot stat 'target/release/liblivesplit_core.a': No such file or directory make: *** [Makefile:39: livesplit-core/liblivesplit_core.a] Error 1

Default host: arm-unknown-linux-gnueabihf
stable-arm-unknown-linux-gnueabihf (default)
rustc 1.42.0 (b8cedc004 2020-03-09)
ehuss commented 4 years ago

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.

pls-kick-me commented 2 years ago

This code compiles well:

fn main() {
    let s1 = String::from("hello");

    println!("address {}.", *&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*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