mbox

[PULL,0/4] coverity: Improve and extend model

Message ID 1423153463-26494-1-git-send-email-armbru@redhat.com
State New
Headers show

Pull-request

git://repo.or.cz/qemu/armbru.git tags/pull-cov-model-2015-02-05

Message

Markus Armbruster Feb. 5, 2015, 4:24 p.m. UTC
The following changes since commit ec6f25e788ef57ce1e9f734984ef8885172fd9e2:

  Merge remote-tracking branch 'remotes/rth/tags/pull-tg-s390-20150203' into staging (2015-02-03 21:37:16 +0000)

are available in the git repository at:


  git://repo.or.cz/qemu/armbru.git tags/pull-cov-model-2015-02-05

for you to fetch changes up to 8c413e7902ef0c19ced516f575db989ccc3785f8:

  MAINTAINERS: Add myself as Coverity model maintainer (2015-02-05 17:16:14 +0100)

----------------------------------------------------------------
coverity: Improve and extend model

----------------------------------------------------------------
Markus Armbruster (4):
      coverity: Improve model for GLib memory allocation
      coverity: Model GLib string allocation partially
      coverity: Model g_free() isn't necessarily free()
      MAINTAINERS: Add myself as Coverity model maintainer

 MAINTAINERS              |   5 ++
 scripts/coverity-model.c | 228 +++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 198 insertions(+), 35 deletions(-)

Comments

Peter Maydell Feb. 5, 2015, 5:11 p.m. UTC | #1
On 5 February 2015 at 16:24, Markus Armbruster <armbru@redhat.com> wrote:
> The following changes since commit ec6f25e788ef57ce1e9f734984ef8885172fd9e2:
>
>   Merge remote-tracking branch 'remotes/rth/tags/pull-tg-s390-20150203' into staging (2015-02-03 21:37:16 +0000)
>
> are available in the git repository at:
>
>
>   git://repo.or.cz/qemu/armbru.git tags/pull-cov-model-2015-02-05
>
> for you to fetch changes up to 8c413e7902ef0c19ced516f575db989ccc3785f8:
>
>   MAINTAINERS: Add myself as Coverity model maintainer (2015-02-05 17:16:14 +0100)
>
> ----------------------------------------------------------------
> coverity: Improve and extend model
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM
Paolo Bonzini Feb. 10, 2015, 4:25 p.m. UTC | #2
On 05/02/2015 18:11, Peter Maydell wrote:
> On 5 February 2015 at 16:24, Markus Armbruster <armbru@redhat.com> wrote:
>> The following changes since commit ec6f25e788ef57ce1e9f734984ef8885172fd9e2:
>>
>>   Merge remote-tracking branch 'remotes/rth/tags/pull-tg-s390-20150203' into staging (2015-02-03 21:37:16 +0000)
>>
>> are available in the git repository at:
>>
>>
>>   git://repo.or.cz/qemu/armbru.git tags/pull-cov-model-2015-02-05
>>
>> for you to fetch changes up to 8c413e7902ef0c19ced516f575db989ccc3785f8:
>>
>>   MAINTAINERS: Add myself as Coverity model maintainer (2015-02-05 17:16:14 +0100)
>>
>> ----------------------------------------------------------------
>> coverity: Improve and extend model
>>
>> ----------------------------------------------------------------
> 
> Applied, thanks.
> 
> -- PMM
> 
> 

It seems like Coverity Scan doesn't like the new model.  Possibly the
fault of the third patch.  Will check (for now I'm still running scans
with the old model).

Paolo
Markus Armbruster Feb. 11, 2015, 2:45 p.m. UTC | #3
Paolo Bonzini <pbonzini@redhat.com> writes:

> On 05/02/2015 18:11, Peter Maydell wrote:
>> On 5 February 2015 at 16:24, Markus Armbruster <armbru@redhat.com> wrote:
>>> The following changes since commit ec6f25e788ef57ce1e9f734984ef8885172fd9e2:
>>>
>>>   Merge remote-tracking branch
>>> remotes/rth/tags/pull-tg-s390-20150203' into staging (2015-02-03
>>> 21:37:16 +0000)
>>>
>>> are available in the git repository at:
>>>
>>>
>>>   git://repo.or.cz/qemu/armbru.git tags/pull-cov-model-2015-02-05
>>>
>>> for you to fetch changes up to 8c413e7902ef0c19ced516f575db989ccc3785f8:
>>>
>>>   MAINTAINERS: Add myself as Coverity model maintainer (2015-02-05
>>> 17:16:14 +0100)
>>>
>>> ----------------------------------------------------------------
>>> coverity: Improve and extend model
>>>
>>> ----------------------------------------------------------------
>> 
>> Applied, thanks.
>> 
>> -- PMM
>> 
>> 
>
> It seems like Coverity Scan doesn't like the new model.  Possibly the
> fault of the third patch.

Works for me with a local 7.0.3 installation.  Which I just realized is
outdated.  I'll recheck with 7.6.0.

>                            Will check (for now I'm still running scans
> with the old model).

Appreciated.
Paolo Bonzini Feb. 11, 2015, 6:29 p.m. UTC | #4
\>> It seems like Coverity Scan doesn't like the new model.  Possibly the
>> fault of the third patch.
> 
> Works for me with a local 7.0.3 installation.  Which I just realized is
> outdated.  I'll recheck with 7.6.0.
> 
>>                            Will check (for now I'm still running scans
>> with the old model).
> 
> Appreciated.

Yes, the last patch seems to be the culprit.  It failed immediately with
the __coverity_mark_as_afm_freed__(ptr, "g_free") model; it's been
running for a while without it even though it's not done yet.

Perhaps we can do something like this:

/* Some helpful comment here.  */
#if 1
#define AFM_g_free              AFM_free
#else
#define AFM_g_free              "g_free"
#endif

Paolo
Markus Armbruster Feb. 12, 2015, 9:11 a.m. UTC | #5
Paolo Bonzini <pbonzini@redhat.com> writes:

> \>> It seems like Coverity Scan doesn't like the new model.  Possibly the
>>> fault of the third patch.
>> 
>> Works for me with a local 7.0.3 installation.  Which I just realized is
>> outdated.  I'll recheck with 7.6.0.
>> 
>>>                            Will check (for now I'm still running scans
>>> with the old model).
>> 
>> Appreciated.
>
> Yes, the last patch seems to be the culprit.  It failed immediately with
> the __coverity_mark_as_afm_freed__(ptr, "g_free") model;

Any diagnostics?

Works for me locally with 7.6.0, and matches the reference manual's
examples for the ALLOC_FREE_MISMATCH checker.

>                                                          it's been
> running for a while without it even though it's not done yet.
>
> Perhaps we can do something like this:
>
> /* Some helpful comment here.  */
> #if 1
> #define AFM_g_free              AFM_free
> #else
> #define AFM_g_free              "g_free"
> #endif

Yes.  If you want me to write the helpful comment, I need to know what
exactly goes wrong.

The alternative is to revert the patch for now.

Aside: would be nice if Coverity pre-defined a symbol when
ALLOC_FREE_MISMATCH is enabled, it would let me enable support for the
checker exactly when it's wanted.
Paolo Bonzini Feb. 12, 2015, 2:11 p.m. UTC | #6
On 12/02/2015 10:11, Markus Armbruster wrote:
> > Yes, the last patch seems to be the culprit.  It failed immediately with
> > the __coverity_mark_as_afm_freed__(ptr, "g_free") model;
> 
> Any diagnostics?

None.  It just says roughly "the build had a temporary problem and will
be rescheduled".

> The alternative is to revert the patch for now.

No problem, the model file is anyway just documentation since you have
to upload it manually.

I'll ask the admins.

Paolo