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_codegen_llvm: begin generalizing over backend values. #52987

Closed
wants to merge 1 commit into from
Closed

rustc_codegen_llvm: begin generalizing over backend values. #52987

wants to merge 1 commit into from

Conversation

irinagpopa
Copy link
Contributor

Part of #45274.

@rust-highfive
Copy link
Collaborator

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 2, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.

[00:03:53] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:53] tidy error: /checkout/src/librustc_codegen_llvm/mir/place.rs:159: line longer than 100 chars
[00:03:53] tidy error: /checkout/src/librustc_codegen_llvm/mir/operand.rs:194: line longer than 100 chars
[00:03:53] tidy error: /checkout/src/librustc_codegen_llvm/mir/operand.rs:261: line longer than 100 chars
[00:03:53] tidy error: /checkout/src/librustc_codegen_llvm/mir/mod.rs:187: line longer than 100 chars
[00:03:53] tidy error: /checkout/src/librustc_codegen_llvm/abi.rs:171: line longer than 100 chars
[00:03:53] tidy error: /checkout/src/librustc_codegen_llvm/abi.rs:238: line longer than 100 chars
[00:03:54] some tidy checks failed
[00:03:54] 
[00:03:54] 
[00:03:54] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:03:54] 
[00:03:54] 
[00:03:54] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:54] Build completed unsuccessfully in 0:00:46
[00:03:54] Build completed unsuccessfully in 0:00:46
[00:03:54] Makefile:79: recipe for target 'tidy' failed
[00:03:54] make: *** [tidy] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:2b0caea8
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:070bf9fc:start=1533228042798469323,finish=1533228042806194645,duration=7725322
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0ff2dbed
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:08f93168
travis_time:start:08f93168
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:11d73305
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:19:16]    Compiling rustc_llvm v0.0.0 (file:///checkout/src/librustc_llvm)
[00:20:06] error: Could not compile `rustc_codegen_llvm`.
[00:20:06] 
[00:20:06] Caused by:
[00:20:06]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc_codegen_llvm librustc_codegen_llvm/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 --cfg 'feature="jemalloc"' --cfg 'feature="rustc_target"' -C metadata=b42aa0d683b3ffda -C extra-filename=-b42aa0d683b3ffda --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-3907cba388d41ef0.rlib --extern cc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libcc-277ca49f42ab2e53.rlib --extern env_logger=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libenv_logger-f28e2ea1414f1406.rlib --extern flate2=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libflate2-94b7c8f2f6f79e1b.rlib --extern jobserver=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libjobserver-ba31465b048d39f4.rlib --extern libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblibc-00919937f377f0bc.rlib --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-b6c566856a1e65b9.rlib --extern num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libnum_cpus-18d8fee9014249a2.rlib --extern rustc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-e4f798202172c031.so --extern rustc_demangle=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_demangle-dd0a9429b0aacf96.rlib --extern rustc_allocator=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_allocator-62a891846402192d.so --extern rustc_apfloat=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_apfloat-165c205e2819b15f.rlib --extern rustc_codegen_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_codegen_utils-cf4f2299cca987aa.so --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-072369dae17b1893.so --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-780c150b6c3acb38.so --extern rustc_incremental=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_incremental-4f182245385237b5.so --extern rustc_llvm=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_llvm-5ed58e76c7dace45.rlib --extern rustc_mir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_mir-1cc3798595d9708a.so --extern rustc_platform_intrinsics=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_platform_intrinsics-2e835ba951928190.so --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-20eb47b9c402fee3.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-8c9bc9ee6cc9592f.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-8c9bc9ee6cc9592f.rlib --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-1ed4d2103c0d7730.so --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-899ce576c6b4bcbf.so --extern tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libtempfile-45767bac74e332c7.rlib -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-3c585aa15bfc4e69/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-01a673445b66da02/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-71c6a17c4b962f9c/out -L native=/usr/lib/llvm-5.0/lib` (signal: 11, SIGSEGV: invalid memory reference)
[00:20:06] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--manifest-path" "/checkout/src/librustc_codegen_llvm/Cargo.toml" "--features" " jemalloc" "--message-format" "json"
[00:20:06] expected success, got: exit code: 101
[00:20:06] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1118:9
[00:20:06] travis_fold:start:stage0-rustc_codegen_llvm
travis_time:start:stage0-rustc_codegen_llvm
travis_fold:end:stage0-rustc_codegen_llvm


[00:20:06] travis_time:end:stage0-rustc_codegen_llvm:start=1533290596417434447,finish=1533290648532261785,duration=52114827338

[00:20:06] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:20:06] Build completed unsuccessfully in 0:16:19
[00:20:06] Makefile:28: recipe for target 'all' failed
[00:20:06] make: *** [all] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:02127ce0
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:2639a2e3:start=1533290649154168475,finish=1533290649161122591,duration=6954116
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0ea78ad0
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:start:crashlog
obj/cores/core.8343.!checkout!obj!build!x86_64-unknown-linux-gnu!stage0!bin!rustc
Source directories searched: /home/travis/build/rust-lang/rust/src:$cdir:$cwd
Reading symbols from obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustc...(no debugging symbols found)...done.
[New LWP 8375]
[New LWP 8372]
[New LWP 8373]
[New LWP 8343]
[New LWP 8344]
[New LWP 8374]
[New LWP 8345]
warning: Could not load shared library symbols for 7 libraries, e.g. /lib/x86_64-linux-gnu/libc.so.6.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustc --crate-name rust'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fabd3b98182 in std::_Function_handler<bool (llvm::GlobalValue const&), llvm::thinLTOInternalizeModule(llvm::Module&, llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*> > const&)::$_2>::_M_invoke(std::_Any_data const&, llvm::GlobalValue const&) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#0  0x00007fabd3b98182 in std::_Function_handler<bool (llvm::GlobalValue const&), llvm::thinLTOInternalizeModule(llvm::Module&, llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*> > const&)::$_2>::_M_invoke(std::_Any_data const&, llvm::GlobalValue const&) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#1  0x00007fabd3bb4b7e in llvm::InternalizePass::maybeInternalize(llvm::GlobalValue&, std::set<llvm::Comdat const*, std::less<llvm::Comdat const*>, std::allocator<llvm::Comdat const*> > const&) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#2  0x00007fabd3bb4fe6 in llvm::InternalizePass::internalizeModule(llvm::Module&, llvm::CallGraph*) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#3  0x00007fabd3b94199 in llvm::thinLTOInternalizeModule(llvm::Module&, llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*> > const&) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#4  0x00007fabd3452558 in LLVMRustPrepareThinLTOInternalize ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#5  0x00007fabd3356d2b in rustc_codegen_llvm::back::lto::LtoModuleCodegen::optimize::h509ac79a256a6094 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64----Type <return> to continue, or q <return> to quit---

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@eddyb
Copy link
Member

eddyb commented Aug 3, 2018

(signal: 11, SIGSEGV: invalid memory reference)

That's... stage0 (beta) segfaulting, quite unexpected. cc @alexcrichton @rust-lang/compiler

@nagisa
Copy link
Member

nagisa commented Aug 3, 2018

What other Values do we expect to have?

@denismerigoux
Copy link
Contributor

We're expecting to implement a Cranelift backend soon so we'll have Cranelift IR values to deal with :)

@Mark-Simulacrum
Copy link
Member

Travis log seems to indicate the segfault is in LLVM:

#0  0x00007fabd3b98182 in std::_Function_handler<bool (llvm::GlobalValue const&), llvm::thinLTOInternalizeModule(llvm::Module&, llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*> > const&)::$_2>::_M_invoke(std::_Any_data const&, llvm::GlobalValue const&) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#0  0x00007fabd3b98182 in std::_Function_handler<bool (llvm::GlobalValue const&), llvm::thinLTOInternalizeModule(llvm::Module&, llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*> > const&)::$_2>::_M_invoke(std::_Any_data const&, llvm::GlobalValue const&) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#1  0x00007fabd3bb4b7e in llvm::InternalizePass::maybeInternalize(llvm::GlobalValue&, std::set<llvm::Comdat const*, std::less<llvm::Comdat const*>, std::allocator<llvm::Comdat const*> > const&) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#2  0x00007fabd3bb4fe6 in llvm::InternalizePass::internalizeModule(llvm::Module&, llvm::CallGraph*) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#3  0x00007fabd3b94199 in llvm::thinLTOInternalizeModule(llvm::Module&, llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*> > const&) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#4  0x00007fabd3452558 in LLVMRustPrepareThinLTOInternalize ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#5  0x00007fabd3356d2b in rustc_codegen_llvm::back::lto::LtoModuleCodegen::optimize::h509ac79a256a6094 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64----Type <return> to continue, or q <return> to quit---

@eddyb
Copy link
Member

eddyb commented Aug 6, 2018

Oh this might be an old bug from LLVM, I tried building locally and had no issues.
cc @alexcrichton @rkruppe

@denismerigoux
Copy link
Contributor

I got the segfault too, with ./x.py build --stage 1 src/libtest on Unix (Ubuntu).

@eddyb
Copy link
Member

eddyb commented Aug 6, 2018

@denismerigoux Hmm, do you have LLVM assertions disabled in config.toml? That might be something else that different in my setup.

@denismerigoux
Copy link
Contributor

@eddyb I do have LLVM assertions enabled in config.toml, as suggested in the rustc guide.

@denismerigoux
Copy link
Contributor

@eddyb @irinagpopa I rebased the current master into this branch and the segfault disappeared when building with ./x.py build --stage 1 src/libtest, even with LLVM assertions enabled. Maybe the bug has been fixed already in master.

@alexcrichton
Copy link
Member

The master branch has since upgraded to LLVM 7, so perhaps this was a bug in LLVM that was fixed?

@denismerigoux
Copy link
Contributor

Sorry for the false hope, I didn't recompile properly the time it went through without the segfault. I rebuilt from scratch and I confirm that the segfault still exists even after rebasing on top of the current master.

@denismerigoux
Copy link
Contributor

I managed to get a failed assertion during a failed build :

rustc: /home/demerigo/rust/src/llvm/lib/Transforms/IPO/FunctionImport.cpp:850: llvm::thinLTOInternalizeModule(llvm::Module&, const GVSummaryMapTy&)::<lambda(const llvm::GlobalValue&)>: Assertion `GS != DefinedGlobals.end()' failed.

@denismerigoux
Copy link
Contributor

The implication of thinLTO in this bug is confirmed since building the compiler with RUSTFLAGS="-Z thinlto=no"makes the segfault go away (confirmed on at least two machines).

@denismerigoux
Copy link
Contributor

I managed to get a backtrace of the failed assertion using gdb :

#3  0x00007ffff72b0c82 in __GI___assert_fail (assertion=0x7fffee6062d1 "GS != DefinedGlobals.end()", file=0x7fffee606580 "/home/demerigo/rust/src/llvm/lib/Transforms/IPO/FunctionImport.cpp", line=873, 
    function=0x7fffee60a6a0 <llvm::thinLTOInternalizeModule(llvm::Module&, llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*> > const&)::{lambda(llvm::GlobalValue const&)#1}::operator()(llvm::GlobalValue const&) const::__PRETTY_FUNCTION__> "llvm::thinLTOInternalizeModule(llvm::Module&, const GVSummaryMapTy&)::<lambda(const llvm::GlobalValue&)>") at assert.c:101
#4  0x00007fffec5ce580 in std::_Function_handler<bool (llvm::GlobalValue const&), llvm::thinLTOInternalizeModule(llvm::Module&, llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*> > const&)::{lambda(llvm::GlobalValue const&)#1}>::_M_invoke(std::_Any_data const&, llvm::GlobalValue const&) ()
   from /home/demerigo/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#5  0x00007fffec5f8b8e in llvm::InternalizePass::maybeInternalize(llvm::GlobalValue&, std::set<llvm::Comdat const*, std::less<llvm::Comdat const*>, std::allocator<llvm::Comdat const*> > const&) ()
   from /home/demerigo/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#6  0x00007fffec5f990b in llvm::InternalizePass::internalizeModule(llvm::Module&, llvm::CallGraph*) ()
   from /home/demerigo/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#7  0x00007fffec5cd8ca in llvm::thinLTOInternalizeModule(llvm::Module&, llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*> > const&) () from /home/demerigo/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#8  0x00007fffebc57856 in LLVMRustPrepareThinLTOInternalize () from /home/demerigo/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#9  0x00007fffebb31e06 in rustc_codegen_llvm::back::lto::ThinModule::optimize::h35ab17535aa17567 (self=<optimized out>, cgcx=0x7fffe2537168, timeline=0x7fffe2537010) at librustc_codegen_llvm/back/lto.rs:719
#10 rustc_codegen_llvm::back::lto::LtoModuleCodegen::optimize::h4b5b75a4a7d765b2 (self=<optimized out>, cgcx=<optimized out>, timeline=<optimized out>) at librustc_codegen_llvm/back/lto.rs:85
#11 0x00007fffebac6df0 in rustc_codegen_llvm::back::write::execute_work_item::h04ea6e82802c2dfe (cgcx=<optimized out>, timeline=<optimized out>, work_item=...) at librustc_codegen_llvm/back/write.rs:1277
#12 rustc_codegen_llvm::back::write::spawn_work::_$u7b$$u7b$closure$u7d$$u7d$::hc2823251fe01cadd () at librustc_codegen_llvm/back/write.rs:2047
#13 std::sys_common::backtrace::__rust_begin_short_backtrace::h6ca7e8b852ff4949 (f=...) at /home/demerigo/rust/src/libstd/sys_common/backtrace.rs:136
#14 0x00007fffebbf83e8 in std::thread::Builder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h8f185bcb7fdc83bf () at /home/demerigo/rust/src/libstd/thread/mod.rs:409

@bors
Copy link
Contributor

bors commented Aug 19, 2018

☔ The latest upstream changes (presumably #51131) made this pull request unmergeable. Please resolve the merge conflicts.

@pietroalbini pietroalbini added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2018
@eddyb
Copy link
Member

eddyb commented Sep 3, 2018

Starting from @denismerigoux and @irinagpopa's attempts, I was able to reduce the bug: #53912.
EDIT: turns out it's really silly (#53912 (comment)) - I should've looked into it sooner.

bors added a commit that referenced this pull request Sep 7, 2018
rustc_codegen_llvm: traitification of LLVM-specific CodegenCx and Builder methods

This PR is the continuation of #52461 in the grand plan of #45274 to allow for multiple codegen backends. A first attempt at this was #52987 but since @irinagpopa is no longer working on it I'm taking ownership of the PR.

The changes are refactoring only and do not affect the logic of the code. Performance should not be impacted since all parametrization is done with generics (no trait objects).

The `librustc_codegen_llvm` crate now contains a new folder `interfaces` that describes with traits part of how the compiler interfaces with LLVM during codegen. `CodegenCx` and `Builder` implement those traits.

Many things are still missing. All the calls to LLVM are not yet under a trait, and later LLVM-agnostic code should be parametrized.
@BatmanAoD
Copy link
Member

Ping from triage, @irinagpopa! It looks like there's been some progress on tracking down the cause of the Travis failure.

@eddyb
Copy link
Member

eddyb commented Sep 12, 2018

@denismerigoux has taken over this patch series and already has a PR that includes this commit and a workaround for the LLVM bug.

@eddyb eddyb closed this Sep 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.