On 01/30/2013 10:58 AM, Stephane Eranian wrote:
> Will,
>
> I have made a couple of changes based on the report.
> Found a couple of bugs, so that was useful though it
> is hard to parse the output even with the dictionary.
> I think this comes from the fact that it prints the
> steps in the simulation that led to a detected error.
>
> Thanks.
Hi Stephan,
Yes, sometime it is a slog through the output of coverity because of all the
output related to how it figured out there was a problem. Generally, I read
the top of the error message to see what the error is and then skip to bottom
to see where it is flagged.
The results look a bit better in the new libpfm git version. Attached are the
results for the current git tree.
-Will
Error: CONSTANT_EXPRESSION_RESULT (CWE-569):
libpfm-4.3.0/python/src/perfmon_int_wrap.c:3228:
result_independent_of_operands: "value < -9223372036854775808LL /*
-9223372036854775807L - 1L */" is always false regardless of the values of its
operands. This occurs as the logical first operand of '||'.
Error: DEADCODE (CWE-561):
libpfm-4.3.0/python/src/perfmon_int_wrap.c:2395: cond_notnull: Condition "ty",
taking true branch. Now the value of "ty" is not NULL.
libpfm-4.3.0/python/src/perfmon_int_wrap.c:2398: notnull: At condition "ty",
the value of "ty" cannot be NULL.
libpfm-4.3.0/python/src/perfmon_int_wrap.c:2398: dead_error_condition: The
condition "ty" must be true.
libpfm-4.3.0/python/src/perfmon_int_wrap.c:2408: dead_error_line: Execution
cannot reach this statement "*ptr = vptr;".
Error: RESOURCE_LEAK (CWE-404):
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10029: alloc_fn: Storage is returned
from allocation function "malloc(size_t)".
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10029: var_assign: Assigning: "arg3"
= storage returned from "malloc(64UL)".
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10030: noescape: Resource "arg3" is
not freed or pointed-to in function "memset(void *, int, size_t)".
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10032: cond_true: Condition
"!PyArg_ParseTuple(args, (char *)"OO:pfm_get_event_info", &obj0, &obj1)",
taking true branch
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10032: goto: Jumping to label "fail"
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10065: label: Reached label "fail"
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10066: leaked_storage: Variable
"arg3" going out of scope leaks the storage it points to.
Error: RESOURCE_LEAK (CWE-404):
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10338: alloc_fn: Storage is returned
from allocation function "malloc(size_t)".
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10338: var_assign: Assigning: "arg3"
= storage returned from "malloc(80UL)".
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10339: noescape: Resource "arg3" is
not freed or pointed-to in function "memset(void *, int, size_t)".
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10341: cond_true: Condition
"!PyArg_ParseTuple(args, (char *)"OOOO:pfm_get_perf_event_encoding", &obj0,
&obj1, &obj2, &obj3)", taking true branch
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10341: goto: Jumping to label "fail"
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10385: label: Reached label "fail"
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10386: cond_false: Condition "alloc1
== (512 /* 0 | ((1 << 8) << 1) */)", taking false branch
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10386: if_end: End of if statement
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10387: leaked_storage: Variable
"arg3" going out of scope leaks the storage it points to.
Error: RESOURCE_LEAK (CWE-404):
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10148: alloc_fn: Storage is returned
from allocation function "malloc(size_t)".
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10148: var_assign: Assigning: "arg4"
= storage returned from "malloc(64UL)".
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10149: noescape: Resource "arg4" is
not freed or pointed-to in function "memset(void *, int, size_t)".
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10151: cond_true: Condition
"!PyArg_ParseTuple(args, (char *)"OOO:pfm_get_event_attr_info", &obj0, &obj1,
&obj2)", taking true branch
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10151: goto: Jumping to label "fail"
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10189: label: Reached label "fail"
libpfm-4.3.0/python/src/perfmon_int_wrap.c:10190: leaked_storage: Variable
"arg4" going out of scope leaks the storage it points to.
Error: RESOURCE_LEAK (CWE-404):
libpfm-4.3.0/python/src/perfmon_int_wrap.c:9932: alloc_fn: Storage is returned
from allocation function "malloc(size_t)".
libpfm-4.3.0/python/src/perfmon_int_wrap.c:9932: var_assign: Assigning: "arg2"
= storage returned from "malloc(56UL)".
libpfm-4.3.0/python/src/perfmon_int_wrap.c:9933: noescape: Resource "arg2" is
not freed or pointed-to in function "memset(void *, int, size_t)".
libpfm-4.3.0/python/src/perfmon_int_wrap.c:9935: cond_true: Condition
"!PyArg_ParseTuple(args, (char *)"O:pfm_get_pmu_info", &obj0)", taking true
branch
libpfm-4.3.0/python/src/perfmon_int_wrap.c:9935: goto: Jumping to label "fail"
libpfm-4.3.0/python/src/perfmon_int_wrap.c:9963: label: Reached label "fail"
libpfm-4.3.0/python/src/perfmon_int_wrap.c:9964: leaked_storage: Variable
"arg2" going out of scope leaks the storage it points to.
Error: UNUSED_VALUE (CWE-563):
libpfm-4.3.0/python/src/perfmon_int_wrap.c:2782: returned_pointer: Pointer
"tmp" returned by "SWIG_Python_str_AsChar(old_str)" is never used.
Error: UNUSED_VALUE (CWE-563):
libpfm-4.3.0/python/src/perfmon_int_wrap.c:2784: returned_pointer: Pointer
"tmp" returned by "SWIG_Python_str_AsChar(old_str)" is never used.
Error: UNUSED_VALUE (CWE-563):
libpfm-4.3.0/python/src/perfmon_int_wrap.c:1009: returned_pointer: Pointer
"tmp" returned by "SWIG_Python_str_AsChar(old_str)" is never used.
Error: UNUSED_VALUE (CWE-563):
libpfm-4.3.0/python/src/perfmon_int_wrap.c:11140: returned_pointer: Pointer
"tmp" returned by "SWIG_Python_str_AsChar(str)" is never used.
Error: USE_AFTER_FREE (CWE-416):
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:328: cond_false: Condition "err ==
-1", taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:329: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:335: cond_false: Condition "!dir1",
taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:336: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:341: cond_true: Condition "d1 =
readdir(dir1)", taking true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:341: cond_true: Condition "err >= 0",
taking true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:343: cond_false: Condition
"!strcmp(d1->d_name, ".")", taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:344: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:346: cond_false: Condition
"!strcmp(d1->d_name, "..")", taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:347: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:353: cond_false: Condition "!dir2",
taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:354: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:363: cond_true: Condition
"!reuse_event", taking true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:366: cond_false: Condition "!p",
taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:367: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:369: cond_true: Condition "p", taking
true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:372: cond_true: Condition "p", taking
true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:372: cond_true: Condition "p->name",
taking true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:376: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:388: cond_true: Condition "d2 =
readdir(dir2)", taking true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:389: cond_false: Condition
"!strcmp(d2->d_name, ".")", taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:390: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:392: cond_false: Condition
"!strcmp(d2->d_name, "..")", taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:393: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:402: cond_false: Condition "fd == -1",
taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:403: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:409: cond_false: Condition "err < 0",
taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:410: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:414: cond_true: Condition "numasks <
8", taking true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:415: if_fallthrough: Falling through
to end of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:420: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:422: cond_false: Condition "!um",
taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:425: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:434: cond_false: Condition
"!um->uname", taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:438: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:444: loop: Jumping back to the
beginning of the loop
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:388: loop_begin: Jumped back to
beginning of loop
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:388: cond_true: Condition "d2 =
readdir(dir2)", taking true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:389: cond_true: Condition
"!strcmp(d2->d_name, ".")", taking true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:390: continue: Continuing loop
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:444: loop: Looping back
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:388: cond_true: Condition "d2 =
readdir(dir2)", taking true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:389: cond_false: Condition
"!strcmp(d2->d_name, ".")", taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:390: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:392: cond_false: Condition
"!strcmp(d2->d_name, "..")", taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:393: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:402: cond_false: Condition "fd == -1",
taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:403: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:409: cond_false: Condition "err < 0",
taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:410: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:414: cond_true: Condition "numasks <
8", taking true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:415: if_fallthrough: Falling through
to end of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:420: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:422: cond_false: Condition "!um",
taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:425: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:434: cond_false: Condition
"!um->uname", taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:438: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:444: loop: Jumping back to the
beginning of the loop
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:388: loop_begin: Jumped back to
beginning of loop
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:388: cond_true: Condition "d2 =
readdir(dir2)", taking true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:389: cond_false: Condition
"!strcmp(d2->d_name, ".")", taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:390: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:392: cond_false: Condition
"!strcmp(d2->d_name, "..")", taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:393: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:402: cond_false: Condition "fd == -1",
taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:403: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:407: closed_arg: "close(int)" closes
"fd".
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:409: cond_false: Condition "err < 0",
taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:410: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:414: cond_true: Condition "numasks <
8", taking true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:415: if_fallthrough: Falling through
to end of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:420: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:422: cond_false: Condition "!um",
taking false branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:425: if_end: End of if statement
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:434: cond_true: Condition
"!um->uname", taking true branch
libpfm-4.3.0/lib/pfmlib_perf_event_pmu.c:435: double_close: Calling
"close(int)" closes handle "fd" which has already been closed.
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel