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

"make check" failed for invalid-library #13828

Closed
noamraph opened this issue Apr 28, 2014 · 7 comments
Closed

"make check" failed for invalid-library #13828

noamraph opened this issue Apr 28, 2014 · 7 comments

Comments

@noamraph
Copy link
Contributor

I'm using 64bit mint 13 ≈ ubuntu 12.04. commit 3e284ee.
I installed llvm-3.3 and run

./configure --llvm-root=/usr/lib/llvm-3.3
make
sudo make install
make check

"make check" had a process consume nearly all my memory (8GB). I killed it. Then it failed with this:

maketest: invalid-library
----- /home/noam/sand/rust/src/test/run-make/invalid-library/ --------------------
------ stdout ---------------------------------------------
make[1]: Entering directory `/home/noam/sand/rust/src/test/run-make/invalid-library'
touch /home/noam/sand/rust/x86_64-unknown-linux-gnu/test/run-make/invalid-library/rust.metadata.bin
ar crus /home/noam/sand/rust/x86_64-unknown-linux-gnu/test/run-make/invalid-library/libfoo-ffffffff-1.0.rlib /home/noam/sand/rust/x86_64-unknown-linux-gnu/test/run-make/invalid-library/rust.metadata.bin
/home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/rustc --out-dir /home/noam/sand/rust/x86_64-unknown-linux-gnu/test/run-make/invalid-library -L /home/noam/sand/rust/x86_64-unknown-linux-gnu/test/run-make/invalid-library foo.rs 2>&1 | grep "can't find crate for"
make[1]: Leaving directory `/home/noam/sand/rust/src/test/run-make/invalid-library'

------ stderr ---------------------------------------------
Segmentation fault (core dumped)
make[1]: *** [all] Error 1

------        ---------------------------------------------

make: *** [x86_64-unknown-linux-gnu/test/run-make/invalid-library-2-T-x86_64-unknown-linux-gnu-H-x86_64-unknown-linux-gnu.ok] Error 2
@alexcrichton
Copy link
Member

Could you try running that last command and seeing what's going on?

/home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/rustc --out-dir /home/noam/sand/rust/x86_64-unknown-linux-gnu/test/run-make/invalid-library -L /home/noam/sand/rust/x86_64-unknown-linux-gnu/test/run-make/invalid-library foo.rs

It sounds like something is running away and consuming huge amount of memory, and I'm curious if LLVM 3.3 had a bug that was fixed later on.

@noamraph
Copy link
Contributor Author

I get a segmentation fault:

noam@naaman:~/sand/rust/src/test/run-make/invalid-library$ /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/rustc --out-dir /home/noam/sand/rust/x86_64-unknown-linux-gnu/test/run-make/invalid-library -L /home/noam/sand/rust/x86_64-unknown-linux-gnu/test/run-make/invalid-library foo.rs
Segmentation fault (core dumped)

@alexcrichton
Copy link
Member

Can you get a backtrace? (through gdb)

@noamraph
Copy link
Contributor Author

noam@naaman:~/sand/rust/src/test/run-make/invalid-library$ gdb /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/rustc core
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 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-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/rustc...(no debugging symbols found)...done.
[New LWP 24682]
[New LWP 24681]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/rustc --out-dir /home/'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f8127757345 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) where
#0  0x00007f8127757345 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f812995611e in llvm::object::Archive::Child::getName(llvm::StringRef&) const ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#2  0x00007f8128f03d29 in LLVMRustArchiveReadSection (ar=<optimized out>, name=0x7f812472d480 "rust.metadata.bin", 
    size=0x7f812472d458) at /home/noam/sand/rust/src/rustllvm/RustWrapper.cpp:700
#3  0x00007f8128db9858 in back::archive::ArchiveRO::read::h0d689c4d8201bb8egR0::v0.11.pre ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#4  0x00007f8128e3f9f4 in metadata::loader::get_metadata_section::h619ca0a1732907d1Mxe::v0.11.pre ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#5  0x00007f8128e3d4f8 in metadata::loader::Context$LT$$x27a$GT$::extract_one::h67cd3c8a79eb2bdeeae::v0.11.pre ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#6  0x00007f8128e36770 in metadata::loader::Context$LT$$x27a$GT$::find_library_crate::h458c87a2fc155d4dxDd::v0.11.pre () from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#7  0x00007f8128e2df22 in metadata::creader::resolve_crate::h61242f74072388c8Tqc::v0.11.pre ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#8  0x00007f8128e26b5b in metadata::creader::Env$LT$$x27a$GT$.visit..Visitor$LT$$LP$$RP$$GT$::visit_view_item::h050cae7431e7175aa0b::v0.11.pre ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#9  0x00007f8128e25d5b in metadata::creader::read_crates::h4c1207cdfeb94a58hZb::v0.11.pre ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#10 0x00007f8128a6deb5 in util::common::time::h14787701417883163691::v0.11.pre ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#11 0x00007f8128ebfa20 in driver::driver::phase_3_run_analysis_passes::ha4f7e8d825a26493YCf::v0.11.pre ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#12 0x00007f8128ec732a in driver::driver::compile_input::h0d291d3f3ac4d513L2f::v0.11.pre ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#13 0x00007f8128eeda81 in run_compiler::hbf6a654d233c0213Czn::v0.11.pre ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#14 0x00007f8128f02b2c in main_args::closure.91444 ()
---Type <return> to continue, or q <return> to quit---
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#15 0x00007f8128f00f63 in monitor::closure.91319 ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#16 0x00007f8128efc978 in task::TaskBuilder::try::closure.91085 ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustc-4283bb68-0.11-pre.so
#17 0x00007f812814b23e in task::spawn_opts::closure.7111 ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/libnative-83574243-0.11-pre.so
#18 0x00007f8127ab7313 in rt::task::Task::run::closure.40130 ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/libstd-aad93cea-0.11-pre.so
#19 0x00007f8127ac262c in rust_try ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/libstd-aad93cea-0.11-pre.so
#20 0x00007f8127ab70c2 in rt::task::Task::run::hf517e61ffe329797UW7::v0.11.pre ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/libstd-aad93cea-0.11-pre.so
#21 0x00007f812814b0c0 in task::spawn_opts::closure.7084 ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/libnative-83574243-0.11-pre.so
#22 0x00007f8127abb134 in rt::thread::thread_start::hfae5608813cd1c6c7B8::v0.11.pre ()
   from /home/noam/sand/rust/x86_64-unknown-linux-gnu/stage2/bin/../lib/libstd-aad93cea-0.11-pre.so
#23 0x00007f812579ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#24 0x00007f81276e83fd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#25 0x0000000000000000 in ?? ()
(gdb) 

@alexcrichton
Copy link
Member

I'm not entirely sure what's going on here. This succeeds with a local 3.3 installation for me, so perhaps this is a bug that was later fixed in LLVM?

@noamraph
Copy link
Contributor Author

For future reference, this worked for me:

I installed gcc-4.7:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.7 g++-4.7

And run:

CC=/usr/bin/gcc-4.7 CXX=/usr/bin/g++-4.7 ./configure

Now make check succeeded.

@steveklabnik
Copy link
Member

Since your issue has been solved, and nobody else has seen it since, I'm giving it a close. If anyone finds this via google, please let me know and we can try to track it down!

arcnmx pushed a commit to arcnmx/rust that referenced this issue Jan 9, 2023
Remove non-needed clones

I am not certain if this will improve performance, but it seems having a .clone() without any need should be removed.

This was done with clippy, and manually reviewed:

```
cargo clippy --fix -- -A clippy::all -D clippy::redundant_clone
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants