Skip to content

rustc segfault #70117

Closed
Closed

Description

@haraldh

Code

Steps to reproduce are in this comment
and in this comment

Meta

rustc --version --verbose:

rustc 1.42.0 (b8cedc004 2020-03-09)
binary: rustc
commit-hash: b8cedc00407a4c56a3bda1ed605c6fc166655447
commit-date: 2020-03-09
host: x86_64-unknown-linux-gnu
release: 1.42.0
LLVM version: 9.0

and

rustc 1.43.0-nightly (c20d7eecb 2020-03-11)
binary: rustc
commit-hash: c20d7eecbc0928b57da8fe30b2ef8528e2bdd5be
commit-date: 2020-03-11
host: x86_64-unknown-linux-gnu
release: 1.43.0-nightly
LLVM version: 9.0

Error output

gdb backtrace with 1.42.0

Thread 2 "rustc" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffef7ff700 (LWP 258154)]
0x00007ffff482cf95 in __memmove_sse2_unaligned_erms () from /lib64/libc.so.6
(gdb) 
(gdb) bt
#0  0x00007ffff482cf95 in __memmove_sse2_unaligned_erms () from /lib64/libc.so.6
#1  0x00007ffff1b70226 in llvm::AttributeList::addAttributes(llvm::LLVMContext&, unsigned int, llvm::AttrBuilder const&) const ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-9-rust-1.42.0-stable.so
#2  0x00007ffff1c4d226 in llvm::Function::addAttributes(unsigned int, llvm::AttrBuilder const&) ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-9-rust-1.42.0-stable.so
#3  0x00007ffff53b7dd0 in LLVMRustAddFunctionAttribute ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#4  0x00007ffff53abd2e in rustc_codegen_llvm::declare::declare_raw_fn ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#5  0x00007ffff528b3f2 in <rustc_codegen_llvm::context::CodegenCx as rustc_codegen_ssa::traits::misc::MiscMethods>::eh_personality ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#6  0x00007ffff5369714 in rustc_codegen_ssa::mir::codegen_mir ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#7  0x00007ffff5287335 in <rustc::mir::mono::MonoItem as rustc_codegen_ssa::mono_item::MonoItemExt>::define ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#8  0x00007ffff52509ca in rustc_codegen_llvm::base::compile_codegen_unit::module_codegen ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#9  0x00007ffff52ca460 in rustc::dep_graph::graph::DepGraph::with_task ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#10 0x00007ffff5250624 in rustc_codegen_llvm::base::compile_codegen_unit ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#11 0x00007ffff5321fb6 in rustc_codegen_ssa::base::codegen_crate ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#12 0x00007ffff52b49fe in <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#13 0x00007ffff5126d6f in rustc_session::utils::<impl rustc_session::session::Session>::time ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#14 0x00007ffff51c1de8 in rustc_interface::passes::QueryContext::enter ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#15 0x00007ffff5123a91 in rustc_interface::queries::Queries::ongoing_codegen ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#16 0x00007ffff4f62224 in rustc_interface::interface::run_compiler_in_existing_thread_pool ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#17 0x00007ffff4f5137d in scoped_tls::ScopedKey<T>::set ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#18 0x00007ffff4f4e584 in syntax::with_globals ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#19 0x00007ffff4f523b0 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#20 0x00007ffff4a18b97 in __rust_maybe_catch_panic () at src/libpanic_unwind/lib.rs:86
#21 0x00007ffff4f64449 in core::ops::function::FnOnce::call_once{{vtable-shim}} ()
   from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-f0fe6d0442c8c573.so
#22 0x00007ffff49e7e8f in <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once ()
    at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/liballoc/boxed.rs:1015
#23 0x00007ffff4a177b0 in <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once ()
    at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/liballoc/boxed.rs:1015
#24 std::sys_common::thread::start_thread () at src/libstd/sys_common/thread.rs:13
#25 std::sys::unix::thread::Thread::new::thread_start () at src/libstd/sys/unix/thread.rs:80
#26 0x00007ffff4968432 in start_thread () from /lib64/libpthread.so.0
#27 0x00007ffff4884833 in clone () from /lib64/libc.so.6

gdb backtrace with 1.43.0-nightly (c20d7ee 2020-03-11)

