Skip to content
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

"rustc" received signal SIGSEGV, Segmentation fault. #79350

Closed
haraldh opened this issue Nov 23, 2020 · 1 comment · Fixed by #79411
Closed

"rustc" received signal SIGSEGV, Segmentation fault. #79350

haraldh opened this issue Nov 23, 2020 · 1 comment · Fixed by #79411
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-naked Area: #[naked], prologue and epilogue-free, functions, https://git.io/vAzzS C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@haraldh
Copy link
Contributor

haraldh commented Nov 23, 2020

Code

$ git clone https://github.com/enarx/enarx-keepldr
$ cd enarx-keepldr/internal/shim-sev
$ cargo build --release

error: could not compile `shim-sev`

Caused by:
  process didn't exit successfully: `rustc --crate-name shim_sev --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C panic=abort -C lto -C codegen-units=1 -C debuginfo=1 -C metadata=93145a0a19b9eb83 -C extra-filename=-93145a0a19b9eb83 --out-dir /home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps -L dependency=/home/harald/enarx-keepldr/internal/shim-sev/target/release/deps --extern array_const_fn_init=/home/harald/enarx-keepldr/internal/shim-sev/target/release/deps/libarray_const_fn_init-905103751e9eb1a0.so --extern compiler_builtins=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps/libcompiler_builtins-651143acb5e6182c.rlib --extern crt0stack=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps/libcrt0stack-9bef3e32b96fe077.rlib --extern goblin=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps/libgoblin-de9034623bdae608.rlib --extern libc=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps/liblibc-af38e4414248e0c7.rlib --extern lset=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps/liblset-043238506a29c0f5.rlib --extern nbytes=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps/libnbytes-93811dbcb41a13d4.rlib --extern primordial=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps/libprimordial-e18cc863ec9a940f.rlib --extern rcrt1=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps/librcrt1-632fb966fbd65d91.rlib --extern sallyport=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps/libsallyport-2aeba89cd68d5ac9.rlib --extern spinning=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps/libspinning-d441abb5ceb4336a.rlib --extern syscall=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps/libsyscall-9cd8f6736785a119.rlib --extern untrusted=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps/libuntrusted-5d7147986543cd15.rlib --extern x86_64=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/deps/libx86_64-2dc4159d46ccade0.rlib -C relocation-model=pic -C 'link-args=-Wl,--sort-section=alignment -nostartfiles' -C link-self-contained=no -C force-frame-pointers=yes -L native=/home/harald/enarx-keepldr/internal/shim-sev/target/x86_64-unknown-linux-musl/release/build/shim-sev-28519de2e5db2360/out -l static=asm` 

(signal: 11, SIGSEGV: invalid memory reference)

Meta

rustc --version --verbose:

rustc 1.50.0-nightly (a0d664bae 2020-11-22)
binary: rustc
commit-hash: a0d664bae6ca79c54cc054aa2403198e105190a2
commit-date: 2020-11-22
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly

Error output

gdb


Thread 6 "rustc" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffec97f640 (LWP 16168)]
0x00007ffff28a4f5a in llvm::X86TargetLowering::isZExtFree(llvm::SDValue, llvm::EVT) const ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-11-rust-1.50.0-nightly.so
(gdb) bt
#0  0x00007ffff28a4f5a in llvm::X86TargetLowering::isZExtFree(llvm::SDValue, llvm::EVT) const ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-11-rust-1.50.0-nightly.so
#1  0x00007ffff0a1f317 in llvm::RegsForValue::getCopyToRegs(llvm::SDValue, llvm::SelectionDAG&, llvm::SDLoc const&, llvm::SDValue&, llvm::SDValue*, llvm::Value const*, llvm::ISD::NodeType) const ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-11-rust-1.50.0-nightly.so
#2  0x00007ffff0a4582d in llvm::SelectionDAGBuilder::visitInlineAsm(llvm::CallBase const&) ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-11-rust-1.50.0-nightly.so
#3  0x00007ffff0a22867 in llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-11-rust-1.50.0-nightly.so
#4  0x00007ffff0ae24fe in llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void>, false, true>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void>, false, true>, bool&) ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-11-rust-1.50.0-nightly.so
#5  0x00007ffff0ae1b77 in llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-11-rust-1.50.0-nightly.so
#6  0x00007ffff0ade926 in llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-11-rust-1.50.0-nightly.so
#7  0x00007ffff27fda77 in (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-11-rust-1.50.0-nightly.so
#8  0x00007ffff064778e in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-11-rust-1.50.0-nightly.so
#9  0x00007ffff0421fd2 in llvm::FPPassManager::runOnFunction(llvm::Function&) ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-11-rust-1.50.0-nightly.so
#10 0x00007ffff04289e3 in llvm::FPPassManager::runOnModule(llvm::Module&) ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-11-rust-1.50.0-nightly.so
#11 0x00007ffff0422a2a in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-11-rust-1.50.0-nightly.so
#12 0x00007ffff4019130 in LLVMRustWriteOutputFile ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-4f0cc9f50e53f0ba.so
#13 0x00007ffff3f4d10c in rustc_codegen_llvm::back::write::write_output_file ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-4f0cc9f50e53f0ba.so
#14 0x00007ffff3f5192f in rustc_codegen_llvm::back::write::codegen ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-4f0cc9f50e53f0ba.so
#15 0x00007ffff3f32b6b in rustc_codegen_ssa::back::write::finish_intra_module_work ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-4f0cc9f50e53f0ba.so
#16 0x00007ffff3f2b937 in rustc_codegen_ssa::back::write::execute_work_item ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-4f0cc9f50e53f0ba.so
#17 0x00007ffff3e16ebf in std::sys_common::backtrace::__rust_begin_short_backtrace ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-4f0cc9f50e53f0ba.so
#18 0x00007ffff3e1ce4d in core::ops::function::FnOnce::call_once{{vtable-shim}} ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-4f0cc9f50e53f0ba.so
#19 0x00007ffff327ac6a in alloc::boxed::{{impl}}::call_once<(),FnOnce<()>,alloc::alloc::Global> ()
    at /rustc/a0d664bae6ca79c54cc054aa2403198e105190a2/library/alloc/src/boxed.rs:1318
#20 alloc::boxed::{{impl}}::call_once<(),alloc::boxed::Box<FnOnce<()>, alloc::alloc::Global>,alloc::alloc::Global> ()
    at /rustc/a0d664bae6ca79c54cc054aa2403198e105190a2/library/alloc/src/boxed.rs:1318
#21 std::sys::unix::thread::{{impl}}::new::thread_start () at library/std/src/sys/unix/thread.rs:71
#22 0x00007ffff319b3f9 in start_thread () from /lib64/libpthread.so.0
#23 0x00007ffff30b6903 in clone () from /lib64/libc.so.6

@haraldh haraldh added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 23, 2020
@haraldh
Copy link
Contributor Author

haraldh commented Nov 23, 2020

@jonas-schievink jonas-schievink added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-naked Area: #[naked], prologue and epilogue-free, functions, https://git.io/vAzzS requires-nightly This issue requires a nightly compiler in some way. labels Nov 23, 2020
@bors bors closed this as completed in b48cafd Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-naked Area: #[naked], prologue and epilogue-free, functions, https://git.io/vAzzS C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants