Re: [Qemu-devel] [PATCH RFC] coverity: Improve model for GLib memory allocation

2015-01-28 Thread Markus Armbruster
Thomas Huth writes: > On Thu, 22 Jan 2015 15:55:27 +0100 > Markus Armbruster wrote: > ... >> >> == Triaged / Bug == >> >> These are worrying. Something wrong with my new model? >> >> hw/s390x/s390-pci-bus.c:195: leaked_storage: Variable "sei_cont" >> going out of scope leaks the storage it p

Re: [Qemu-devel] [PATCH RFC] coverity: Improve model for GLib memory allocation

2015-01-23 Thread Markus Armbruster
Paolo Bonzini writes: > On 22/01/2015 15:55, Markus Armbruster wrote: >> == Look like a bug == >> >> blockdev-nbd.c:35: leaked_handle: Handle variable "fd" going out of >> scope leaks the handle. > > It's a false positive. > > After nbd_client_new calls nbd_send_negotiate, either it returns or >

Re: [Qemu-devel] [PATCH RFC] coverity: Improve model for GLib memory allocation

2015-01-23 Thread Thomas Huth
On Thu, 22 Jan 2015 15:55:27 +0100 Markus Armbruster wrote: ... > > == Triaged / Bug == > > These are worrying. Something wrong with my new model? > > hw/s390x/s390-pci-bus.c:195: leaked_storage: Variable "sei_cont" going out of > scope leaks the storage it points to. Did you already include

Re: [Qemu-devel] [PATCH RFC] coverity: Improve model for GLib memory allocation

2015-01-22 Thread Paolo Bonzini
On 22/01/2015 15:55, Markus Armbruster wrote: > == Look like a bug == > > blockdev-nbd.c:35: leaked_handle: Handle variable "fd" going out of scope > leaks the handle. It's a false positive. After nbd_client_new calls nbd_send_negotiate, either it returns or client escapes via QTAILQ_INSERT_T

Re: [Qemu-devel] [PATCH RFC] coverity: Improve model for GLib memory allocation

2015-01-22 Thread Markus Armbruster
Local scan results look great on first glance. Comparing summary.txt, I get -2 TAINTED_STRING 1 MISSING_LOCK 1 REVERSE_NEGATIVE -4 FORWARD_NULL -6 CHECKED_RETURN -21 RESOURCE_LEAK 4 TAINTED_SCALAR -2 NEGATIVE_RETURNS -3 NULL_RETURNS A closer examina

[Qemu-devel] [PATCH RFC] coverity: Improve model for GLib memory allocation

2015-01-22 Thread Markus Armbruster
In current versions of GLib, g_new() may expand into g_malloc_n(), which we don't model. When it does, Coverity can't see the memory allocation. Similarly for g_new0(), g_renew(), g_try_new(), g_try_new0(), g_try_renew(). Model g_try_malloc_n(), g_malloc_n(), g_try_malloc0_n(), g_malloc0_n(), g_