llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.01k stars 11.96k forks source link

Internal compiler error (assertion) during per-module optimization pass while building libc++ #12251

Closed llvmbot closed 12 years ago

llvmbot commented 12 years ago
Bugzilla Link 11879
Resolution FIXED
Resolved on Jan 29, 2012 14:46
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

With Clang revision 148703, compiling r148629 of libc++ results in an assertion during the opimization pass of locale.cpp. The preprocessed source is attached.

Crash report: clang: /home/xeo/llvm/include/llvm/ADT/OwningPtr.h:34: llvm::OwningPtr::OwningPtr(const llvm::OwningPtr&) [with T = llvm::UndefValue]: Assertion `RHS.Ptr == 0 && "Only null OwningPtr's are copyable!"' failed. 0 clang 0x00000000027a882e 1 clang 0x00000000027a8621 2 libpthread.so.0 0x00007f142eaa5f60 3 libc.so.6 0x00007f142ddb8165 gsignal + 53 4 libc.so.6 0x00007f142ddbaf70 abort + 384 5 libc.so.6 0x00007f142ddb12b1 __assert_fail + 241 6 clang 0x000000000264ee0a 7 clang 0x000000000264ed6c 8 clang 0x000000000264af58 9 clang 0x0000000002648b07 10 clang 0x0000000002646877 11 clang 0x000000000263e13c llvm::UndefValue::get(llvm::Type) + 50 12 clang 0x00000000023535e4 13 clang 0x0000000002731d68 llvm::MPPassManager::runOnModule(llvm::Module&) + 456 14 clang 0x000000000273227e llvm::PassManagerImpl::run(llvm::Module&) + 130 15 clang 0x00000000027327b9 llvm::PassManager::run(llvm::Module&) + 39 16 clang 0x0000000000cd8257 17 clang 0x0000000000cd8377 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module, clang::BackendAction, llvm::raw_ostream) + 140 18 clang 0x0000000000cd4444 19 clang 0x0000000000e7fc31 clang::ParseAST(clang::Sema&, bool) + 761 20 clang 0x0000000000b43733 clang::ASTFrontendAction::ExecuteAction() + 265 21 clang 0x0000000000cd2fb4 clang::CodeGenAction::ExecuteAction() + 986 22 clang 0x0000000000b4338f clang::FrontendAction::Execute() + 213 23 clang 0x0000000000b1cd2b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 679 24 clang 0x0000000000aeebc7 clang::ExecuteCompilerInvocation(clang::CompilerInstance) + 1002 25 clang 0x0000000000addb67 cc1_main(char const, char const, char const, void) + 990 26 clang 0x0000000000aea209 main + 484 27 libc.so.6 0x00007f142dda4c4d __libc_start_main + 253 28 clang 0x0000000000adcde9 Stack dump:

  1. Program arguments: /usr/local/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name locale.cpp -pic-level 2 -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.20.1 -momit-leaf-frame-pointer -g -coverage-file locale.o -nostdinc++ -resource-dir /usr/local/bin/../lib/clang/3.1 -I ../include -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/local/include -internal-isystem /usr/local/bin/../lib/clang/3.1/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Os -Wall -Wextra -Wshadow -Wconversion -Wnewline-eof -Wpadded -Wmissing-prototypes -Wstrict-aliasing=2 -Wstrict-overflow=4 -std=c++0x -fdeprecated-macro -fdebug-compilation-dir /home/xeo/libcxx/lib -ferror-limit 19 -fmessage-length 80 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o locale.o -x c++ ../src/locale.cpp
  2. parser at end of file
  3. Per-module optimization passes
  4. Running pass 'Interprocedural Sparse Conditional Constant Propagation' on module '../src/locale.cpp'. clang: error: unable to execute command: Aborted clang: error: clang frontend command failed due to signal (use -v to see invocation) clang: note: diagnostic msg: Please submit a bug report to http://llvm.org/bugs/ and include command line arguments and all diagnostic information. clang: note: diagnostic msg: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /tmp/locale-dkWoca.ii clang: note: diagnostic msg: /tmp/locale-dkWoca.sh
llvmbot commented 12 years ago

Indeed unlucky, after recompiling with r149195, libc++ builds just fine.

llvmbot commented 12 years ago

I think you were just unlucky in the revision you checked out. This issue was resolved shortly after being introduced.

llvmbot commented 12 years ago

Since the attachement wasn't uploaded because it's too big, here's an external link to it: http://www.mediafire.com/?t1my041t6sjqx51