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 crashing #19675

Closed
ragingSloth opened this issue Dec 9, 2014 · 5 comments
Closed

rustc crashing #19675

ragingSloth opened this issue Dec 9, 2014 · 5 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@ragingSloth
Copy link

I just built rust v.13 from master, but when I try to compile I experience a variety of errors. I experienced a panic trying to compile something with #![no_std].

$rustc `RUST_BACKTRACE=1` -O --target i686-unknown-linux-gnu --crate-type lib -o main.o --emit obj main.rs
error: requires `copy` lang_item
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: ErrorReported', /root/Downloads   /rust/src/libcore/result.rs:744

when I implement an empty Clone trait to fix the initial error the same command errors with.

...

<premain>: CommandLine Error: Option 'unroll-runtime' registered more than once!

<premain>: CommandLine Error: Option 'unroll-allow-partial' registered more than once!

<premain>: CommandLine Error: Option 'unroll-count' registered more than once!

<premain>: CommandLine Error: Option 'unroll-threshold' registered more than once!

<premain>: CommandLine Error: Option 'enable-lsr-phielim' registered more than once!

<premain>: CommandLine Error: Option 'rotation-max-header-size' registered more than once!
...

when I try to compile other programs I get illegal hardware instruction (core dumped). I ran it under gdb and it appears to be segfaulting.

