Re: C static analysis on rakudo sources

2016-10-17 Thread Timo Paulssen
Yup!

https://scan.coverity.com/projects/paultcochrane-moarvm


Re: C static analysis on rakudo sources

2016-10-16 Thread Michael Franz
BTW
http://www.coverity.com/press-releases/press_story54_01_08_08/




From: Tobias Leich <em...@froggs.de>
Sent: Sunday, October 16, 2016 3:05:36 AM
To: Dmitry Karasik; perl6-compi...@perl.org
Subject: Re: C static analysis on rakudo sources

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
>

This email and any files transmitted with it are confidential material. They 
are intended solely for the use of the designated individual or entity to whom 
they are addressed. If the reader of this message is not the intended 
recipient, you are hereby notified that any dissemination, use, distribution or 
copying of this communication is strictly prohibited and may be unlawful.

If you have received this email in error please immediately notify the sender 
and delete or destroy any copy of this message


Re: C static analysis on rakudo sources

2016-10-16 Thread Tobias Leich

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);

C static analysis on rakudo sources

2016-10-15 Thread 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

-- 
Sincerely,
Dmitry Karasik