Thread 2 "rustc" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffef1ff700 (LWP 258633)]
0x00007ffff154a1bd in llvm::AttributeList::addAttributes(llvm::LLVMContext&, unsigned int, llvm::AttrBuilder const&) const ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-9-rust-1.43.0-nightly.so
(gdb) bt
#0  0x00007ffff154a1bd in llvm::AttributeList::addAttributes(llvm::LLVMContext&, unsigned int, llvm::AttrBuilder const&) const ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-9-rust-1.43.0-nightly.so
#1  0x00007ffff1627226 in llvm::Function::addAttributes(unsigned int, llvm::AttrBuilder const&) ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-9-rust-1.43.0-nightly.so
#2  0x00007ffff4efc5c0 in LLVMRustAddFunctionAttribute ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#3  0x00007ffff4d436c6 in rustc_codegen_llvm::declare::declare_raw_fn ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#4  0x00007ffff4dd4a52 in <rustc_codegen_llvm::context::CodegenCx as rustc_codegen_ssa::traits::misc::MiscMethods>::eh_personality ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#5  0x00007ffff4e39944 in rustc_codegen_ssa::mir::codegen_mir ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#6  0x00007ffff4dc1e7c in <rustc::mir::mono::MonoItem as rustc_codegen_ssa::mono_item::MonoItemExt>::define ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#7  0x00007ffff4d3f71a in rustc_codegen_llvm::base::compile_codegen_unit::module_codegen ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#8  0x00007ffff4e237a1 in rustc::dep_graph::graph::DepGraph::with_task ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#9  0x00007ffff4d3f314 in rustc_codegen_llvm::base::compile_codegen_unit ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#10 0x00007ffff4ea0f5f in rustc_codegen_ssa::base::codegen_crate ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#11 0x00007ffff4e35415 in <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#12 0x00007ffff4cbce16 in rustc_interface::passes::start_codegen ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#13 0x00007ffff4cd0923 in rustc::ty::context::tls::enter_global ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#14 0x00007ffff4be4126 in rustc_interface::queries::Queries::ongoing_codegen ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#15 0x00007ffff4a93ff6 in rustc_interface::interface::run_compiler_in_existing_thread_pool ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#16 0x00007ffff4a47bcd in scoped_tls::ScopedKey<T>::set ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#17 0x00007ffff4a44c14 in rustc_ast::attr::with_globals ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#18 0x00007ffff4a49060 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#19 0x00007ffff43fa697 in __rust_maybe_catch_panic () at src/libpanic_unwind/lib.rs:86
#20 0x00007ffff4a96486 in core::ops::function::FnOnce::call_once{{vtable-shim}} ()
   from /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-5bafe156ff266a09.so
#21 0x00007ffff43c563f in <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once ()
    at /rustc/c20d7eecbc0928b57da8fe30b2ef8528e2bdd5be/src/liballoc/boxed.rs:1017
#22 0x00007ffff43f8f9d in <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once ()
    at /rustc/c20d7eecbc0928b57da8fe30b2ef8528e2bdd5be/src/liballoc/boxed.rs:1017
#23 std::sys_common::thread::start_thread () at src/libstd/sys_common/thread.rs:13
#24 std::sys::unix::thread::Thread::new::thread_start () at src/libstd/sys/unix/thread.rs:80
#25 0x00007ffff4344432 in start_thread () from /lib64/libpthread.so.0
#26 0x00007ffff4260833 in clone () from /lib64/libc.so.6

