[LLVMbugs] [Bug 10630] New: segfault with precompiled header

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 10 01:29:55 PDT 2011


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

           Summary: segfault with precompiled header
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: devlists at shadowlab.org
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=7046)
 --> (http://llvm.org/bugs/attachment.cgi?id=7046)
Test project

I'm getting a segfault while trying to compile some code with a precompiled
header.
This error does not append when trying to compile the file directly, so I
cannot attach a preprocessed version.

I didn't managed to narrow down the problem as much as I would like, but I
managed to get a way to reproduce it though.

I'm working on a Mac OS X 10.6.8 / x86_64.

To reproduce the error, you can try to compile the attached archive.

Uncompress the archive and 'cd' to the uncompressed directory.

Edit the compile.sh script to change clang path if needed.

run the script.

$tar -xzf crash.tgz 
$cd crash
$./compile.sh

clang version 3.0 (trunk 137207)
Target: x86_64-apple-darwin10.8.0
Thread model: posix

0  clang             0x000000010102caf2
llvm::SmallVectorImpl<llvm_regmatch_t>::resize(unsigned int) + 1258
1  clang             0x000000010102d0f9
llvm::SmallVectorImpl<llvm_regmatch_t>::resize(unsigned int) + 2801
2  libSystem.B.dylib 0x00007fff83ed61ba _sigtramp + 26
3  clang             0x000000010024bac0
clang::Parser::LateParsedMethodDeclaration::~LateParsedMethodDeclaration() +
50018
4  clang             0x00000001000aa0e5
clang::ASTDeserializationListener::DeclRead(unsigned int, clang::Decl const*) +
43487
5  clang             0x00000001000acc9d
clang::ASTDeserializationListener::DeclRead(unsigned int, clang::Decl const*) +
54679
6  clang             0x00000001007c1571
clang::Redeclarable<clang::FunctionDecl>::setPreviousDeclaration(clang::FunctionDecl*)
+ 12169
7  clang             0x00000001007c14d9
clang::Redeclarable<clang::FunctionDecl>::setPreviousDeclaration(clang::FunctionDecl*)
+ 12017
8  clang             0x00000001007c167d
clang::Redeclarable<clang::FunctionDecl>::setPreviousDeclaration(clang::FunctionDecl*)
+ 12437
9  clang             0x0000000100406ede llvm::APSInt::operator<=(llvm::APSInt
const&) const + 24078
10 clang             0x0000000100409c27 llvm::APSInt::operator<=(llvm::APSInt
const&) const + 35671
11 clang             0x000000010040a3d7 llvm::APSInt::operator<=(llvm::APSInt
const&) const + 37639
12 clang             0x0000000100326672
clang::FunctionDecl::getCallResultType() const + 162998
13 clang             0x000000010024a2a2
clang::Parser::LateParsedMethodDeclaration::~LateParsedMethodDeclaration() +
43844
14 clang             0x0000000100252b14
clang::ParsedAttributes::addNew(clang::IdentifierInfo*, clang::SourceLocation,
clang::IdentifierInfo*, clang::SourceLocation, clang::IdentifierInfo*,
clang::SourceLocation, clang::AvailabilityChange const&,
clang::AvailabilityChange const&, clang::AvailabilityChange const&,
clang::SourceLocation, bool, bool) + 20246
15 clang             0x00000001002543b0
clang::ParsedAttributes::addNew(clang::IdentifierInfo*, clang::SourceLocation,
clang::IdentifierInfo*, clang::SourceLocation, clang::IdentifierInfo*,
clang::SourceLocation, clang::AvailabilityChange const&,
clang::AvailabilityChange const&, clang::AvailabilityChange const&,
clang::SourceLocation, bool, bool) + 26546
16 clang             0x00000001002558c8
clang::ParsedAttributes::addNew(clang::IdentifierInfo*, clang::SourceLocation,
clang::IdentifierInfo*, clang::SourceLocation, clang::IdentifierInfo*,
clang::SourceLocation, clang::AvailabilityChange const&,
clang::AvailabilityChange const&, clang::AvailabilityChange const&,
clang::SourceLocation, bool, bool) + 31946
17 clang             0x0000000100249f44
clang::Parser::LateParsedMethodDeclaration::~LateParsedMethodDeclaration() +
42982
18 clang             0x000000010027f7e5
clang::TemplateIdAnnotation::Allocate(unsigned int) + 20101
19 clang             0x000000010027fc24
clang::TemplateIdAnnotation::Allocate(unsigned int) + 21188
20 clang             0x00000001002805ef
clang::TemplateIdAnnotation::Allocate(unsigned int) + 23695
21 clang             0x000000010025666a
clang::ParsedAttributes::addNew(clang::IdentifierInfo*, clang::SourceLocation,
clang::IdentifierInfo*, clang::SourceLocation, clang::IdentifierInfo*,
clang::SourceLocation, clang::AvailabilityChange const&,
clang::AvailabilityChange const&, clang::AvailabilityChange const&,
clang::SourceLocation, bool, bool) + 35436
22 clang             0x000000010024e99c
clang::ParsedAttributes::addNew(clang::IdentifierInfo*, clang::SourceLocation,
clang::IdentifierInfo*, clang::SourceLocation, clang::IdentifierInfo*,
clang::SourceLocation, clang::AvailabilityChange const&,
clang::AvailabilityChange const&, clang::AvailabilityChange const&,
clang::SourceLocation, bool, bool) + 3486
23 clang             0x000000010024d514
clang::Parser::LateParsedMethodDeclaration::~LateParsedMethodDeclaration() +
56758
24 clang             0x000000010028021e
clang::TemplateIdAnnotation::Allocate(unsigned int) + 22718
25 clang             0x0000000100280992
clang::TemplateIdAnnotation::Allocate(unsigned int) + 24626
26 clang             0x000000010023d13d clang::MSP430InterruptAttr*
clang::Decl::getAttr<clang::MSP430InterruptAttr>() const + 743
27 clang             0x000000010002ca21 llvm::DenseMap<clang::IdentifierInfo
const*, unsigned int, llvm::DenseMapInfo<clang::IdentifierInfo const*>,
llvm::DenseMapInfo<unsigned int> >::FindAndConstruct(clang::IdentifierInfo
const* const&) + 7095
28 clang             0x000000010001782b char const** llvm::SmallVectorImpl<char
const*>::insert<__gnu_cxx::__normal_iterator<char const**, std::vector<char
const*, std::allocator<char const*> > > >(char const**,
__gnu_cxx::__normal_iterator<char const**, std::vector<char const*,
std::allocator<char const*> > >, __gnu_cxx::__normal_iterator<char const**,
std::vector<char const*, std::allocator<char const*> > >) + 2655
29 clang             0x000000010001188b llvm::cl::opt<std::string, true,
llvm::cl::parser<std::string> >::opt<char [17], llvm::cl::value_desc,
llvm::cl::desc, llvm::cl::OptionHidden, llvm::cl::LocationClass<std::string>
>(char const (&) [17], llvm::cl::value_desc const&, llvm::cl::desc const&,
llvm::cl::OptionHidden const&, llvm::cl::LocationClass<std::string> const&) +
6259
30 clang             0x0000000100014840 llvm::MCRegisterInfo::~MCRegisterInfo()
+ 1756
31 clang             0x0000000100010de4 llvm::cl::opt<std::string, true,
llvm::cl::parser<std::string> >::opt<char [17], llvm::cl::value_desc,
llvm::cl::desc, llvm::cl::OptionHidden, llvm::cl::LocationClass<std::string>
>(char const (&) [17], llvm::cl::value_desc const&, llvm::cl::desc const&,
llvm::cl::OptionHidden const&, llvm::cl::LocationClass<std::string> const&) +
3532
Stack dump:
0.    Program arguments: /opt/llvm/stage1/bin/clang -cc1 -triple
x86_64-apple-macosx10.6.8 -fsyntax-only -disable-free -main-file-name
saplay.cpp -pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables
-target-cpu core2 -target-linker-version 97.17 -resource-dir
/opt/llvm/stage1/bin/../lib/clang/3.0 -include-pch SharedPrefix.pch.pth -U
__STRICT_ANSI__ -I include -stdlib=libc++ -O0 -std=c++0x -fdeprecated-macro
-ferror-limit 19 -fmessage-length 170 -stack-protector 1 -fblocks
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -x
c++ saplay.cpp 
1.    /usr/include/c++/v1/typeinfo:89:5: current parser token 'size_t'
2.    /usr/include/c++/v1/typeinfo:65:1: parsing namespace 'std'
3.    /usr/include/c++/v1/typeinfo:68:1: parsing struct/union/class body
'type_info'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal 2 (use -v to see
invocation)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list