Search

ParaSoft

HOME
PRODUCTS
SUPPORT
ABOUT
WHAT'S NEW
EVENTS


Insure++

Quick facts

Add-on Modules:
   -INUSE
   -TCA

Comparisons

Technical Papers

Support & Manuals

FAQs

Recent Reviews

User Testimonials

Press Releases


Insure tool to debug c++





Examples

Insure++ v5.0 (UNIX) vs. Purify v5.0 (UNIX)

How many bugs can each tool find?


The examples mentioned below are supplied on-line in the examples directory with every Insure++ distribution. Therefore, you can try these examples and see the difference yourself.

Table 1: C Examples (76)
Example Purify Insure++ Type Explanation
badcast
X BAD_CAST Cast of pointer loses precision
baddecl
X BAD_DECL Incompatible global declarations
badform1
X BAD_FORMAT
(incompatible)
Mismatch in format specification (incompatible) compile-time
badform2
X BAD_FORMAT
(incompatible)
Mismatch in format specification (incompatible) compile-time
badform3 X X BAD_FORMAT
(incompatible)
Mismatch in format specification (incompatible) runtime
badint
X BAD_INTERFACE Declaration of function in interface conflicts with declaration in program
badparm1
X BAD_PARM
(incompatible)
Mismatch in argument type (incompatible)
badparm2
X BAD_PARM
(incompatible)
Mismatch in argument type (incompatible)
badparm3
X BAD_PARM
(incompatible)
Mismatch in argument type (incompatible)
badparm4
X BAD_PARM
(union)
Mismatch in argument type (Require exact match on unions)
bubble1 X X READ_BAD_INDEX Reading array out of range
bugsfunc X X FREE_BODY Free memory block from body
deadcode
X DEAD_CODE
(emptystmt)
(noeffect)
(emptyloopbody)

Statement is empty
Code has no effect
Loop body is empty
expdangl
X EXPR_DANGLING Freeing dangling pointer
expnull
X EXPR_NULL Expression uses null pointer
exprange
X EXPR_BAD_RANGE Expression exceeded range
expucmp
X EXPR_UNRELATED_PTRCMP Expression compares unrelated pointers
expudiff
X EXPR_UNRELATED_PTRDIFF Express subtracts unrelated pointers
expuptr X X EXPR_UNINIT_PTR Expression uses uninitialized pointer
expwld1
X EXPR_WILD Expression uses wild pointer
expwld2
X EXPR_WILD Expression uses wild pointer
freebody X X FREE_BODY Frees memory block from body
freedngl X X FREE_DANGLING Freeing dangling pointer
freeglob X X FREE_GLOBAL Freeing global memory
freelocl X X FREE_LOCAL Freeing local memory
freenull
X FREE_NULL Freeing null pointer
freeuptr X X FREE_UNINIT_PTR Freeing uninitialized pointer
freewild X X FREE_WILD Freeing wild pointer
funcbad X X FUNC_BAD Function pointer is not a function
funcnull X X FUNC_NULL Function pointer is null
funcuptr X X FUNC_UNINIT_PTR Function pointer is uninitialized
funcwild X
X FUNC_BAD Function pointer is not a function
hello
X WRITE_OVERFLOW Writing overflows memory
hello2 X X EXPR_UNINIT_PTR Expression uses uninitialized pointer
hello3
X LEAK_ASSIGN Memory leaked due to pointer reassignment
hello4
X READ_DANGLING Reading from a dangling pointer
leakasgn
X LEAK_ASSIGN Memory leaked due to pointer reassignment
leakfree
X LEAK_FREE Memory leaked freeing block
leakret X X LEAK_RETURN Memory leaked by ignoring return value
leakscop
X LEAK_SCOPE Memory leaked leaving scope
parmdngl X X PARM_DANGLING Array parameter is dangling pointer
parmnull
X PARM_NULL Array parameter is null
parmrnge X X PARM_BAD_RANGE Array parameter exceeded range
parmuptr X X PARM_UNINIT_PTR Array parameter is uninitialized pointer
parmwld1
X PARM_WILD Array parameter is wild
parmwld2
X PARM_WILD Array parameter is wild
readdngl X X READ_DANGLING Reading from a dangling pointer
readindx X X READ_BAD_INDEX Reading array out of range
readnull X X READ_NULL Reading null pointer
readovr1 X X READ_OVERFLOW Reading overflows memory
readovr2
X READ_OVERFLOW String is not null terminated within range
readovr3 X X READ_OVERFLOW Structure reference out of range
readuni1 X X READ_UNINIT_MEM(read) Reading uninitialized memory
readuni2 X X READ_UNINIT_MEM Reading uninitialized memory
readuptr X X READ_UNINIT_PTR Reading from uninitialized pointer
readwld1 X X READ_OVERFLOW Reading overflows memory
readwld2 X X READ_WILD Reading wild pointer
retdngl
X RETURN_DANGLING Returning pointer to local variable
retfail X X RETURN_FAILURE Function call returned an error
reti
X RETURN_INCONSISTENT 1 - No declaration, returns nothing
2 - Declared int returns nothing
3 - Declared non-int, returns nothing
4 - Returns different types at different statements
stretch1
X WRITE_BAD_INDEX Writing array out of range
stretch2 X X WRITE_BAD_INDEX Writing array out of range
unuasign
X UNUSED_VAR(assigned) Variable assigned but never used
unuvar
X UNUSED_VAR(unused) Variable declared but never used
usererr
X USER_ERROR User generated error message
writdngl X X WRITE_DANGLING Writing to a dangling pointer
writindx
X WRITE_BAD_INDEX Writing array out of range
writind2 X X WRITE_BAD_INDEX Writing array out of range
writind3
X WRITE_BAD_INDEX Writing array out of range
writnull X X WRITE_NULL Writing to a null pointer
writover
X WRITE_OVERFLOW Writing overflows memory (argument)
writovr2
X WRITE_OVERFLOW Writing overflows memory (pointer)
(this is what some call a "lucky pointer")
writuptr X X WRITE_UNINIT_PTR Writing to an uninitialized pointer
writwld1 X X WRITE_WILD Writing to a wild pointer
writwld2 X X WRITE_WILD Writing to a wild pointer

As you can see above in Table 1, Purify only finds the bugs in 37 (48%) of the 76 C code examples.

Table 2 lists the C++ examples shipped with Insure++ and how the two competitors measure up.

Table 2: C++ Examples (11)
Example Purify Insure++ Type Explanation
alloc1
X ALLOC_CONFLICT(badfree) Memory allocation conflict
alloc2
X ALLOC_CONFLICT(baddelete) Memory allocation conflict
copybad
X COPY_BAD_RANGE Copying pointer which is out-of-range
copydang
X COPY_DANGLING Copying dangling pointer
copyunin
X COPY_UNINIT_PTR Copying uninitialized pointer
deadcode
X DEAD_CODE(notevaluated) Code is not evaluated
delmis1
X DELETE_MISMATCH (nobracket) Inconsistent usage of delete operator
delmis2
X DELETE_MISMATCH (bracket) Inconsistent usage of delete operator
leak X X LEAK_SCOPE Memory leaked leaving scope
readover
X READ_OVERFLOW Structure reference out of range
virtbad X X VIRTUAL_BAD Error in runtime initialization of virtual functions

Here, Purify does even worse, finding only 2 (18%) of the 11 bugs Insure++ detects.

Tools to debug c++ and java
(888) 305-0041 info@parasoft.com Copyright © 1996-2001 ParaSoft