Re: [Qemu-devel] [PATCH] scripts: add sample model file for Coverity Scan

2014-03-19 Thread Markus Armbruster
Paolo Bonzini writes: > Il 19/03/2014 14:56, Paolo Bonzini ha scritto: >> Il 19/03/2014 13:46, Paolo Bonzini ha scritto: >>> Il 19/03/2014 10:08, Markus Armbruster ha scritto: > It probably would make static analysis a bit less powerful or will > return more false positives. The NULL ret

Re: [Qemu-devel] [PATCH] scripts: add sample model file for Coverity Scan

2014-03-19 Thread Paolo Bonzini
Il 19/03/2014 16:56, Markus Armbruster ha scritto: >Given the results, okay to > use the limited model where realloc never frees and malloc(0) returns > non-NULL? I'd describe realloc() as "always frees the old block, returns a new block, which is ne

Re: [Qemu-devel] [PATCH] scripts: add sample model file for Coverity Scan

2014-03-19 Thread Paolo Bonzini
Il 19/03/2014 14:56, Paolo Bonzini ha scritto: Il 19/03/2014 13:46, Paolo Bonzini ha scritto: Il 19/03/2014 10:08, Markus Armbruster ha scritto: It probably would make static analysis a bit less powerful or will return more false positives. The NULL return for realloc (in the "free" case) alre

Re: [Qemu-devel] [PATCH] scripts: add sample model file for Coverity Scan

2014-03-19 Thread Paolo Bonzini
Il 19/03/2014 13:46, Paolo Bonzini ha scritto: Il 19/03/2014 10:08, Markus Armbruster ha scritto: It probably would make static analysis a bit less powerful or will return more false positives. The NULL return for realloc (in the "free" case) already causes some. So I'm undecided between a mor

Re: [Qemu-devel] [PATCH] scripts: add sample model file for Coverity Scan

2014-03-19 Thread Paolo Bonzini
Il 19/03/2014 10:08, Markus Armbruster ha scritto: It probably would make static analysis a bit less powerful or will return more false positives. The NULL return for realloc (in the "free" case) already causes some. So I'm undecided between a more correct model and a more selective one (with a

Re: [Qemu-devel] [PATCH] scripts: add sample model file for Coverity Scan

2014-03-19 Thread Kevin Wolf
Am 18.03.2014 um 18:03 hat Paolo Bonzini geschrieben: > This is the model file that is being used for the QEMU project's scans > on scan.coverity.com. It fixed about 30 false positives (10% of the > total) and exposed about 60 new memory leaks. > > The file is not automatically used; changes to i

Re: [Qemu-devel] [PATCH] scripts: add sample model file for Coverity Scan

2014-03-19 Thread Markus Armbruster
Paolo Bonzini writes: > Il 18/03/2014 19:40, Markus Armbruster ha scritto: >> > +void * >> > +g_malloc (size_t n_bytes) >> > +{ >> > +void *mem; >> > +__coverity_negative_sink__((ssize_t) n_bytes); >> > +mem = malloc(n_bytes == 0 ? 1 : n_bytes); >> > +if (!mem) __coverity_panic__

Re: [Qemu-devel] [PATCH] scripts: add sample model file for Coverity Scan

2014-03-19 Thread Paolo Bonzini
Il 18/03/2014 19:40, Markus Armbruster ha scritto: > +void * > +g_malloc (size_t n_bytes) > +{ > +void *mem; > +__coverity_negative_sink__((ssize_t) n_bytes); > +mem = malloc(n_bytes == 0 ? 1 : n_bytes); > +if (!mem) __coverity_panic__ (); > +return mem; > +} This isn't quite

Re: [Qemu-devel] [PATCH] scripts: add sample model file for Coverity Scan

2014-03-18 Thread Markus Armbruster
Paolo Bonzini writes: > This is the model file that is being used for the QEMU project's scans > on scan.coverity.com. It fixed about 30 false positives (10% of the > total) and exposed about 60 new memory leaks. > > The file is not automatically used; changes to it must be propagated > to the w

[Qemu-devel] [PATCH] scripts: add sample model file for Coverity Scan

2014-03-18 Thread Paolo Bonzini
This is the model file that is being used for the QEMU project's scans on scan.coverity.com. It fixed about 30 false positives (10% of the total) and exposed about 60 new memory leaks. The file is not automatically used; changes to it must be propagated to the website manually by an admin (right