[LLVMbugs] [Bug 16977] New: Seg Fault when linking library

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 22 15:46:26 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16977

            Bug ID: 16977
           Summary: Seg Fault when linking library
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: artur at ebasoft.com.pl
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

0  clang     0x09f4dd5d llvm::sys::PrintStackTrace(_IO_FILE*) + 45
1  clang     0x09f4dfb0
2  clang     0x09f4d8f4
3            0x40022400 __kernel_sigreturn + 0
4  clang     0x0855bc96
5  clang     0x08560174
clang::CodeGen::CodeGenTypes::ComputeRecordLayout(clang::RecordDecl const*,
llvm::StructType*) + 2548
6  clang     0x085a2cb4
clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(clang::RecordDecl const*) +
1124
7  clang     0x085a4007
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) + 231
8  clang     0x085a5587
clang::CodeGen::CodeGenTypes::ConvertTypeForMem(clang::QualType) + 39
9  clang     0x085a452b
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) + 1547
10 clang     0x085e9428
clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(clang::CanQual<clang::Type>,
llvm::ArrayRef<clang::CanQual<clang::Type> >, clang::FunctionType::ExtInfo,
clang::CodeGen::RequiredArgs) + 728
11 clang     0x085e9707
12 clang     0x085e9894
clang::CodeGen::CodeGenTypes::arrangeCXXMethodType(clang::CXXRecordDecl const*,
clang::FunctionProtoType const*) + 244
13 clang     0x085e9a55
clang::CodeGen::CodeGenTypes::arrangeCXXMethodDeclaration(clang::CXXMethodDecl
const*) + 133
14 clang     0x085ead00
clang::CodeGen::CodeGenTypes::arrangeFunctionDeclaration(clang::FunctionDecl
const*) + 208
15 clang     0x085ead47
clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration(clang::GlobalDecl) + 55
16 clang     0x0859196f
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 63
17 clang     0x0859256a
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 250
18 clang     0x0859319f
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 1023
19 clang     0x085937ac
20 clang     0x0853b8e7
21 clang     0x0853ad54
22 clang     0x08a95ef2
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool) + 1618
23 clang     0x08a6cf4d
clang::Sema::InstantiateClassMembers(clang::SourceLocation,
clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&,
clang::TemplateSpecializationKind) + 957
24 clang     0x08a6d13b
clang::Sema::InstantiateClassTemplateSpecializationMembers(clang::SourceLocation,
clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind) +
107
25 clang     0x08a00bd6 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*) + 1574
26 clang     0x087037a7
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 4887
27 clang     0x086ed98a
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 4538
28 clang     0x08754079
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 793
29 clang     0x08755e5e clang::Parser::ParseExplicitInstantiation(unsigned int,
clang::SourceLocation, clang::SourceLocation, clang::SourceLocation&,
clang::AccessSpecifier) + 206
30 clang     0x0875608c
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 428
31 clang     0x086f14fa
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 634
32 clang     0x086dc97f
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 415
33 clang     0x086fc08b
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&) + 427
34 clang     0x086fc5d3 clang::Parser::ParseNamespace(unsigned int,
clang::SourceLocation&, clang::SourceLocation) + 1171
35 clang     0x086f156a
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 746
36 clang     0x086dc97f
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 415
37 clang     0x086dd3a8
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 200
38 clang     0x086d215f clang::ParseAST(clang::Sema&, bool, bool) + 303
39 clang     0x083ba7d7 clang::ASTFrontendAction::ExecuteAction() + 135
40 clang     0x08539d42 clang::CodeGenAction::ExecuteAction() + 34
41 clang     0x083baf28 clang::FrontendAction::Execute() + 168
42 clang     0x0839462a
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 250
43 clang     0x0837cddd
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1677
44 clang     0x08377a9e cc1_main(char const**, char const**, char const*,
void*) + 1262
45 clang     0x0835c0f4 main + 9588
46 libc.so.6 0x401eb935 __libc_start_main + 245
47 clang     0x0837698d
Stack dump:
0.    Program arguments: /usr/local/bin/clang -cc1 -triple i386-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name
geometry.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu pentium4
-target-feature +sse2 -target-linker-version 2.23.2 -g -femit-coverage-notes
-femit-coverage-data -coverage-file
/home/artur/projects/mmcxx/build/clang_deb/geometry/CMakeFiles/geometry.dir/src/geometry.cpp.o
-resource-dir /usr/local/bin/../lib/clang/3.4 -isystem /usr/include/qt4
-isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4/QtXml -isystem
/usr/include/qt4/QtCore -D QT_CORE_LIB -D QT_DEBUG -D QT_GUI_LIB -D QT_XML_LIB
-D USE_STATIC_RESOURCES -D WITH_INTERNAL_SOCI=1 -D WXUSINGDLL -D
_FILE_OFFSET_BITS=64 -D __WXGTK__ -D geometry_EXPORTS -D BUILD_WX_BACKEND=1 -I
/home/artur/projects/mmcxx/build/clang_deb/geometry -I
/home/artur/projects/mmcxx/utils/core/inc -I
/home/artur/projects/mmcxx/utils/inc -I /home/artur/projects/mmcxx/geometry/inc
-I /home/artur/projects/mmcxx/geometry -I
/home/artur/projects/mmcxx/build/clang_deb/config -I
/usr/local/lib/wx/include/gtk3-unicode-2.9 -I /usr/local/include/wx-2.9 -I
/usr/lib/openmpi/include -I /usr/lib/openmpi/include/openmpi -I
/usr/local/include -internal-isystem /usr/include/c++/v1 -internal-isystem
/usr/local/include -internal-isystem /usr/local/bin/../lib/clang/3.4/include
-internal-externc-isystem /usr/include/i386-linux-gnu -internal-externc-isystem
/include -internal-externc-isystem /usr/include -O0
-Wno-unused-command-line-argument -Wall -Wfatal-errors -Warray-bounds
-Wempty-body -Wignored-qualifiers -Wmissing-field-initializers -Wsign-compare
-Wtype-limits -Wuninitialized -Wunused -Werror=narrowing -Wno-unused-parameter
-Wextra -Winit-self -Wmissing-braces -Wmissing-include-dirs -Wsequence-point
-Wno-deprecated -Werror=return-type -Wempty-body -Wpacked -Wredundant-decls
-Wdisabled-optimization -Wcast-qual -Wstrict-aliasing -Winvalid-pch
-Woverloaded-virtual -Werror=non-virtual-dtor -Werror=delete-non-virtual-dtor
-Wimplicit-fallthrough -std=gnu++11 -fdebug-compilation-dir
/home/artur/projects/mmcxx/build/clang_deb/geometry -ferror-limit 19
-fmessage-length 193 -fvisibility hidden -fvisibility-inlines-hidden
-fsanitize=alignment,bool,bounds,enum,float-cast-overflow,float-divide-by-zero,integer-divide-by-zero,null,object-size,return,shift,signed-integer-overflow,unreachable,vla-bound,vptr
-pthread -mstackrealign -fobjc-runtime=gcc -fobjc-default-synthesize-properties
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-slp -o
CMakeFiles/geometry.dir/src/geometry.cpp.o -x c++
/home/artur/projects/mmcxx/geometry/src/geometry.cpp 

1.    /home/artur/projects/mmcxx/geometry/src/geometry.cpp:125:55: current
parser token ';'
2.    /home/artur/projects/mmcxx/geometry/src/geometry.cpp:23:1: parsing
namespace 'geom'
3.   
/home/artur/projects/mmcxx/geometry/src/../inc/geom/polyline_base.h:101:39:
LLVM IR generation of declaration
'geom::polyline_base_t<geom::contour_t<geom::point_t<double> >,
geom::point_t<double> >::this_'
4.   
/home/artur/projects/mmcxx/geometry/src/../inc/geom/polyline_base.h:101:39:
Generating code for declaration
'geom::polyline_base_t<geom::contour_t<geom::point_t<double> >,
geom::point_t<double> >::this_'
clang: fatal error: unable to execute command: Segmentation fault (core dumped)
clang version 3.4 (trunk 188615)
Target: i386-pc-linux-gnu
Thread model: posix
make[3]: *** [geometry/CMakeFiles/geometry.dir/src/geometry.cpp.o] Error 254
make[2]: *** [geometry/CMakeFiles/geometry.dir/all] Error 2
make[1]: *** [geometry/CMakeFiles/geometry.dir/rule] Error 2
make: *** [geometry/CMakeFiles/geometry.dir/rule] Error 2
*** Niepowodzenie ***

Project build with libcxx + libcxxrt in gnu++11 mode
Very simplified version of the code is below ,hovever this simplified version
dosn't fails at linking

#include <cstdio>

template<typename SuperType>
struct base_foo 
  {
  using super_type = SuperType;
  using super_type_const_ptr = super_type const *;
  using super_type_ptr = super_type *;
  super_type_const_ptr this_() const { return
static_cast<super_type_const_ptr>(this); }
  super_type_ptr this_() { return static_cast<super_type_ptr>(this); }
  void do_super() { this_()->bar(); }
  };
template<typename T>
struct point {};

template<typename P>
struct super_foo : public base_foo<super_foo<P> >
  {
    void bar() const { printf("fail"); }
  };

template struct base_foo<super_foo<point<double> > >;
int main(int argc, char **argv)
{
 super_foo<point<double> > foo;
 foo.do_super();
return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130822/1e26ae2e/attachment.html>


More information about the llvm-bugs mailing list