buildframework/helium/sf/java/quality/coverity.rst
author jjkang
Thu, 01 Jul 2010 14:58:06 +0800
changeset 609 f76e0f94b7ab
parent 587 85df38eb4012
permissions -rw-r--r--
Minor change: update package_definition.xml
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     1
.. index::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     2
  module: Coverity Prevent Tool.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     3
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     4
========================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     5
Coverity Prevent Tool
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     6
========================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     7
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     8
.. contents::
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     9
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    10
This document describes requirements and how to run coverity prevent tool with sbs builds using helium. 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    11
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    12
Introduction
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    13
-----------------
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    14
- Coverity Prevent analyzes source code to find defects early in the development cycle, reducing the risks associated with coding. Included with Prevent are workflow tools that track and manage defects from initial discovery through final resolution.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    15
- With high precision, Coverity Prevent analyzes source code and detects critical software defects in the following categories:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    16
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    17
    * Quality
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    18
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    19
        Coverity Prevent detects bugs at compile-time that can cause run-time crashes. For example: memory leaks, use-after-free errors, and illegal pointer accesses.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    20
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    21
    * Security 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    22
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    23
        Early during development, Coverity Prevent can detect the security vulnerabilities that hackers can exploit and help you eliminate serious problems, such as denial of service, data or memory corruption, and privilege escalation. Vulnerabilities detected can include buffer overruns, integer overflows, format string errors, and SQL injection attacks.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    24
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    25
    * Concurrency 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    26
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    27
        Coverity Prevent can detect errors in multi-threaded programs that, given the complexity of concurrent programming, can be extremely difficult to track down or reproduce. Detected defects include potential deadlocks or misuse of locks.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    28
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    29
Implmentation
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    30
-----------------
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    32
- Coverity command can be run using the <hlm:coverity> task.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    33
- Coverity task will validate is the command passed to task is starts with "cov-" and then it will run the command.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
- Coverity command options can passed through the datatypes "<hlm:coverityoptions>" or "<hlm:arg>".
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    35
- Below example shows how parameters can be passed to coverity command.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    36
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    37
   
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    38
.. code-block:: xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    39
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    40
        <hlm:coverity command="cov-link" dir="${build.drive}/">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    41
            <hlm:arg name="--dir" value="${coverity.inter.dir}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    42
            <hlm:arg name="--collect" value=""/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    43
            <hlm:arg name="-of" value="${coverity.link.dir}/all.link"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    44
        </hlm:coverity >
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    45
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    46
.. code-block:: xml
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    47
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    48
        <hlm:coverityoptions id="coverity.analyze.options">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    49
            <hlm:arg name="--dir" value="${coverity.analyze.dir}"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    50
            <hlm:arg name="--all" value=""/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    51
            <hlm:arg name="--symbian" value=""/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    52
            <hlm:arg name="--append" value=""/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    53
            <hlm:arg name="--enable-callgraph-metrics" value=""/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    54
        </hlm:coverityoptions>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    55
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    56
        <hlm:coverity command="cov-analyze" dir="${build.drive}/">
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    57
            <hlm:coverityoptions refid="coverity.analyze.options"/>
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    58
        </hlm:coverity >
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    59
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    60
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    61
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    62
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    63
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64