Activity

  1. added
    C-bugCategory: This is a bug.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Mar 18, 2020
  2. haraldh commented on Mar 18, 2020

    @haraldh
    ContributorAuthor
     /home/harald/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name kernel --edition=2018 kernel/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort --cfg 'feature="default"' -C metadata=daec79c354bbdca0 -C extra-filename=-daec79c354bbdca0 --out-dir /home/harald/git/enarx_sev_kvm_demo/target/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/home/harald/git/enarx_sev_kvm_demo/target/x86_64-unknown-linux-musl/release/deps -L dependency=/home/harald/git/enarx_sev_kvm_demo/target/release/deps --extern bitflags=/home/harald/git/enarx_sev_kvm_demo/target/x86_64-unknown-linux-musl/release/deps/libbitflags-95ba804a36fe1702.rmeta --extern crt0stack=/home/harald/git/enarx_sev_kvm_demo/target/x86_64-unknown-linux-musl/release/deps/libcrt0stack-9b55dc1549fd6e63.rmeta --extern lazy_static=/home/harald/git/enarx_sev_kvm_demo/target/x86_64-unknown-linux-musl/release/deps/liblazy_static-110cedc9f47571f2.rmeta --extern linux_errno=/home/harald/git/enarx_sev_kvm_demo/target/x86_64-unknown-linux-musl/release/deps/liblinux_errno-024207093360abfd.rmeta --extern linux_syscall=/home/harald/git/enarx_sev_kvm_demo/target/x86_64-unknown-linux-musl/release/deps/liblinux_syscall-4cbc42edd4142e75.rmeta --extern spin=/home/harald/git/enarx_sev_kvm_demo/target/x86_64-unknown-linux-musl/release/deps/libspin-81aa4f2377e3e1aa.rmeta --extern vmbootspec=/home/harald/git/enarx_sev_kvm_demo/target/x86_64-unknown-linux-musl/release/deps/libvmbootspec-6bbf48e889a633a3.rmeta --extern vmsyscall=/home/harald/git/enarx_sev_kvm_demo/target/x86_64-unknown-linux-musl/release/deps/libvmsyscall-f9481026d9d0a4d6.rmeta --extern x86_64=/home/harald/git/enarx_sev_kvm_demo/target/x86_64-unknown-linux-musl/release/deps/libx86_64-3689e0e08bbda521.rmeta -C linker=./cc -C linker=./cc -L native=/home/harald/git/enarx_sev_kvm_demo/target/x86_64-unknown-linux-musl/release/build/kernel-4ea535f90d18f40e/out -l static=asm -L native=/home/harald/git/enarx_sev_kvm_demo/target/x86_64-unknown-linux-musl/release/build/x86_64-435956abdc21ea2b/out
    
  3. added
    I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
    and removed
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    on Mar 18, 2020
  4. haraldh commented on Mar 18, 2020

    @haraldh
    ContributorAuthor

    oops, corrected backtrace of nightly.. pasted the stable output again.

  5. added
    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Mar 18, 2020
  6. spastorino commented on Mar 19, 2020

    @spastorino
    Member

    @haraldh can you share the code that causes this issue?.

  7. spastorino commented on Mar 19, 2020

    @spastorino
    Member

    triage: we couldn't decide the priority of the issue due to the lack of code. Left nomination so we can check again once we have the code that triggers the issue.

  8. haraldh commented on Mar 19, 2020

    @haraldh
    ContributorAuthor

    @haraldh can you share the code that causes this issue?.

    @spastorino:

    $ sudo apt-get install musl-tools
    $ git clone --single-branch -b rust_segfault https://github.com/haraldh/enarx_sev_kvm_demo.git
    $ cd enarx_sev_kvm_demo/kernel/
    $ while cargo build -vvv --release ; do cargo clean; done; 
  9. pnkfelix commented on Mar 19, 2020

    @pnkfelix
    Contributor

    @rustbot ping cleanup-crew

  10. rustbot commented on Mar 19, 2020

    @rustbot
    Collaborator

    Error: This team (cleanup-crew) cannot be pinged via this command;it may need to be added to triagebot.toml on the master branch.

    Please let @rust-lang/release know if you're having trouble with this bot.

  11. 15 remaining items

  12. haraldh commented on May 5, 2020

    @haraldh
    ContributorAuthor

    Still an issue.. this time with released "stable"

    ❯ rustc --version
    rustc 1.43.0 (4fb7144ed 2020-04-20)
    
  13. haraldh commented on May 5, 2020

    @haraldh
    ContributorAuthor

    $ sudo apt-get install musl-tools
    $ git clone --single-branch -b rust_segfault https://github.com/haraldh/enarx.git
    $ cd enarx/enarx-keep-sev-shim
    $ while cargo build -vvv --release ; do cargo clean; done;

  14. haraldh commented on May 5, 2020

    @haraldh
    ContributorAuthor

    And it's segfaulting way more often, than succeeding.

  15. haraldh commented on May 5, 2020

    @haraldh
    ContributorAuthor
    Thread 2 "rustc" received signal SIGBUS, Bus error.
    [Switching to Thread 0x7fffef1ff700 (LWP 1351394)]
    0x00007ffff15391bd in llvm::AttributeList::addAttributes(llvm::LLVMContext&, unsigned int, llvm::AttrBuilder const&) const ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-9-rust-1.43.0-stable.so
    
    (gdb) bt
    #0  0x00007ffff15391bd in llvm::AttributeList::addAttributes(llvm::LLVMContext&, unsigned int, llvm::AttrBuilder const&) const ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-9-rust-1.43.0-stable.so
    #1  0x00007ffff1616226 in llvm::Function::addAttributes(unsigned int, llvm::AttrBuilder const&) ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-9-rust-1.43.0-stable.so
    #2  0x00007ffff4ef2c90 in LLVMRustAddFunctionAttribute ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #3  0x00007ffff4ee1813 in rustc_codegen_llvm::declare::declare_raw_fn ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #4  0x00007ffff4dbfff2 in <rustc_codegen_llvm::context::CodegenCx as rustc_codegen_ssa::traits::misc::MiscMethods>::eh_personality ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #5  0x00007ffff4e2ee84 in rustc_codegen_ssa::mir::codegen_mir ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #6  0x00007ffff4df0bac in <rustc::mir::mono::MonoItem as rustc_codegen_ssa::mono_item::MonoItemExt>::define ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #7  0x00007ffff4d3657a in rustc_codegen_llvm::base::compile_codegen_unit::module_codegen ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #8  0x00007ffff4e1ad81 in rustc::dep_graph::graph::DepGraph::with_task ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #9  0x00007ffff4d36144 in rustc_codegen_llvm::base::compile_codegen_unit ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #10 0x00007ffff4e4fc89 in rustc_codegen_ssa::base::codegen_crate ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #11 0x00007ffff4e02895 in <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #12 0x00007ffff4cb3436 in rustc_interface::passes::start_codegen ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #13 0x00007ffff4cc6a93 in rustc::ty::context::tls::enter_global ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #14 0x00007ffff4bd8846 in rustc_interface::queries::Queries::ongoing_codegen ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #15 0x00007ffff4a875e6 in rustc_interface::interface::run_compiler_in_existing_thread_pool ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #16 0x00007ffff4a3aacc in std::sys_common::backtrace::__rust_begin_short_backtrace ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #17 0x00007ffff43eb627 in __rust_maybe_catch_panic () at src/libpanic_unwind/lib.rs:86
    #18 0x00007ffff4a89eb6 in core::ops::function::FnOnce::call_once{{vtable-shim}} ()
       from /home/harald/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-7e244282122ae6e4.so
    #19 0x00007ffff43b65bf in <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once ()
        at /rustc/4fb7144ed159f94491249e86d5bbd033b5d60550/src/liballoc/boxed.rs:1017
    #20 0x00007ffff43e9f2d in <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once ()
        at /rustc/4fb7144ed159f94491249e86d5bbd033b5d60550/src/liballoc/boxed.rs:1017
    #21 std::sys_common::thread::start_thread () at src/libstd/sys_common/thread.rs:13
    #22 std::sys::unix::thread::Thread::new::thread_start () at src/libstd/sys/unix/thread.rs:80
    #23 0x00007ffff4333432 in start_thread () from /lib64/libpthread.so.0
    #24 0x00007ffff424f9d3 in clone () from /lib64/libc.so.6
    (gdb) 
    
  16. haraldh commented on May 5, 2020

    @haraldh
    ContributorAuthor

    for a successful build I have to do:

    ❯ while ! cargo build --release ; do :; done; 
  17. tmiasko commented on May 9, 2020

    @tmiasko
    Contributor

    There is a mismatch between rust_eh_personality declared by rustc (which has i32 return type and variadic arguments) and one from the crate. The issue can be reproduced with code below, but observing it might require enabled LLVM assertions:

    #![no_std]
    
    #[no_mangle]
    pub extern "C" fn rust_eh_personality() {
    }
    
    #[no_mangle]
    pub fn zzz(a: Option<usize>) -> usize {
        a.unwrap()
    }
    rustc: .../llvm-project/llvm/include/llvm/Support/Casting.h:264: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::Function; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::Function*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
    

    Using the same type signature seems to work fine, although it requires ZST to workaround requirement for at least one named argument.

  18. haraldh commented on May 12, 2020

    @haraldh
    ContributorAuthor

    Oh, you are right.. I can totally remove it and it does not segfault anymore!
    Thanks!

  19. haraldh commented on May 12, 2020

    @haraldh
    ContributorAuthor

    so, I added #[cfg(debug_assertions)] to rust_eh_personality because it's only needed in the debug profile, and seems to cause the segfault in release.

  20. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Sep 22, 2020
  21. hussein-aitlahcen commented on Feb 11, 2021

    @hussein-aitlahcen

    Hi folks, I think I encountered the same issue, I've commented here with a similar stacktrace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.E-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.P-highHigh priorityT-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