[LLVMbugs] [Bug 14436] New: clang: /home/hotellnx99/peeterj/tmp/clang/llvm/include/llvm/Support/Casting.h:208: typename llvm::cast_retty<To, From>::ret_type llvm::cast(const Y&) [with X = clang::ento::StringRegion; Y = const clang::ento::MemRegion*; typename llvm::cast_retty<To, Fro

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Nov 26 13:22:46 PST 2012


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

             Bug #: 14436
           Summary: clang:
                    /home/hotellnx99/peeterj/tmp/clang/llvm/include/llvm/S
                    upport/Casting.h:208: typename llvm::cast_retty<To,
                    From>::ret_type llvm::cast(const Y&) [with X =
                    clang::ento::StringRegion; Y = const
                    clang::ento::MemRegion*; typename llvm::cast_retty<To,
                    Fro
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: peeter.joot at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9596
  --> http://llvm.org/bugs/attachment.cgi?id=9596
preprocessed source

clang:
/home/hotellnx99/peeterj/tmp/clang/llvm/include/llvm/Support/Casting.h:208:
typename llvm::cast_retty<To, From>::ret_type llvm::cast(const Y&) [with X =
clang::ento::StringRegion; Y = const clang::ento::MemRegion*; typename
llvm::cast_retty<To, From>::ret_type = const clang::ento::StringRegion*]:
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
0  clang           0x0000000001fae83f
1  clang           0x0000000001faed39
2  libpthread.so.0 0x00002ba7b62ebe00
3  libc.so.6       0x00002ba7b699ef45 gsignal + 53
4  libc.so.6       0x00002ba7b69a0340 abort + 272
5  libc.so.6       0x00002ba7b6998486 __assert_fail + 246
6  clang           0x0000000000ec4034
7  clang           0x0000000000ebf058
8  clang           0x0000000000ebf253
9  clang           0x0000000000ebfbb1
10 clang           0x0000000000ea4eeb
clang::ento::ProgramState::bindLoc(clang::ento::Loc, clang::ento::SVal, bool)
const + 91
11 clang           0x0000000000d46e64
12 clang           0x0000000000e435d0
clang::ento::CheckerManager::runCheckersForBind(clang::ento::ExplodedNodeSet&,
clang::ento::ExplodedNodeSet const&, clang::ento::SVal, clang::ento::SVal,
clang::Stmt const*, clang::ento::ExprEngine&, clang::ProgramPoint const&) +
1216
13 clang           0x0000000000e65e36
clang::ento::ExprEngine::evalBind(clang::ento::ExplodedNodeSet&, clang::Stmt
const*, clang::ento::ExplodedNode*, clang::ento::SVal, clang::ento::SVal, bool,
clang::ProgramPoint const*) + 502
14 clang           0x0000000000e744c1
clang::ento::ExprEngine::VisitDeclStmt(clang::DeclStmt const*,
clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) + 2353
15 clang           0x0000000000e68b83
clang::ento::ExprEngine::Visit(clang::Stmt const*, clang::ento::ExplodedNode*,
clang::ento::ExplodedNodeSet&) + 2499
16 clang           0x0000000000e6ad58
clang::ento::ExprEngine::ProcessStmt(clang::CFGStmt,
clang::ento::ExplodedNode*) + 760
17 clang           0x0000000000e6b09b
clang::ento::ExprEngine::processCFGElement(clang::CFGElement,
clang::ento::ExplodedNode*, unsigned int, clang::ento::NodeBuilderContext*) +
235
18 clang           0x0000000000e50220
clang::ento::CoreEngine::HandlePostStmt(clang::CFGBlock const*, unsigned int,
clang::ento::ExplodedNode*) + 128
19 clang           0x0000000000e5135d
clang::ento::CoreEngine::dispatchWorkItem(clang::ento::ExplodedNode*,
clang::ProgramPoint, clang::ento::WorkListUnit const&) + 109
20 clang           0x0000000000e516a6
clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*,
unsigned int, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>) + 278
21 clang           0x0000000000cdb72e
22 clang           0x0000000000cdccb0
23 clang           0x0000000000ce5aa8
24 clang           0x0000000000940eba clang::ParseAST(clang::Sema&, bool, bool)
+ 554
25 clang           0x000000000067c8c6 clang::FrontendAction::Execute() + 150
26 clang           0x000000000065fae5
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 341
27 clang           0x00000000006471fd
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1421
28 clang           0x000000000063f128 cc1_main(char const**, char const**, char
const*, void*) + 1160
29 clang           0x00000000006465fa main + 4842
30 libc.so.6       0x00002ba7b698c304 __libc_start_main + 244
31 clang           0x000000000063dff9
Stack dump:

0.      Program arguments: /home/hotellnx99/peeterj/local/bin/clang -cc1
-triple x86_64-unknown-linux-gnu -analyze -disable-free -main-file-name
sqle_ca_pd_connpool.C -analyzer-store=region
-analyzer-opt-analyze-nested-blocks -analyzer-eagerly-assume
-analyzer-checker=core -analyzer-checker=unix -analyzer-checker=deadcode
-analyzer-checker=security.insecureAPI.UncheckedReturn
-analyzer-checker=security.insecureAPI.getpw
-analyzer-checker=security.insecureAPI.gets
-analyzer-checker=security.insecureAPI.mktemp
-analyzer-checker=security.insecureAPI.mkstemp
-analyzer-checker=security.insecureAPI.vfork -analyzer-output plist -w
-mrelocation-model pic -pic-level 2 -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu corei7 -target-linker-version 2.16.91.0.5 -momit-leaf-frame-pointer
-g -coverage-file /vbs/engn/sqe/t2/sqle_ca_pd_connpool.plist -resource-dir
/home/hotellnx99/peeterj/local/bin/../lib/clang/3.3 -dependency-file
sqle_ca_pd_connpool.u -MT sqle_ca_pd_connpool.o -sys-header-deps
-fmodule-cache-path /home/hotellnx99/peeterj/tmp/clang-module-cache
-internal-isystem
/home/hotellnx99/peeterj/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../include/c++/4.7.2
-internal-isystem
/home/hotellnx99/peeterj/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../include/c++/4.7.2/x86_64-unknown-linux-gnu
-internal-isystem
/home/hotellnx99/peeterj/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../include/c++/4.7.2/backward
-internal-isystem /usr/local/include -internal-isystem
/home/hotellnx99/peeterj/local/bin/../lib/clang/3.3/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O0
-Wno-deprecated -Wno-invalid-offsetof -Wreturn-type
-Wno-unused-command-line-argument -Wno-return-type-c-linkage
-Wno-unused-private-field -Wno-array-bounds -Wno-cast-align -Wno-unused-value
-Wformat -Wparentheses -Wno-write-strings -Wformat -fdebug-compilation-dir
/vbs/engn/sqe/t2 -ferror-limit 19 -fmessage-length 0 -mstackrealign
-fno-threadsafe-statics -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -o sqle_ca_pd_connpool.plist -x c++
sqle_ca_pd_connpool.C
1.      <eof> parser at end of file
2.      sqle_ca_pd_connpool.C:49:4: Error evaluating statement
3.      sqle_ca_pd_connpool.C:49:4: Error evaluating statement
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.3 (trunk 168392)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg:
/home/hotellnx99/peeterj/tmp/sqle_ca_pd_connpool-HONlX0.cpp
clang: note: diagnostic msg:
/home/hotellnx99/peeterj/tmp/sqle_ca_pd_connpool-HONlX0.sh


standalone source was:


#include <unistd.h>

#define Uint64 unsigned long
#define Uint32 unsigned int

typedef Uint64 SQLO_PGRP_FILE_VERSION ;

#define SQLO_PGRP_MAX_HCA 8
#define OSS_NETWORK_DEVICE_NAME_SZ            24
#define SQLO_HCA_NAME_SZ 15
#define SQL_HOSTNAME_SZ        255

struct SQLO_PGRP_HCA_RESOURCE
{
   char   HCANetname[ SQL_HOSTNAME_SZ + 1 ] ;
   char   HCAName[ SQLO_HCA_NAME_SZ + 1] ;
   char   UDAPLDevice[ OSS_NETWORK_DEVICE_NAME_SZ + 1 ] ;
   bool   bAlert ;
} ;

typedef pid_t OSSPID ;

struct SQLO_PGRP_FILE_CONTENTS
{
   SQLO_PGRP_FILE_VERSION    iPgrpFileVersion ;
   OSSPID    iPgrpId ;
   OSSPID    iWdogPgrpId ;
   OSSPID    iSubPgrpId ;
   Uint32    iIndex ;
   Uint32    iNumber ;
   Uint32    iMonitorOverride ;
   Uint32          crashCounter ;
   Uint32          firstCrashTimeSeconds ;
   Uint32          crashTimePad1 ;
   char hostname[ SQL_HOSTNAME_SZ + 1 ] ;
   Uint32          monitorTimeoutCounter ;
   Uint32          firstMonitorTimeoutSeconds ;
   Uint32          crashTimePad2 ;
   Uint32          lastMonitorTimeoutSeconds ;
   Uint32          crashTimePad3 ;
   Uint32                        iNumHCAs ;
   SQLO_PGRP_HCA_RESOURCE        HCAs[ SQLO_PGRP_MAX_HCA ] ;
   char                          explicitPad1[ 4 ] ;
   char                          padForFutureGrowth[ 512 ] ;
} ;

void foo()
{
   SQLO_PGRP_FILE_CONTENTS pgrpContents = { 0x00 };
}

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