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

Clang 3.6 asserting: UNREACHABLE executed lib/IR/Value.cpp:781! #22667

Closed
gruech mannequin opened this issue Jan 22, 2015 · 12 comments
Closed

Clang 3.6 asserting: UNREACHABLE executed lib/IR/Value.cpp:781! #22667

gruech mannequin opened this issue Jan 22, 2015 · 12 comments
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category

Comments

@gruech
Copy link
Mannequin

gruech mannequin commented Jan 22, 2015

Bugzilla Link 22293
Resolution FIXED
Resolved on Feb 12, 2015 00:16
Version 3.6
OS Linux
CC @majnemer,@zmodem

Extended Description

I tested Clang 3.6-branch in version r226728, self-compiled with Clang like described at the getting started page with openSuse's Clang 3.5 and -O3.

I checkout our modules and while compiling them, the compiler errored out with the message below. The setup is a little bit of work, as several modules from Dune (dune-project.org) have to be installed together with the external module dune-alugrid.
Please tell me, if you need some more files or advice how to reproduce this.

[ 85%] Building CXX object lib/CMakeFiles/dunealugrid.dir/__/dune/alugrid/impl/2d/vtx_btree.cc.o
While deleting: void (%"struct.ALU2DGrid::Vtx_btree<2, 3>::Node") %
An asserting value handle still pointed to this value!
UNREACHABLE executed at /home/asdf/downloads/llvm-3.6-svn/lib/IR/Value.cpp:781!
#​0 0x1536bf8 llvm::sys::PrintStackTrace(_IO_FILE*) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1536bf8)
#​1 0x15381db SignalHandler(int) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x15381db)
#​2 0x7f1cb5f4b890 __restore_rt (/lib64/libpthread.so.0+0xf890)
#​3 0x7f1cb5109187 __GI_raise (/lib64/libc.so.6+0x35187)
#​4 0x7f1cb510a538 GI_abort (/lib64/libc.so.6+0x36538)
#​5 0x14fe953 llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x14fe953)
#​6 0x12475eb llvm::ValueHandleBase::ValueIsDeleted(llvm::Value*) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x12475eb)
#​7 0x1246fa9 llvm::Value::~Value() (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1246fa9)
#​8 0x1195c6d llvm::Function::~Function() (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1195c6d)
#​9 0x1195fb9 llvm::Function::~Function() (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1195fb9)
#​10 0x1a448ba (anonymous namespace)::ItaniumCXXABI::emitCXXStructor(clang::CXXMethodDecl const*, clang::CodeGen::StructorType) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1a448ba)
#​11 0x19f3679 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x19f3679)
#​12 0x1a40f14 (anonymous namespace)::ItaniumCXXABI::EmitCXXDestructors(clang::CXXDestructorDecl const*) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1a40f14)
#​13 0x19958ef (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x19958ef)
#​14 0x198c717 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x198c717)
#​15 0x257211a clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x257211a)
#​16 0x253fc6f clang::Sema::InstantiateClassMembers(clang::SourceLocation, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&, clang::TemplateSpecializationKind) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x253fc6f)
#​17 0x253fed5 clang::Sema::InstantiateClassMembers(clang::SourceLocation, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&, clang::TemplateSpecializationKind) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x253fed5)
#​18 0x25402d4 clang::Sema::InstantiateClassTemplateSpecializationMembers(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x25402d4)
#​19 0x24c1718 clang::Sema::ActOnExplicitInstantiation(clang::Scope*, clang::SourceLocation, clang::SourceLocation, unsigned int, clang::SourceLocation, clang::CXXScopeSpec const&, clang::OpaquePtrclang::TemplateName, clang::SourceLocation, clang::SourceLocation, llvm::MutableArrayRefclang::ParsedTemplateArgument, clang::SourceLocation, clang::AttributeList*) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x24c1718)
#​20 0x1f8064c clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::Parser::ParsedAttributesWithRange&) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1f8064c)
#​21 0x1f62f1e clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1f62f1e)
#​22 0x1fda4e4 clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1fda4e4)
#​23 0x1fd99b4 clang::Parser::ParseExplicitInstantiation(unsigned int, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation&, clang::AccessSpecifier) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1fd99b4)
#​24 0x1fd9881 clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1fd9881)
#​25 0x1f61d75 clang::Parser::ParseDeclaration(unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1f61d75)
#​26 0x1f52953 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1f52953)
#​27 0x1f7a699 clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation, std::allocatorclang::SourceLocation >&, std::vector<clang::IdentifierInfo*, std::allocatorclang::IdentifierInfo* >&, std::vector<clang::SourceLocation, std::allocatorclang::SourceLocation >&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1f7a699)
#​28 0x1f79ee2 clang::Parser::ParseNamespace(unsigned int, clang::SourceLocation&, clang::SourceLocation) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1f79ee2)
#​29 0x1f61bb8 clang::Parser::ParseDeclaration(unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1f61bb8)
#​30 0x1f52953 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1f52953)
#​31 0x1f5218a clang::Parser::ParseTopLevelDecl(clang::OpaquePtrclang::DeclGroupRef&) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1f5218a)
#​32 0x1f4df16 clang::ParseAST(clang::Sema&, bool, bool) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x1f4df16)
#​33 0x16e68ae clang::FrontendAction::Execute() (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x16e68ae)
#​34 0x16b770c clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x16b770c)
#​35 0x176fce2 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x176fce2)
#​36 0x6f6ff4 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x6f6ff4)
#​37 0x6f5bc0 main (/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6+0x6f5bc0)
#​38 0x7f1cb50f5b05 libc_start_main (/lib64/libc.so.6+0x21b05)
#​39 0x6f27aa _start /home/abuild/rpmbuild/BUILD/glibc-2.19/csu/../sysdeps/x86_64/start.S:125:0
Stack dump:
0. Program arguments: /home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name vtx_btree.cc -mrelocation-model static -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -g -dwarf-column-info -coverage-file /home/asdf/Documents/dune/complete/dune-alugrid/build-cmake/lib/CMakeFiles/dunealugrid.dir//dune/alugrid/impl/2d/vtx_btree.cc.o -resource-dir /home/asdf/downloads/llvm-3.6-svn/build/bin/../lib/clang/3.6.0 -D HAVE_CONFIG_H -D DUNE_AVOID_CAPABILITIES_IS_PARALLEL_DEPRECATION_WARNING -D DUNE_AVOID_SGRID_DEPRE_WARNING_BECAUSE_I_KNOW_WHAT_IM_DOING -D DISABLE_DEPRECATED_METHOD_CHECK=1 -I /home/asdf/Documents/dune/complete/dune-alugrid/build-cmake -I /home/asdf/Documents/dune/complete/dune-alugrid -I /usr/lib64/mpi/gcc/openmpi/include/openmpi/opal/mca/hwloc/hwloc152/hwloc/include -I /usr/lib64/mpi/gcc/openmpi/include/openmpi/opal/mca/event/libevent2019/libevent -I /usr/lib64/mpi/gcc/openmpi/include/openmpi/opal/mca/event/libevent2019/libevent/include -I /usr/lib64/mpi/gcc/openmpi/include -I /usr/lib64/mpi/gcc/openmpi/include/openmpi -I /home/asdf/Documents/dune/complete/dune-common -I /home/asdf/Documents/dune/complete/dune-geometry -I /home/asdf/Documents/dune/complete/dune-grid -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/4.9/../../../../include/c++/4.9 -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/4.9/../../../../include/c++/4.9/x86_64-suse-linux -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/4.9/../../../../include/c++/4.9/backward -internal-isystem /usr/local/include -internal-isystem /home/asdf/downloads/llvm-3.6-svn/build/bin/../lib/clang/3.6.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O0 -Wall -Wmissing-include-dirs -Wcast-align -Wno-cast-align -Wno-sign-compare -Wno-unused-parameter -pedantic -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /home/asdf/Documents/dune/complete/dune-alugrid/build-cmake/lib -ferror-limit 19 -fmessage-length 270 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o CMakeFiles/dunealugrid.dir/
/dune/alugrid/impl/2d/vtx_btree.cc.o -x c++ /home/asdf/Documents/dune/complete/dune-alugrid/dune/alugrid/impl/2d/vtx_btree.cc

  1.  /home/asdf/Documents/dune/complete/dune-alugrid/dune/alugrid/impl/2d/vtx_btree.cc:195:35: current parser token ';'
    
  2.  /home/asdf/Documents/dune/complete/dune-alugrid/dune/alugrid/impl/2d/vtx_btree.cc:7:1: parsing namespace 'ALU2DGrid'
    
  3.  /home/asdf/Documents/dune/complete/dune-alugrid/dune/alugrid/impl/2d/vtx_btree.h:39:7: LLVM IR generation of declaration 'ALU2DGrid::Vtx_btree<2, 3>::Node::~Node'
    
  4.  /home/asdf/Documents/dune/complete/dune-alugrid/dune/alugrid/impl/2d/vtx_btree.h:39:7: Generating code for declaration 'ALU2DGrid::Vtx_btree<2, 3>::Node::~Node'
    

