<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/extras/clang-checker.sh, branch v3.12dev</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/'/>
<entry>
<title>clang-analyzer: adding clang static analysis support</title>
<updated>2016-06-07T13:56:09+00:00</updated>
<author>
<name>Prasanna Kumar Kalever</name>
<email>prasanna.kalever@redhat.com</email>
</author>
<published>2015-06-04T09:25:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gluster.org/cgit/glusterfs.git/commit/?id=bdde0cfa1d5848e59d20c1adc19ee1b687eec66a'/>
<id>bdde0cfa1d5848e59d20c1adc19ee1b687eec66a</id>
<content type='text'>
clang static analyzer is a source code analysis tool that
finds bugs in C, C++.

This patch automates clang analyzes part by integrating
it with 'make clang-check'

clang-checker.sh: runs clang analyzer with and without the
HEAD commit, and shows the bugs introduced by HEAD commit (if any)

sample report:

$[ glusterfs ]: make clang-check

================ Clang analyzer in progress ================
...

BASELINE BUGS LIST (before applying patch):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Out of bound array access --&gt; 3
Memory leak --&gt; 1
Unix API --&gt; 24
Dead increment --&gt; 5
Dereference of null pointer --&gt; 1995
Uninitialized argument value --&gt; 2
All Bugs --&gt; 2872
Called function pointer is null null dereference --&gt; 4
Dead initialization --&gt; 49
Dead assignment --&gt; 691
Undefined allocation of 0 bytes CERT MEM0 C CWE --&gt; 5
Argument with nonnull attribute passed null --&gt; 84
Result of operation is garbage or undefined --&gt; 9

TARGET BUGS LIST (after applying patch):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Out of bound array access --&gt; 3
Memory leak --&gt; 1
Unix API --&gt; 24
Dead increment --&gt; 5
Dereference of null pointer --&gt; 1995
Uninitialized argument value --&gt; 2
All Bugs --&gt; 2875
Called function pointer is null null
dereference --&gt; 4
Dead initialization --&gt; 49
Dead assignment --&gt; 694
Undefined allocation of 0 bytes CERT MEM0 C CWE --&gt; 5
Argument with nonnull attribute passed null --&gt; 84
Result of operation is garbage or undefined --&gt; 9

SUMMARY OF CLANG-ANALYZER:
~~~~~~~~~~~~~~~~~~~~~~~~~~
Extra 3 Bug[s] Introduced in: Dead assignment

Patch Value given by Clang analyzer '-1'

Explore complete results at
/home/user/work/glusterfs/baseline/results/index.html
/home/user/work/glusterfs/target/results/index.html

================= Done with Clang Analysis =================

Change-Id: I512e33cfc02885a111152fbc1832144261dda1da
BUG: 1228142
Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
Reviewed-on: http://review.gluster.org/11083
Tested-by: Prasanna Kumar Kalever &lt;pkalever@redhat.com&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Smoke: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Raghavendra Talur &lt;rtalur@redhat.com&gt;
Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
clang static analyzer is a source code analysis tool that
finds bugs in C, C++.

This patch automates clang analyzes part by integrating
it with 'make clang-check'

clang-checker.sh: runs clang analyzer with and without the
HEAD commit, and shows the bugs introduced by HEAD commit (if any)

sample report:

$[ glusterfs ]: make clang-check

================ Clang analyzer in progress ================
...

BASELINE BUGS LIST (before applying patch):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Out of bound array access --&gt; 3
Memory leak --&gt; 1
Unix API --&gt; 24
Dead increment --&gt; 5
Dereference of null pointer --&gt; 1995
Uninitialized argument value --&gt; 2
All Bugs --&gt; 2872
Called function pointer is null null dereference --&gt; 4
Dead initialization --&gt; 49
Dead assignment --&gt; 691
Undefined allocation of 0 bytes CERT MEM0 C CWE --&gt; 5
Argument with nonnull attribute passed null --&gt; 84
Result of operation is garbage or undefined --&gt; 9

TARGET BUGS LIST (after applying patch):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Out of bound array access --&gt; 3
Memory leak --&gt; 1
Unix API --&gt; 24
Dead increment --&gt; 5
Dereference of null pointer --&gt; 1995
Uninitialized argument value --&gt; 2
All Bugs --&gt; 2875
Called function pointer is null null
dereference --&gt; 4
Dead initialization --&gt; 49
Dead assignment --&gt; 694
Undefined allocation of 0 bytes CERT MEM0 C CWE --&gt; 5
Argument with nonnull attribute passed null --&gt; 84
Result of operation is garbage or undefined --&gt; 9

SUMMARY OF CLANG-ANALYZER:
~~~~~~~~~~~~~~~~~~~~~~~~~~
Extra 3 Bug[s] Introduced in: Dead assignment

Patch Value given by Clang analyzer '-1'

Explore complete results at
/home/user/work/glusterfs/baseline/results/index.html
/home/user/work/glusterfs/target/results/index.html

================= Done with Clang Analysis =================

Change-Id: I512e33cfc02885a111152fbc1832144261dda1da
BUG: 1228142
Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
Reviewed-on: http://review.gluster.org/11083
Tested-by: Prasanna Kumar Kalever &lt;pkalever@redhat.com&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Smoke: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Raghavendra Talur &lt;rtalur@redhat.com&gt;
Reviewed-by: Kaleb KEITHLEY &lt;kkeithle@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
