Re: [Cocci] [PATCH v2] coccinelle: locks: Add balancedlock.cocci script
From: Julia Lawall
Date: Wed Nov 18 2020 - 08:15:58 EST
> > +++ b/scripts/coccinelle/locks/balancedlock.cocci
> …
> > +//# False positives may be generated due to locks released within a nested
> > +//# function call or a goto block.
> > +///
> > +// Confidence: Moderate
>
> How good does such information fit together?
>
What kind of response do you expect? There are some concerns, so it's not
High confidence. It works pretty well so it's not low confidence. So
it's moderate confidence. What else is there to say?
> …
> >+ (
> > +mutex_lock@p(E);
> > +|
> > +read_lock@p(E);
> > +|
> …
>
> Why did you not reorder the elements of such a SmPL disjunctions according to
> an usage incidence (which can be determined by another SmPL script like
> “report_lock_calls.cocci”)?
I don't recall ever seeing any evidence that it has an impact for function
calls. Furthermore, the numbers will change over time. So why change it?
> …
> > +msg = "This code segment might have an unbalanced lock."
> > +coccilib.org.print_todo(j0[0], msg)
>
> Please pass the string literal directly.
>
> +coccilib.org.print_todo(j0[0], "This code segment might have an unbalanced lock.")
The code is fine as it is.
julia