clang-3.6: error: unable to execute command: Aborted
clang-3.6: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.6.0 (branches/release_36 226782)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang-3.6: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang-3.6: note: diagnostic msg:


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.6: note: diagnostic msg: /tmp/vtx_btree-80dfab.cpp
clang-3.6: note: diagnostic msg: /tmp/vtx_btree-80dfab.sh
clang-3.6: note: diagnostic msg:


/tmp/vtx_btree-80dfab.sh:

"/home/asdf/downloads/llvm-3.6-svn/build/bin/clang-3.6" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free" "-main-file-name" "vtx_btree.cc" "-mrelocation-model" "static" "-mthread-model" "posix" "-mdisable-fp-elim" "-relaxed-aliasing" "-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-fuse-init-array" "-target-cpu" "x86-64" "-g" "-dwarf-column-info" "-D" "HAVE_CONFIG_H" "-D" "DUNE_AVOID_CAPABILITIES_IS_PARALLEL_DEPRECATION_WARNING" "-D" "DUNE_AVOID_SGRID_DEPRE_WARNING_BECAUSE_I_KNOW_WHAT_IM_DOING" "-D" "DISABLE_DEPRECATED_METHOD_CHECK=1" "-O0" "-Wall" "-Wmissing-include-dirs" "-Wcast-align" "-Wno-cast-align" "-Wno-sign-compare" "-Wno-unused-parameter" "-pedantic" "-std=c++11" "-fdeprecated-macro" "-ferror-limit" "19" "-fmessage-length" "270" "-mstackrealign" "-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-x" "c++" "vtx_btree-80dfab.cpp"

@gruech
Copy link
Mannequin Author

gruech mannequin commented Jan 22, 2015

I cannot attach /tmp/vtx_btree-80dfab.cpp as it is more then 3 MiB large.

@majnemer
Copy link
Mannequin

majnemer mannequin commented Jan 22, 2015

I cannot attach /tmp/vtx_btree-80dfab.cpp as it is more then 3 MiB large.

Can you try compressing the file?

@gruech
Copy link
Mannequin Author

gruech mannequin commented Jan 23, 2015

@gruech
Copy link
Mannequin Author

gruech mannequin commented Jan 23, 2015

I cannot attach /tmp/vtx_btree-80dfab.cpp as it is more then 3 MiB large.

Can you try compressing the file?

Yeah, attached. Thanks for the hint.

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 23, 2015

reduce testcase
crashes with

clang -cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -mconstructor-aliases test.cpp

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 23, 2015

Reduces to just

template struct Node {
~Node() { delete this; }
};

template class Node<3>;

@gruech
Copy link
Mannequin Author

gruech mannequin commented Jan 31, 2015

Still crashing in r227681.

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 3, 2015

Fixed on trunk with r226896.

Hans, is this something you think should be backported to 3.6?

@zmodem
Copy link
Collaborator

zmodem commented Feb 4, 2015

Fixed on trunk with r226896.

Hans, is this something you think should be backported to 3.6?

Yes, please.

@gruech
Copy link
Mannequin Author

gruech mannequin commented Feb 10, 2015

Rafael do you mind to backport this week? It keeps crashing for me in the 3.6 branch.

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 10, 2015

Ported to 3.6 in r228684.

@gruech
Copy link
Mannequin Author

gruech mannequin commented Feb 12, 2015

Confirmed, by code compiles now. Thank you for fixing and packporting!

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category
Projects
None yet
Development

No branches or pull requests

2 participants