[LLVMbugs] [Bug 7830] New: CStringChecker cast assertion

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 5 14:00:24 PDT 2010


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

           Summary: CStringChecker cast assertion
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: tcare at apple.com
                CC: llvmbugs at cs.uiuc.edu, jediknil at belkadan.com,
                    tcare at apple.com


Created an attachment (id=5334)
 --> (http://llvm.org/bugs/attachment.cgi?id=5334)
Preprocessed file

I've been seeing a casting assertion in CStringChecker in recent builds of
clang.

STDERR and preprocessed file attached.

Stack trace:
Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"),
function cast, file
/Volumes/Data/Users/tcare/Projects/llvm/include/llvm/Support/Casting.h, line
202.

Program received signal SIGABRT, Aborted.
0x00007fff80a589d6 in __kill ()

(gdb) bt
#0  0x00007fff80a589d6 in __kill ()
#1  0x00007fff80af8fea in abort ()
#2  0x00007fff80ae5fb0 in __assert_rtn ()
#3  0x00000001006c4145 in llvm::cast<clang::Loc, clang::SVal>
(Val=@0x7fff5fbf9830) at
/Volumes/Data/Users/tcare/Projects/llvm/include/llvm/Support/Casting.h:202
#4  0x00000001006ea64a in (anonymous
namespace)::CStringChecker::CheckBufferAccess (this=0x104ce5790,
C=@0x7fff5fbf9e30, state=0x1058d9f88, Size=0x10580dc28, FirstBuf=0x10580dee0,
SecondBuf=0x10580df18) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/CStringChecker.cpp:240
#5  0x00000001006e9900 in (anonymous namespace)::CStringChecker::EvalCopyCommon
(this=0x104ce5790, C=@0x7fff5fbf9e30, state=0x1058d9f88, Size=0x10580dc28,
Dest=0x10580dee0, Source=0x10580df18, Restricted=true) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/CStringChecker.cpp:558
#6  0x00000001006e8574 in (anonymous namespace)::CStringChecker::EvalMemcpy
(this=0x104ce5790, C=@0x7fff5fbf9e30, CE=0x10580de50) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/CStringChecker.cpp:573
#7  0x00000001006e83d0 in (anonymous namespace)::CStringChecker::EvalCallExpr
(this=0x104ce5790, C=@0x7fff5fbf9e30, CE=0x10580de50) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/CStringChecker.cpp:710
#8  0x000000010072dc3c in clang::Checker::GR_EvalCallExpr (this=0x104ce5790,
Dst=@0x7fff5fbfa018, Builder=@0x7fff5fbfb5b8, Eng=@0x7fff5fbfb9e0,
CE=0x10580de50, Pred=0x1058d8ae0, tag=0x1021f5bc0) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/include/clang/Checker/PathSensitive/Checker.h:219
#9  0x00000001007108f4 in clang::GRExprEngine::CheckerEvalCall
(this=0x7fff5fbfb9e0, CE=0x10580de50, Dst=@0x7fff5fbfa468, Pred=0x1058d8ae0) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/GRExprEngine.cpp:285
#10 0x000000010071a062 in clang::GRExprEngine::VisitCall (this=0x7fff5fbfb9e0,
CE=0x10580de50, Pred=0x1058cf390, AI={I = 0x10580de88}, AE={I = 0x10580dea8},
Dst=@0x7fff5fbfb230, asLValue=false) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/GRExprEngine.cpp:1997
#11 0x0000000100714d23 in clang::GRExprEngine::Visit (this=0x7fff5fbfb9e0,
S=0x10580de50, Pred=0x1058cf390, Dst=@0x7fff5fbfb230) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/GRExprEngine.cpp:772
#12 0x0000000100713634 in clang::GRExprEngine::ProcessStmt
(this=0x7fff5fbfb9e0, CE={Data = {Value = 4387298896}},
builder=@0x7fff5fbfb5b8) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/GRExprEngine.cpp:608
#13 0x000000010070bd0a in clang::GRCoreEngine::ProcessStmt
(this=0x7fff5fbfb9f0, E={Data = {Value = 4387298896}}, Builder=@0x7fff5fbfb5b8)
at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/include/clang/Checker/PathSensitive/GRCoreEngine.h:90
#14 0x0000000100708606 in clang::GRCoreEngine::HandlePostStmt
(this=0x7fff5fbfb9f0, L=@0x7fff5fbfb770, B=0x105823f18, StmtIdx=1,
Pred=0x1058cf390) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/GRCoreEngine.cpp:385
#15 0x0000000100707d40 in clang::GRCoreEngine::ExecuteWorkList
(this=0x7fff5fbfb9f0, L=0x104ce36f0, Steps=149496, InitState=0x0) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/GRCoreEngine.cpp:197
#16 0x00000001006590fa in clang::GRExprEngine::ExecuteWorkList
(this=0x7fff5fbfb9e0, L=0x104ce36f0, Steps=150000) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/include/clang/Checker/PathSensitive/GRExprEngine.h:117
#17 0x00000001006539b6 in ActionGRExprEngine (C=@0x104c0de90, mgr=@0x104c0f040,
D=0x1058077f0, tf=0x104ce0b40) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/AnalysisConsumer.cpp:354
#18 0x0000000100653746 in ActionObjCMemCheckerAux (C=@0x104c0de90,
mgr=@0x104c0f040, D=0x1058077f0, GCEnabled=false) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/AnalysisConsumer.cpp:375
#19 0x000000010065353f in ActionObjCMemChecker (C=@0x104c0de90,
mgr=@0x104c0f040, D=0x1058077f0) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/AnalysisConsumer.cpp:385
#20 0x0000000100657a4b in (anonymous namespace)::AnalysisConsumer::HandleCode
(this=0x104c0de90, D=0x1058077f0, actions=@0x104c0dea0) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/AnalysisConsumer.cpp:302
#21 0x0000000100657007 in (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit (this=0x104c0de90,
C=@0x105013c00) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Checker/AnalysisConsumer.cpp:214
#22 0x00000001003a4714 in clang::ParseAST (PP=@0x104c08a10,
Consumer=0x104c0de90, Ctx=@0x105013c00, PrintStats=false,
CompleteTranslationUnit=true, CompletionConsumer=0x0) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Sema/ParseAST.cpp:108
#23 0x00000001000b0b89 in clang::ASTFrontendAction::ExecuteAction
(this=0x104c07e90) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:256
#24 0x00000001000b075d in clang::FrontendAction::Execute (this=0x104c07e90) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:184
#25 0x000000010007ce64 in clang::CompilerInstance::ExecuteAction
(this=0x104c076c0, Act=@0x104c07e90) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:505
#26 0x0000000100009e7b in cc1_main (ArgBegin=0x7fff5fbfe720,
ArgEnd=0x7fff5fbfe8e0, Argv0=0x104c04438
"/Volumes/Data/Users/tcare/Projects/llvm-eclipse/bin/clang",
MainAddr=0x100001640) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/tools/driver/cc1_main.cpp:281
#27 0x000000010000193c in main (argc_=58, argv_=0x7fff5fbfefa8) at
/Volumes/Data/Users/tcare/Projects/llvm/tools/clang/tools/driver/driver.cpp:267

-- 
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