$rustc test2.rs
zsh: illegal hardware instruction (core dumped)  rustc test2.rs
$gdb rustc
$(gdb) run ./test2.rs
Starting program: /usr/local/bin/rustc ./test2.rs
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffec7fef00 (LWP 3343)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffec7fef00 (LWP 3343)]
0x00007ffff4fa1a7d in llvm::StringRef::find_last_not_of(llvm::StringRef, unsigned long) const () from /usr/lib/libLLVM-3.5.so
$(gdb) backtrace
#0  0x00007ffff4fa1a7d in llvm::StringRef::find_last_not_of(llvm::StringRef, unsigned long) const () from /usr/lib/libLLVM-3.5.so
#1  0x00007ffff47a49a3 in llvm::object::ArchiveMemberHeader::getSize() const () from /usr/lib/libLLVM-3.5.so
#2  0x00007ffff47a4d3e in llvm::object::Archive::Child::Child(llvm::object::Archive const*, char const*) () from /usr/lib/libLLVM-3.5.so
#3  0x00007ffff47a4f6c in llvm::object::Archive::child_begin(bool) const () from /usr/lib/libLLVM-3.5.so
#4  0x00007fffefdb0684 in llvm::object::Archive::Archive(llvm::MemoryBufferRef, std::error_code&) () from /usr/local/lib/librustc_llvm-4e7c5e5c.so
#5  0x00007fffefdb0c3a in llvm::object::Archive::create(llvm::MemoryBufferRef) () from /usr/local/lib/librustc_llvm-4e7c5e5c.so
#6  0x00007fffef1eb1a8 in LLVMRustOpenArchive (path=<optimized out>) at /root/Downloads/rust/src/rustllvm/RustWrapper.cpp:727
#7  0x00007fffef1e7a89 in archive_ro::ArchiveRO::open::hd9ea27a23da59518eba () from /usr/local/lib/librustc_llvm-4e7c5e5c.so
#8  0x00007ffff24dc0ab in metadata::loader::get_metadata_section::closure.99492 () from /usr/local/lib/librustc-4e7c5e5c.so
#9  0x00007ffff686dfff in time::duration::Duration::span::h1fa98e12f2fbff11Ckm () from /usr/local/lib/libstd-4e7c5e5c.so
#10 0x00007ffff24db086 in metadata::loader::get_metadata_section::h24866dbeb8244841N4w () from /usr/local/lib/librustc-4e7c5e5c.so
#11 0x00007ffff24d9001 in metadata::loader::Context$LT$$x27a$GT$::extract_one::hd01bceaa88606378wDw () from /usr/local/lib/librustc-4e7c5e5c.so
#12 0x00007ffff24d246a in metadata::loader::Context$LT$$x27a$GT$::find_library_crate::h6fa989b5256c5d2bStw () from /usr/local/lib/librustc-4e7c5e5c.so
#13 0x00007ffff24cd371 in metadata::creader::PluginMetadataReader$LT$$x27a$GT$::read_plugin_metadata::h7a2e000abef9475d4kv () from /usr/local/lib/librustc-4e7c5e5c.so
#14 0x00007ffff2503619 in plugin::load::PluginLoader$LT$$x27a$GT$.Visitor$LT$$x27v$GT$::visit_view_item::ha8f421e39f6571fbldA ()from /usr/local/lib/librustc-4e7c5e5c.so
#15 0x00007ffff25029bb in plugin::load::load_plugins::ha983792bed43042fbcA () from /usr/local/lib/librustc-4e7c5e5c.so
#16 0x00007ffff6cc2644 in driver::phase_2_configure_and_expand::h144116dfb381b551Qha () from /usr/local/lib/librustc_driver-4e7c5e5c.so
#17 0x00007ffff6cb62f7 in driver::compile_input::hb468db38392e01fbpba () from /usr/local/lib/librustc_driver-4e7c5e5c.so
#18 0x00007ffff6d53fb8 in run_compiler::h5606ffa1609782a3kYb () from /usr/local/lib/librustc_driver-4e7c5e5c.so
#19 0x00007ffff6d528ac in run::closure.21400 () from /usr/local/lib/librustc_driver-4e7c5e5c.so
#20 0x00007ffff6d6427b in task::TaskBuilder::try_future::closure.22849 () from /usr/local/lib/librustc_driver-4e7c5e5c.so
#21 0x00007ffff686fa33 in task::TaskBuilder::spawn_internal::closure.30601 () from /usr/local/lib/libstd-4e7c5e5c.so
#22 0x00007ffff64df532 in task::Task::spawn::closure.5727 () from /usr/local/lib/librustrt-4e7c5e5c.so
#23 0x00007ffff6546a5c in rust_try_inner () from /usr/local/lib/librustrt-4e7c5e5c.so
#24 0x00007ffff6546a46 in rust_try () from /usr/local/lib/librustrt-4e7c5e5c.so
#25 0x00007ffff64df5e3 in unwind::try::hf5f28d8a62a70e27Tyc () from /usr/local/lib/librustrt-4e7c5e5c.so
#26 0x00007ffff64df3dc in task::Task::run::hcf1e7066a54e37dcfKb () from /usr/local/lib/librustrt4e7c5e5c.so
#27 0x00007ffff64df028 in task::Task::spawn::closure.5703 () from /usr/local/lib/librustrt-4e7c5e5c.so
#28 0x00007ffff64e0a25 in thread::thread_start::ha3032c35fbd5a75cw1b () from /usr/local/lib/librustrt-4e7c5e5c.so
#29 0x00007ffff3ef4314 in start_thread () from /usr/lib/libpthread.so.0
#30 0x00007ffff61b65bd in clone () from /usr/lib/libc.so.6
@jdm jdm added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Dec 10, 2014
@arielb1
Copy link
Contributor

arielb1 commented Dec 10, 2014

Can you list the signatures of the lang-items you implemented? Implementing them improperly can cause compiler crashes/ICE-s.

@ragingSloth
Copy link
Author

#[lang="sized"]
trait Sized {}

#[lang="copy"]
trait Copy {}

But I get illegal harware instruction for pretty much every program I try to compile.

@arielb1
Copy link
Contributor

arielb1 commented Dec 11, 2014

@ragingSloth

They need to be #[lang="sized"] pub trait Sized for Sized? {} and #[lang="copy"] pub trait Copy for Sized? {} (whitespace is unimportant, but you need pub and for Sized?, just copy the definitions from src/libcore/kinds.rs).

@tamird
Copy link
Contributor

tamird commented Apr 21, 2015

Needs reproducible test

@arielb1
Copy link
Contributor

arielb1 commented Oct 23, 2015

closing as irreproducible.

@arielb1 arielb1 closed this as completed Oct 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants