linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [4/5] Coccinelle: put_device: Extend when constraints for twoSmPL ellipses
       [not found] <201905141718583344787@zte.com.cn>
@ 2019-05-14  9:51 ` Markus Elfring
  2019-05-15 17:09 ` [4/5] Coccinelle: put_device: Extend when constraints for two SmPL ellipses Markus Elfring
  1 sibling, 0 replies; 7+ messages in thread
From: Markus Elfring @ 2019-05-14  9:51 UTC (permalink / raw)
  To: Wen Yang
  Cc: Julia Lawall, Gilles Muller, Masahiro Yamada, Michal Marek,
	Nicolas Palix, Yi Wang, LKML, Coccinelle

> I did another experiment at that time and found that this modification will
> reduce the false positive rate,

Thanks for such feedback.

Will my update suggestion influence the current (or future) software situation?


> but it may also reduce the recall rate.

Would you like to explain this information a bit more?


> Could we use it to find out as many bugs as possible in the current kernel
> and then modify it?

I hope so.

* Will the false positive rate influence change acceptance considerably?

* Would you like to work with source code analysis approaches based on
  adjusted confidence settings?

Regards,
Markus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [4/5] Coccinelle: put_device: Extend when constraints for two SmPL ellipses
       [not found] <201905141718583344787@zte.com.cn>
  2019-05-14  9:51 ` [4/5] Coccinelle: put_device: Extend when constraints for twoSmPL ellipses Markus Elfring
@ 2019-05-15 17:09 ` Markus Elfring
  1 sibling, 0 replies; 7+ messages in thread
From: Markus Elfring @ 2019-05-15 17:09 UTC (permalink / raw)
  To: Wen Yang
  Cc: Julia Lawall, Gilles Muller, Masahiro Yamada, Michal Marek,
	Nicolas Palix, Yi Wang, Coccinelle, LKML

> Could we use it to find out as many bugs as possible in the current kernel

How do you think about to work with any more source code analysis approaches?


> and then modify it?

I guess that you do not need to wait for a solution so long.

Variables which get reassigned in unwanted ways (before the desired call
of a resource release function in the discussed use case) can be found also
with the help of the semantic patch language (Coccinelle software).

Regards,
Markus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [4/5] Coccinelle: put_device: Extend when constraints for two SmPL ellipses
  2019-05-14  6:52         ` Julia Lawall
@ 2019-05-14  7:49           ` Markus Elfring
  2019-05-14  7:49           ` Markus Elfring
  1 sibling, 0 replies; 7+ messages in thread
From: Markus Elfring @ 2019-05-14  7:49 UTC (permalink / raw)
  To: Julia Lawall, Wen Yang
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	cocci, linux-kernel, Yi Wang

>> Can you agree to any information which I presented in the commit message?

Do you find this description inappropriate?


>>> You don't need so many type metavariables.
>>
>> It seems that the Coccinelle software can cope also with my SmPL code addition.
>> You might feel uncomfortable with the suggested changes for a while.
>
> It's ugly.  Much more ugly than msg =

The clarification of this change reluctance might become more interesting.
I got convinced that there is a need for further software updates.


>> * Can it become required to identify involved source code placeholders
>>   by extra metavariables?
>
> I don't understand the question.

Wen Yang was planning a corresponding modification since 2019-02-19.
https://lore.kernel.org/cocci/201902191014156680299@zte.com.cn/
https://systeme.lip6.fr/pipermail/cocci/2019-February/005620.html

I got into the development mood to contribute another concrete update suggestion
for an open issue in affected scripts for the semantic patch language.
Do you recognise the need for the extension of exclusion specifications here?


>> * Would you like to clarify the probability any more how often the shown
>>   type casts will be identical?
>
> No idea about this one either.

I am curious if helpful ideas will be added also by other contributors.


> Basically, if you have T && T, the two T's have to be the same,

Such an expectation might be logical.


> and T is not pure.

This information triggers various communication difficulties.


> If you have T on two separate ...s then you are in the && case.

I agree to this view also according the application of two ellipses
in the SmPL rule “search”.


> If you have T in two branches of a disjunction or in two whens on the same
> ... you are in the || case.

It is clear that disjunctions will check code alternatives here.
The clarification of consequences around the interpretation of “type purity”
might distract from the final solution.


How many (optional) type casts would we like to handle by the discussed
source code search approach?

Regards,
Markus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [4/5] Coccinelle: put_device: Extend when constraints for two SmPL ellipses
  2019-05-14  6:52         ` Julia Lawall
  2019-05-14  7:49           ` Markus Elfring
@ 2019-05-14  7:49           ` Markus Elfring
  1 sibling, 0 replies; 7+ messages in thread
From: Markus Elfring @ 2019-05-14  7:49 UTC (permalink / raw)
  To: Julia Lawall, Wen Yang
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	cocci, linux-kernel, Yi Wang

>> Can you agree to any information which I presented in the commit message?

Do you find this description inappropriate?


>>> You don't need so many type metavariables.
>>
>> It seems that the Coccinelle software can cope also with my SmPL code addition.
>> You might feel uncomfortable with the suggested changes for a while.
>
> It's ugly.  Much more ugly than msg =

The clarification of this change reluctance might become more interesting.
I got convinced that there is a need for further software updates.


>> * Can it become required to identify involved source code placeholders
>>   by extra metavariables?
>
> I don't understand the question.

Wen Yang was planning a corresponding modification since 2019-02-19.
https://lore.kernel.org/cocci/201902191014156680299@zte.com.cn/
https://systeme.lip6.fr/pipermail/cocci/2019-February/005620.html

I got into the development mood to contribute another concrete update suggestion
for an open issue in affected scripts for the semantic patch language.
Do you recognise the need for the extension of exclusion specifications here?


>> * Would you like to clarify the probability any more how often the shown
>>   type casts will be identical?
>
> No idea about this one either.

I am curious if helpful ideas will be added also by other contributors.


> Basically, if you have T && T, the two T's have to be the same,

Such an expectation might be logical.


> and T is not pure.

This information triggers various communication difficulties.


> If you have T on two separate ...s then you are in the && case.

I agree to this view also according the application of two ellipses
in the SmPL rule “search”.


> If you have T in two branches of a disjunction or in two whens on the same
> ... you are in the || case.

It is clear that disjunctions will check code alternatives here.
The clarification of consequences around the interpretation of “type purity”
might distract from the final solution.


How many (optional) type casts would we like to handle by the discussed
source code search approach?

Regards,
Markus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [4/5] Coccinelle: put_device: Extend when constraints for two SmPL ellipses
  2019-05-14  5:55       ` Markus Elfring
@ 2019-05-14  6:52         ` Julia Lawall
  2019-05-14  7:49           ` Markus Elfring
  2019-05-14  7:49           ` Markus Elfring
  0 siblings, 2 replies; 7+ messages in thread
From: Julia Lawall @ 2019-05-14  6:52 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Wen Yang, cocci, linux-kernel, Yi Wang



On Tue, 14 May 2019, Markus Elfring wrote:

> >> A SmPL ellipsis was specified for a search approach so that additional
> >> source code would be tolerated between an assignment to a local variable
> >> and the corresponding null pointer check.
> >>
> >> But such code should be restricted.
> >> * The local variable must not be reassigned there.
> >> * It must also not be forwarded to an other assignment target.
> >>
> >> Take additional casts for these code exclusion specifications into account
> >> together with optional parentheses.
> >
> > NACK.
>
> Can you agree to any information which I presented in the commit message?
>
>
> > You don't need so many type metavariables.
>
> It seems that the Coccinelle software can cope also with my SmPL code addition.
> You might feel uncomfortable with the suggested changes for a while.

It's ugly.  Much more ugly than msg =

>
>
> > Type metavariables in the same ... can be the same.
>
> Such information is good to know for the proper usage of specifications
> after a SmPL ellipsis.
>
> * Can it become required to identify involved source code placeholders
>   by extra metavariables?

I don't understand the question.

> * Would you like to clarify the probability any more how often the shown
>   type casts will be identical?

No idea about this one either.

Basically, if you have T && T, the two T's have to be the same, and T is
not pure.  If you have T || T, then only one will be matched and T remains
pure.  If you have T on two separate ...s then you are in the && case.  If
you have T in two branches of a disjunction or in two whens on the same
... you are in the || case.  Just as you can use the variable e1 over and
over on the same when, you can use the same T.

julia

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [4/5] Coccinelle: put_device: Extend when constraints for two SmPL ellipses
  2019-05-13  9:31     ` Julia Lawall
  2019-05-13 12:22       ` [4/5] " Markus Elfring
@ 2019-05-14  5:55       ` Markus Elfring
  2019-05-14  6:52         ` Julia Lawall
  1 sibling, 1 reply; 7+ messages in thread
From: Markus Elfring @ 2019-05-14  5:55 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Wen Yang, cocci, linux-kernel, Yi Wang

>> A SmPL ellipsis was specified for a search approach so that additional
>> source code would be tolerated between an assignment to a local variable
>> and the corresponding null pointer check.
>>
>> But such code should be restricted.
>> * The local variable must not be reassigned there.
>> * It must also not be forwarded to an other assignment target.
>>
>> Take additional casts for these code exclusion specifications into account
>> together with optional parentheses.
>
> NACK.

Can you agree to any information which I presented in the commit message?


> You don't need so many type metavariables.

It seems that the Coccinelle software can cope also with my SmPL code addition.
You might feel uncomfortable with the suggested changes for a while.


> Type metavariables in the same ... can be the same.

Such information is good to know for the proper usage of specifications
after a SmPL ellipsis.

* Can it become required to identify involved source code placeholders
  by extra metavariables?

* Would you like to clarify the probability any more how often the shown
  type casts will be identical?

Regards,
Markus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [4/5] Coccinelle: put_device: Extend when constraints for two SmPL ellipses
  2019-05-13  9:31     ` Julia Lawall
@ 2019-05-13 12:22       ` Markus Elfring
  2019-05-14  5:55       ` Markus Elfring
  1 sibling, 0 replies; 7+ messages in thread
From: Markus Elfring @ 2019-05-13 12:22 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Wen Yang, cocci, linux-kernel, Yi Wang

>> Take additional casts for these code exclusion specifications into account
>> together with optional parentheses.
>
> NACK.

I find this rejection surprising.


> You don't need so many type metavariables.

I got an other software development opinion for this aspect.

Yesterday we started to clarify consequences from the isomorphism specification
“drop_cast” (for SmPL code).
https://github.com/coccinelle/coccinelle/blob/32d3b89ad909316464344a5f61a8092d8d702321/standard.iso#L52

Information like the following influenced my design decision to add three
metavariables here.

elfring@Sonne:~/Projekte/Linux/next-patched> spatch --parse-cocci scripts/coccinelle/free/put_device.cocci
…
warning: iso drop_cast does not match the code below on line -1
T (T )id

pure metavariable T is matched against the following nonpure code:
T
…


> Type metavariables in the same ... can be the same.

I would find it also occasionally nice when multiple SmPL ellipses
can refer to identical type casts.

* The under-documented “type purity” hinders this at the moment.

* But I got the impression that it can be safer to distinguish these
  code variants better.

Regards,
Markus

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-05-15 17:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <201905141718583344787@zte.com.cn>
2019-05-14  9:51 ` [4/5] Coccinelle: put_device: Extend when constraints for twoSmPL ellipses Markus Elfring
2019-05-15 17:09 ` [4/5] Coccinelle: put_device: Extend when constraints for two SmPL ellipses Markus Elfring
2019-03-23  6:14 [PATCH] coccinelle: put_device: reduce false positives Wen Yang
2019-05-13  8:55 ` [PATCH 0/5] Coccinelle: put_device: Adjustments for a SmPL script Markus Elfring
2019-05-13  9:07   ` [PATCH 4/5] Coccinelle: put_device: Extend when constraints for two SmPL ellipses Markus Elfring
2019-05-13  9:31     ` Julia Lawall
2019-05-13 12:22       ` [4/5] " Markus Elfring
2019-05-14  5:55       ` Markus Elfring
2019-05-14  6:52         ` Julia Lawall
2019-05-14  7:49           ` Markus Elfring
2019-05-14  7:49           ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).