[LLVMbugs] [Bug 11926] New: Clang segfaults during bootstrap (warning related?)
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Feb 5 04:07:24 PST 2012
http://llvm.org/bugs/show_bug.cgi?id=11926
Bug #: 11926
Summary: Clang segfaults during bootstrap (warning related?)
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: markus at trippelsdorf.de
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
...
llvm[1]: Compiling regexec.c for Release build
0 clang 0x000000000187a1df
1 clang 0x000000000187a530
2 libpthread.so.0 0x00002ba5e7f05190
3 clang 0x0000000000ced9e2
4 clang 0x0000000000ceec09
5 clang 0x0000000000cf06cc
clang::runUninitializedVariablesAnalysis(clang::DeclContext const&, clang::CFG
const&, clang::AnalysisDeclContext&, clang::UninitVariablesHandler&,
clang::UninitVariablesAnalysisStats&) + 1292
6 clang 0x0000000000b472d7
clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::sema::AnalysisBasedWarnings::Policy,
clang::sema::FunctionScopeInfo*, clang::Decl const*, clang::BlockExpr const*) +
1015
7 clang 0x00000000008c1d2c
clang::Sema::PopFunctionScopeInfo(clang::sema::AnalysisBasedWarnings::Policy
const*, clang::Decl const*, clang::BlockExpr const*) + 172
8 clang 0x00000000009391cd
clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 333
9 clang 0x000000000085aba9
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 169
10 clang 0x00000000008705ca
clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&) + 938
11 clang 0x000000000087e00b
clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int,
bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 779
12 clang 0x000000000086bc44
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AccessSpecifier) + 132
13 clang 0x000000000086c2b5
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&,
clang::AccessSpecifier) + 725
14 clang 0x000000000086f182
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 3330
15 clang 0x000000000086f65f
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 159
16 clang 0x0000000000845d4d clang::ParseAST(clang::Sema&, bool) + 269
17 clang 0x00000000005e96d7
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 247
18 clang 0x00000000005d365f
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1247
19 clang 0x00000000005c9505 cc1_main(char const**, char const**, char
const*, void*) + 9157
20 clang 0x00000000005d24d5 main + 7573
21 libc.so.6 0x00002ba5e86dd405 __libc_start_main + 245
22 clang 0x00000000005c6ea9
Stack dump:
0. Program arguments: /usr/local/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-main-file-name regexec.c -pic-level 2 -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu amdfam10 -target-linker-version 2.22.52.20120205
-momit-leaf-frame-pointer -coverage-file
/var/tmp/build_llvm_clang/lib/Support/Release/regexec.o -resource-dir
/usr/local/bin/../lib/clang/3.1 -dependency-file
/var/tmp/build_llvm_clang/lib/Support/Release/regexec.d.tmp -MP -MT
/var/tmp/build_llvm_clang/lib/Support/Release/regexec.o -MT
/var/tmp/build_llvm_clang/lib/Support/Release/regexec.d -D NDEBUG -D
_GNU_SOURCE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D
__STDC_LIMIT_MACROS -I /var/tmp/build_llvm_clang/include -I
/var/tmp/build_llvm_clang/lib/Support -I /var/tmp/llvm/include -I
/var/tmp/llvm/lib/Support -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 -O3 -Wall -W -Wno-unused-parameter
-Wwrite-strings -fconst-strings -fdebug-compilation-dir
/var/tmp/build_llvm_clang/lib/Support -ferror-limit 19 -fmessage-length 149
-mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak
-fobjc-fragile-abi -fdiagnostics-show-option -fcolor-diagnostics -o
/var/tmp/build_llvm_clang/lib/Support/Release/regexec.o -x c
/var/tmp/llvm/lib/Support/regexec.c
1. /var/tmp/llvm/lib/Support/regengine.inc:482:1: current parser token
'static'
2. /var/tmp/llvm/lib/Support/regengine.inc:297:1: parsing function body
'ldissect'
clang: error: unable to execute command: Segmentation fault
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.
llvm[1]: Compiling regfree.c for Release build
clang: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang: note: diagnostic msg: /tmp/regexec-DxeKBH.i
clang: note: diagnostic msg: /tmp/regexec-DxeKBH.sh
Delta reduced to:
% cat test.ii
namespace std
{
template < class, class > struct pair;
template < typename > struct DenseMapInfo;
template < typename From > struct simplify_type {
typedef From SimpleType;
};
template < class To, class > struct cast_retty_impl {
typedef To *ret_type;
};
template < class, class, class > struct cast_retty_wrap;
template < class To, class FromTy > struct cast_retty_wrap <To,
FromTy,
FromTy > {
typedef typename cast_retty_impl < To,
FromTy >::ret_type ret_type;
};
template < class To, class From > struct cast_retty {
typedef typename cast_retty_wrap < To,
From,
typename simplify_type < From >::SimpleType >::ret_type ret_type;
};
template < class X, class Y > typename cast_retty < X,
Y * >::ret_type dyn_cast_or_null (Y)
{
}
template < bool, typename T, typename > struct conditional {
typedef T type;
};
class FoldingSetImpl
{
public:
class Node
{
};
};
typedef FoldingSetImpl::Node FoldingSetNode;
class MDNode:FoldingSetNode
{
public:
int getNumOperands () const {
}
bool isFunctionLocal () const {
}
};
template < typename KeyT, typename ValueT, typename =
DenseMapInfo < KeyT >, typename = DenseMapInfo < ValueT >, bool =
0 > class DenseMapIterator;
template < typename KeyT, typename ValueT, typename KeyInfoT =
DenseMapInfo < KeyT >, typename = DenseMapInfo < ValueT > >class DenseMap
{
public:
typedef DenseMapIterator < KeyT,
KeyInfoT > iterator;
iterator end () {
}
iterator find (KeyT) {
}
ValueT & operator[](KeyT) {
}
};
template < typename KeyT, typename ValueT, typename, typename,
bool > class DenseMapIterator
{
typedef std::pair < KeyT,
ValueT > Bucket;
typedef DenseMapIterator ConstIterator;
typedef typename conditional < 0,
Bucket,
Bucket >::type value_type;
typedef value_type *pointer;
pointer Ptr,
End;
public:
DenseMapIterator ():Ptr (), End () {
}
bool operator!= (ConstIterator) {
}
};
class SlotTracker
{
DenseMap < const MDNode *,
int >mdnMap;
int mdnNext;
typedef DenseMap < const MDNode *,
int >::iterator mdn_iterator;
void CreateMetadataSlot (const MDNode *);
};
void SlotTracker::CreateMetadataSlot (const MDNode * N)
{
0;
if (!N->isFunctionLocal ()) {
mdn_iterator I = mdnMap.find (0);
if (I != mdnMap.end ()) ;
int DestSlot = mdnNext++;
mdnMap[0] = DestSlot;
}
for (int i, e = N->getNumOperands (); i = e;)
if (MDNode * Op = dyn_cast_or_null < MDNode > (i)) ;
}
% /usr/local/bin/clang -cc1 -emit-obj -O0 -Wall -x c++ -o /dev/null test.ii
...
0 clang 0x000000000187a1df
1 clang 0x000000000187a530
2 libpthread.so.0 0x00007f4cb1c0b190
3 clang 0x0000000000ced9e2
4 clang 0x0000000000ceec09
5 clang 0x0000000000cf06cc
clang::runUninitializedVariablesAnalysis(clang::DeclContext const&, clang::CFG
const&, clang::AnalysisDeclContext&, clang::UninitVariablesHandler&,
clang::UninitVariablesAnalysisStats&) + 1292
6 clang 0x0000000000b472d7
clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::sema::AnalysisBasedWarnings::Policy,
clang::sema::FunctionScopeInfo*, clang::Decl const*, clang::BlockExpr const*) +
1015
7 clang 0x00000000008c1d2c
clang::Sema::PopFunctionScopeInfo(clang::sema::AnalysisBasedWarnings::Policy
const*, clang::Decl const*, clang::BlockExpr const*) + 172
8 clang 0x00000000009391cd
clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 333
9 clang 0x000000000085aba9
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 169
10 clang 0x00000000008705ca
clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&) + 938
11 clang 0x000000000087e00b
clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int,
bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 779
12 clang 0x000000000086bc44
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AccessSpecifier) + 132
13 clang 0x000000000086c2b5
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&,
clang::AccessSpecifier) + 725
14 clang 0x000000000086f182
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 3330
15 clang 0x000000000088a359
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::Parser::BalancedDelimiterTracker&) + 377
16 clang 0x000000000088f1f3 clang::Parser::ParseNamespace(unsigned
int, clang::SourceLocation&, clang::SourceLocation) + 1427
17 clang 0x00000000008833cc
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 524
18 clang 0x000000000086e8db
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 1115
19 clang 0x000000000086f65f
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 159
20 clang 0x0000000000845d4d clang::ParseAST(clang::Sema&, bool) + 269
21 clang 0x00000000005e96d7
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 247
22 clang 0x00000000005d365f
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1247
23 clang 0x00000000005c9505 cc1_main(char const**, char const**, char
const*, void*) + 9157
24 clang 0x00000000005d24d5 main + 7573
25 libc.so.6 0x00007f4cb1433405 __libc_start_main + 245
26 clang 0x00000000005c6ea9
Stack dump:
0. Program arguments: /usr/local/bin/clang -cc1 -emit-obj -O0 -Wall -x c++
-o /dev/null test.ii
1. <eof> parser at end of file
2. test.ii:1:1: parsing namespace 'std'
3. test.ii:92:1: parsing function body 'CreateMetadataSlot'
[1] 16335 segmentation fault /usr/local/bin/clang -cc1 -emit-obj -O0 -Wall
-x c++ -o /dev/null test.ii 2>&
Segfault only happens with -Wall.
--
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