Hi, I removed the obvious false-positives from the list.
I'll open tickets by categroy of the errors.
Thank you very much!
Am 15.10.2016 um 17:26 schrieb Dmitry Karasik:
Dear all,
I've had access to a of C/C++ static analysis tool PVS Studio,
and ran it against the latest rakudo sources [1]. The majority of notes seems
to be noise, but there were found some valid concerns (or at least looking
valid to me) f.ex. this:
MoarVM/3rdparty/dynasm/dasm_x86.h:125
realloc() possible leak: when realloc() fails in allocating memory, original
pointer 'D->lglabels' is lost. Consider assigning realloc() to a temporary
pointer.
You probably might find it interesting to look at the log
[1] http://karasik.eu.org/misc/pvs/rakudo.log
Viva64-EM
full
8
/nfs/home/dmka/src/rakudo-star-2016.07/MoarVM/src/core/callsite.c
error
V526
The 'memcmp' function returns 0 if corresponding buffers are equal. Consider examining the condition for mistakes.
false
3
if (num_flags && memcmp(cs1->arg_flags, cs2->arg_flags, num_flags))
return 0;
Viva64-EM
full
397
/nfs/home/dmka/src/rakudo-star-2016.07/MoarVM/src/core/exceptions.c
error
V576
Incorrect format. Consider checking the fourth actual argument of the 'snprintf' function. The SIGNED integer type argument is expected.
false
3
char*line_number = MVM_malloc(16);
snprintf(line_number, 16, "%d", annot ? annot->line_number : 1);
Viva64-EM
full
588
/nfs/home/dmka/src/rakudo-star-2016.07/MoarVM/src/core/bytecode.c
error
V649
There are two 'if' statements with identical conditional expressions. The first 'if' statement contains function return. This means that the second 'if' statement is senseless. Check lines: 581, 588.
false
2
/* Ensure no other thread has done this for us in the mean time. */
if (sf->body.fully_deserialized) {
MVM_reentrantmutex_unlock(tc, (MVMReentrantMutex *)cu->body.update_mutex);
581,588
Viva64-EM
full
1386
/nfs/home/dmka/src/rakudo-star-2016.07/MoarVM/src/core/frame.c
error
V576
Incorrect format. Consider checking the fourth actual argument of the 'fprintf' function. The SIGNED integer type argument is expected.
false
3
if (dlog) {
fprintf(dlog, "I %s %d %d %d %d %llu %llu %llu\n", c_name, fcost, icost, ecost, xcost, last_time, start_time, uv_hrtime());
fflush(dlog);
Viva64-EM
full
1386
/nfs/home/dmka/src/rakudo-star-2016.07/MoarVM/src/core/frame.c
error
V576
Incorrect format. Consider checking the fifth actual argument of the 'fprintf' function. The SIGNED integer type argument is expected.
false
3
if (dlog) {
fprintf(dlog, "I %s %d %d %d %d %llu %llu %llu\n", c_name, fcost, icost, ecost, xcost, last_time, start_time, uv_hrtime());
fflush(dlog);
Viva64-EM
full
1386
/nfs/home/dmka/src/rakudo-star-2016.07/MoarVM/src/core/frame.c
error
V576
Incorrect format. Consider checking the sixth actual argument of the 'fprintf' function. The SIGNED integer type argument is expected.
false
3
if (dlog) {
fprintf(dlog, "I %s %d %d %d %d %llu %llu %llu\n", c_name, fcost, icost, ecost, xcost, last_time, start_time, uv_hrtime());
fflush(dlog);
Viva64-EM
full
1386
/nfs/home/dmka/src/rakudo-star-2016.07/MoarVM/src/core/frame.c
error
V576
Incorrect format. Consider checking the seventh actual argument of the 'fprintf' function. The SIGNED integer type argument is expected.
false
3
if (dlog) {
fprintf(dlog, "I %s %d %d %d %d %llu %llu %llu\n", c_name, fcost, icost, ecost, xcost, last_time, start_time, uv_hrtime());
fflush(dlog);
Viva64-EM
full
1423
/nfs/home/dmka/src/rakudo-star-2016.07/MoarVM/src/core/frame.c
error
V576
Incorrect format. Consider checking the fourth actual argument of the 'fprintf' function. The SIGNED integer type argument is expected.
false
3
if (dlog) {
fprintf(dlog, "I %s %d %d %d %d %llu %llu %llu\n", c_name, fcost, icost, ecost, xcost, last_time, start_time, uv_hrtime());
fflush(dlog);
Viva64-EM
full
1423
/nfs/home/dmka/src/rakudo-star-2016.07/MoarVM/src/core/frame.c
error
V576
Incorrect format. Consider checking the fifth actual argument of the 'fprintf' function. The SIGNED integer type argument is expected.
false
3
if (dlog) {
fprintf(dlog, "I %s %d %d %d %d %llu %llu %llu\n", c_name, fcost, icost, ecost, xcost, last_time, start_time, uv_hrtime());
fflush(dlog);