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 crashes on last version #19

Closed
beniz opened this issue Apr 23, 2014 · 8 comments
Closed

clang crashes on last version #19

beniz opened this issue Apr 23, 2014 · 8 comments

Comments

@beniz
Copy link
Collaborator

beniz commented Apr 23, 2014

libtool: compile:  clang++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/eigen3 -Wall -g -std=c++11 -fopenmp -g -O2 -MT cmaparameters.lo -MD -MP -MF .deps/cmaparameters.Tpo -c cmaparameters.cc -o cmaparameters.o >/dev/null 2>&1
0  libLLVM-3.5.so.1 0x00002b5f9e10d7e2 llvm::sys::PrintStackTrace(_IO_FILE*) + 34
1  libLLVM-3.5.so.1 0x00002b5f9e10d5d4
2  libpthread.so.0  0x00002b5f9ebd0340
3  clang            0x0000000000863d5e clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) + 1934
4  clang            0x00000000008a0ade clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(clang::CanQual<clang::Type>, bool, llvm::ArrayRef<clang::CanQual<clang::Type> >, clang::FunctionType::ExtInfo, clang::CodeGen::RequiredArgs) + 606
5  clang            0x00000000008a7fe1
6  clang            0x00000000008a8810 clang::CodeGen::CodeGenTypes::arrangeCXXMethodType(clang::CXXRecordDecl const*, clang::FunctionProtoType const*) + 192
7  clang            0x0000000000849ed3 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) + 67
8  clang            0x000000000084ac64 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) + 244
9  clang            0x000000000084d42d clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 1341
10 clang            0x000000000084dc33
11 clang            0x00000000007f5643
12 clang            0x00000000007f30dc
13 clang            0x0000000000cbece5 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool) + 1813
14 clang            0x0000000000c98fe2 clang::Sema::InstantiateClassMembers(clang::SourceLocation, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&, clang::TemplateSpecializationKind) + 898
15 clang            0x0000000000c98ef3 clang::Sema::InstantiateClassMembers(clang::SourceLocation, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&, clang::TemplateSpecializationKind) + 659
16 clang            0x0000000000c99196 clang::Sema::InstantiateClassTemplateSpecializationMembers(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind) + 86
17 clang            0x0000000000c40148 clang::Sema::ActOnExplicitInstantiation(clang::Scope*, clang::SourceLocation, clang::SourceLocation, unsigned int, clang::SourceLocation, clang::CXXScopeSpec const&, clang::OpaquePtr<clang::TemplateName>, clang::SourceLocation, clang::SourceLocation, llvm::MutableArrayRef<clang::ParsedTemplateArgument>, clang::SourceLocation, clang::AttributeList*) + 1432
18 clang            0x000000000099094c clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::Parser::ParsedAttributesWithRange&) + 5180
19 clang            0x0000000000979f0e clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 2542
20 clang            0x00000000009cc59d clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 909
21 clang            0x00000000009cde19 clang::Parser::ParseExplicitInstantiation(unsigned int, clang::SourceLocation, clang::SourceLocation, clang::SourceLocation&, clang::AccessSpecifier) + 169
22 clang            0x00000000009cdfdc clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 300
23 clang            0x000000000097e9b8 clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 584
24 clang            0x0000000000968544 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 372
25 clang            0x0000000000989458 clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation, std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*, std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation, std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) + 408
26 clang            0x0000000000989d0e clang::Parser::ParseNamespace(unsigned int, clang::SourceLocation&, clang::SourceLocation) + 2014
27 clang            0x000000000097ea10 clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 672
28 clang            0x0000000000968544 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 372
29 clang            0x0000000000968c8c clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 428
30 clang            0x000000000096027b clang::ParseAST(clang::Sema&, bool, bool) + 283
31 clang            0x000000000068f409 clang::FrontendAction::Execute() + 169
32 clang            0x000000000066f795 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 293
33 clang            0x000000000065a276 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1654
34 clang            0x0000000000654e48 cc1_main(char const**, char const**, char const*, void*) + 1176
35 clang            0x0000000000653c10 main + 4640
36 libc.so.6        0x00002b5f9f319ec5 __libc_start_main + 245
37 clang            0x0000000000653e7f
Stack dump:
0.  Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -main-file-name cmastrategy.cc -mrelocation-model pic -pic-level 2 -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 2.24 -momit-leaf-frame-pointer -g -coverage-file /home/beniz/research/siminole/dev/libcmaes/src/.libs/cmastrategy.o -resource-dir /usr/bin/../lib/clang/3.5 -dependency-file .deps/cmastrategy.Tpo -sys-header-deps -MP -MT cmastrategy.lo -D HAVE_CONFIG_H -D PIC -I . -I .. -I /usr/include/eigen3 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/x86_64-linux-gnu -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8 -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.5/include -internal-externc-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wall -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /home/beniz/research/siminole/dev/libcmaes/src -ferror-limit 19 -fmessage-length 112 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o .libs/cmastrategy.o -x c++ cmastrategy.cc 
1.  cmastrategy.cc:163:47: current parser token ';'
2.  cmastrategy.cc:29:1: parsing namespace 'libcmaes'
3.  cmastrategy.cc:33:92: LLVM IR generation of declaration 'libcmaes::CMAStrategy<libcmaes::CovarianceUpdate>::<anonymous class>::operator()'
4.  cmastrategy.cc:33:92: Generating code for declaration 'libcmaes::CMAStrategy<libcmaes::CovarianceUpdate>::<anonymous class>::operator()'
7 warnings generated.
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Ubuntu clang version 3.5-1ubuntu1 (trunk) (based on LLVM 3.5)
Target: x86_64-pc-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://bugs.debian.org/ and include the crash backtrace, preprocessed source, and associated run script.
libtool: compile:  clang++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/eigen3 -Wall -g -std=c++11 -fopenmp -g -O2 -MT esostrategy.lo -MD -MP -MF .deps/esostrategy.Tpo -c esostrategy.cc -o esostrategy.o >/dev/null 2>&1
clang: note: diagnostic msg: 
********************

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

********************
make[2]: *** [cmastrategy.lo] Error 1
make[2]: *** Waiting for unfinished jobs....

@beniz beniz self-assigned this Apr 23, 2014
@beniz
Copy link
Collaborator Author

beniz commented Apr 23, 2014

both clang-3.4 and clang-3.5 do crash here.

@beniz
Copy link
Collaborator Author

beniz commented Apr 23, 2014

I've submitted a bug to clang developers, to be followed here: http://llvm.org/bugs/show_bug.cgi?id=19532

@beniz
Copy link
Collaborator Author

beniz commented Nov 13, 2014

Updated the bug @ clang, still no response. This is definitely a clang problem, so there's nothing more that can be done here on this side.

@beniz
Copy link
Collaborator Author

beniz commented Nov 17, 2014

FYI, clang bug was confirmed at http://llvm.org/bugs/show_bug.cgi?id=19532

@beniz beniz added compilation and removed bug labels Nov 17, 2014
@beniz
Copy link
Collaborator Author

beniz commented Jan 5, 2015

Just got a hint from clang devs on how to work around the clang bug, this issue should be updated soon then.

beniz pushed a commit that referenced this issue Jan 6, 2015
…lag, while external gflags seems to not be available for libc++, ref #19
@beniz
Copy link
Collaborator Author

beniz commented Jan 6, 2015

Work around the bug is now working! Issue remains with external gflags lib, which is outside our realm, but I will investigate fully before the fix is merged.

FTR, for now, compiling with clang on linux requires:

./configure CXXFLAGS="-O2 -stdlib=libc++ -std=c++11"

This forces the use of libc++ as clang 3.5 is buggy with libstdc++ 4.9 (http://reviews.llvm.org/rL201729). I will investigate clang 3.6 in case the fix from llvm has been merged there.

@beniz
Copy link
Collaborator Author

beniz commented Jan 6, 2015

After much testing, more recent versions of clang-3.5 work on the stdlibc++:

./configure CXXFLAGS="-O2 -std=c++11"

So, AFAIK:

  • Ubuntu 14.04: needs -stdlib=libc++
  • Ubuntu 14.10: use line above
    I will test on OSX when possible in order to find proper settings as well.

clang-3.6 utterly fails, in all my experiments. Since it is the development version of clang, I am not supporting it for now.

@beniz
Copy link
Collaborator Author

beniz commented Jan 7, 2015

libcmaes now compiles fine on OSX with default clang compiler, the documentation has been updated with a quickstart section for building without too much hassle on OSX, see https://github.com/beniz/libcmaes/wiki/Building-libcmaes-on-Mac-OSX

@beniz beniz closed this as completed Jan 7, 2015
andrewsali pushed a commit to andrewsali/libcmaes that referenced this issue Jan 31, 2016
…lag, while external gflags seems to not be available for libc++, ref CMA-ES#19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant