[LLVMbugs] [Bug 10812] New: Analyzer segfaults on indirect member function call.
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Aug 30 09:41:19 PDT 2011
http://llvm.org/bugs/show_bug.cgi?id=10812
Summary: Analyzer segfaults on indirect member function call.
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: Static Analyzer
AssignedTo: kremenek at apple.com
ReportedBy: devlists at shadowlab.org
CC: llvmbugs at cs.uiuc.edu
clang static analyzer segfaults while analyzing the following code, which is
just an indirect member function call using a member function pointer.
--------------- visit.cpp
class AtomVisitor {};
typedef bool (AtomVisitor::*VisitAtomFunc)();
bool ReadChild(AtomVisitor *_visitor, VisitAtomFunc _fct) {
return (_visitor->*_fct)();
}
-----------------------
% clang++ --version
clang version 3.0 (trunk 138800)
Target: x86_64-apple-darwin11.1.0
Thread model: posix
% clang++ --analyze visit.cpp
0 clang 0x000000010b20cfd2 _ZL15PrintStackTracePv + 34
1 clang 0x000000010b20d5c9 _ZL13SignalHandleri + 777
2 libsystem_c.dylib 0x00007fff8fc46cfa _sigtramp + 26
3 libsystem_c.dylib 0x000000010bc0acc0 _sigtramp + 18446603342596292576
4 clang 0x000000010a6f231c (anonymous
namespace)::TransferFunctions::Visit(clang::Stmt*) + 3052
5 clang 0x000000010a6efa8a (anonymous
namespace)::LiveVariablesImpl::runOnBlock(clang::CFGBlock const*,
clang::LiveVariables::LivenessValues, clang::LiveVariables::Observer*) + 138
6 clang 0x000000010a6f02fe
clang::LiveVariables::computeLiveness(clang::AnalysisContext&, bool) + 1518
7 clang 0x000000010a6dc220
clang::AnalysisContext::getLiveVariables() + 32
8 clang 0x000000010a62ebea void
clang::ento::check::ASTCodeBody::_checkBody<(anonymous
namespace)::DeadStoresChecker>(void*, clang::Decl const*,
clang::ento::AnalysisManager&, clang::ento::BugReporter&) + 58
9 clang 0x000000010a6877ec
clang::ento::CheckerManager::runCheckersOnASTBody(clang::Decl const*,
clang::ento::AnalysisManager&, clang::ento::BugReporter&) + 108
10 clang 0x000000010a612939 (anonymous
namespace)::AnalysisConsumer::HandleCode(clang::Decl*) + 857
11 clang 0x000000010a612286 (anonymous
namespace)::AnalysisConsumer::HandleDeclContext(clang::ASTContext&,
clang::DeclContext*) + 1542
12 clang 0x000000010a611bff (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&) + 383
13 clang 0x000000010a33ff3e clang::ParseAST(clang::Sema&, bool) +
446
14 clang 0x000000010a136acb
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 955
15 clang 0x000000010a11f6e5
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2789
16 clang 0x000000010a117dbc cc1_main(char const**, char const**,
char const*, void*) + 5500
17 clang 0x000000010a11ba82 main + 706
18 clang 0x000000010a116834 start + 52
19 clang 0x000000000000002f start + 18446744069245671471
Stack dump:
0. Program arguments: clang -cc1 -triple x86_64-apple-macosx10.7.1 -analyze
-disable-free -main-file-name visit.cpp -analyzer-store=region
-analyzer-opt-analyze-nested-blocks -analyzer-eagerly-assume
-analyzer-checker=core -analyzer-checker=deadcode -analyzer-checker=security
-analyzer-checker=unix -analyzer-checker=osx -analyzer-output plist -w
-pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2
-target-linker-version 123.2.1 -fdeprecated-macro -ferror-limit 19
-fmessage-length 259 -stack-protector 1 -fblocks -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o visit.plist -x c++ visit.cpp
1. <eof> parser at end of file
clang: error: unable to execute command: Segmentation fault: 11
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