All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses
       [not found] <201905151538552354689@zte.com.cn>
@ 2019-05-15  8:06 ` Markus Elfring
  0 siblings, 0 replies; 9+ messages in thread
From: Markus Elfring @ 2019-05-15  8:06 UTC (permalink / raw)
  To: Wen Yang
  Cc: Julia Lawall, Gilles Muller, Masahiro Yamada, Michal Marek,
	Nicolas Palix, Yi Wang, Cheng Shengyu, Ma Jiang, cocci,
	linux-kernel

> I don't think it is an environmental issue.

You are right about taking other parameters better into account.


> Theoretically, the original SmPL should find bugs.

I expect also that both script versions should display a warning.


> Although, I still send you my environmental information:

Thanks.


> spatch version 1.0.7 compiled with OCaml version 4.06.0

This shows that our software variants are recent enough.


> You may not take a serious look at the pci_free_consistent.cocci script,

I try to handle my update suggestions and your constructive feedback seriously.


> it needs to pass in the virtual variable report.

I did that a moment later.

I would like to apologise for a temporarily inappropriate parameter selection.
How will the clarification of the shown software behaviour evolve further?

Regards,
Markus

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

* Re: [3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses
       [not found] <201905151043340243098@zte.com.cn>
                   ` (2 preceding siblings ...)
  2019-05-15  6:48 ` Markus Elfring
@ 2019-05-15 12:48 ` Markus Elfring
  3 siblings, 0 replies; 9+ messages in thread
From: Markus Elfring @ 2019-05-15 12:48 UTC (permalink / raw)
  To: Wen Yang, Julia Lawall
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Yi Wang, Cheng Shengyu, Ma Jiang, Coccinelle, LKML

> 2,  If you really plan to add the two restrictions above,
> you may need to consider this further than simply adding a "when != id = (T2)(e)" statement.
> I constructed the flollowing code snippet as a test case:
> Using the original SmPL, we can find a bug.
> But with your modified SmPL, we can't find the bug.

The difference is the possible exclusion of a reassignment to a local variable
in which a pointer was stored for a resource allocation.

Would you like to adjust corresponding case distinctions any further?

How many script variants will become relevant here?

Regards,
Markus

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

* Re: [3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses
  2019-05-15 10:19         ` Julia Lawall
@ 2019-05-15 11:18           ` Markus Elfring
  0 siblings, 0 replies; 9+ messages in thread
From: Markus Elfring @ 2019-05-15 11:18 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Coccinelle, LKML, Cheng Shengyu, Gilles Muller, Ma Jiang,
	Masahiro Yamada, Michal Marek, Nicolas Palix, Wen Yang, Yi Wang



Am 15.05.19 um 12:19 schrieb Julia Lawall:
>
>
> On Wed, 15 May 2019, Markus Elfring wrote:
>
>>>>> On the other hand, I do care about causing false negatives.
>>>>
>>>> Do you find the missing warning after the addition of such an exclusion
>>>> specification interesting?
>>>
>>> I already suggested how to improve the code.
>>
>> I find that the idea “e2->fld” needs further clarification.
>> Such a SmPL specification will be resolved also to an expression,
>> won't it?
>
> Saving in a local variable doesn't impact the need to free the object.

I suggest to reconsider this view.

Would we like to introduce additional case distinctions for the handling
of reassignments to local variables (as shown in Wen's test case)?


> A field is the most obvious case where the object may not need freeing.

A corresponding resource release should probably be performed by
an other function then.


> But there are many expressions that e2->fld will not match.

Data structure members can eventually belong also to a local variable.
Would they become relevant for further SmPL exclusion specifications?

Regards,
Markus

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

* Re: [3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses
  2019-05-15  9:40       ` Markus Elfring
@ 2019-05-15 10:19         ` Julia Lawall
  2019-05-15 11:18           ` Markus Elfring
  0 siblings, 1 reply; 9+ messages in thread
From: Julia Lawall @ 2019-05-15 10:19 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Coccinelle, LKML, Cheng Shengyu, Gilles Muller, Ma Jiang,
	Masahiro Yamada, Michal Marek, Nicolas Palix, Wen Yang, Yi Wang

[-- Attachment #1: Type: text/plain, Size: 639 bytes --]



On Wed, 15 May 2019, Markus Elfring wrote:

> >>> On the other hand, I do care about causing false negatives.
> >>
> >> Do you find the missing warning after the addition of such an exclusion
> >> specification interesting?
> >
> > I already suggested how to improve the code.
>
> I find that the idea “e2->fld” needs further clarification.
> Such a SmPL specification will be resolved also to an expression,
> won't it?

Saving in a local variable doesn't impact the need to free the object.  A
field is the most obvious case where the object may not need freeing.  But
there are many expressions that e2->fld will not match.

julia

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

* Re: [3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses
       [not found]     ` <alpine.DEB.2.20.1905151119070.3231@hadrien>
@ 2019-05-15  9:40       ` Markus Elfring
  2019-05-15 10:19         ` Julia Lawall
  0 siblings, 1 reply; 9+ messages in thread
From: Markus Elfring @ 2019-05-15  9:40 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Coccinelle, LKML, Cheng Shengyu, Gilles Muller, Ma Jiang,
	Masahiro Yamada, Michal Marek, Nicolas Palix, Wen Yang, Yi Wang

>>> On the other hand, I do care about causing false negatives.
>>
>> Do you find the missing warning after the addition of such an exclusion
>> specification interesting?
>
> I already suggested how to improve the code.

I find that the idea “e2->fld” needs further clarification.
Such a SmPL specification will be resolved also to an expression,
won't it?

I guess that it can fit better to other analysis approaches.
Will any script variants become more interesting?

Is it still unclear which detail (besides the added SmPL filter)
will hinder the warning display for Wen's test case?

Regards,
Markus

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

* Re: [3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses
  2019-05-15  6:10 ` [PATCH 3/3] Coccinelle: pci_free_consistent: Extend whenconstraints " Julia Lawall
@ 2019-05-15  8:36   ` Markus Elfring
       [not found]     ` <alpine.DEB.2.20.1905151119070.3231@hadrien>
  0 siblings, 1 reply; 9+ messages in thread
From: Markus Elfring @ 2019-05-15  8:36 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Wen Yang, Gilles Muller, Masahiro Yamada, Michal Marek,
	Nicolas Palix, Yi Wang, Cheng Shengyu, Ma Jiang, LKML,
	Coccinelle

>> 1, "id = (T2)(e)" is rare.
>
> Thanks for checking.  I don't really care if it is rare.

I got related source code analysis concerns.


> There should not be much cost to this.

Each additional filter will influence the software run times and
possible results.


> On the other hand, I do care about causing false negatives.

Do you find the missing warning after the addition of such an exclusion
specification interesting?

Regards,
Markus

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

* Re: [3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses
  2019-05-15  6:48 ` Markus Elfring
@ 2019-05-15  7:48   ` Markus Elfring
  0 siblings, 0 replies; 9+ messages in thread
From: Markus Elfring @ 2019-05-15  7:48 UTC (permalink / raw)
  To: Wen Yang, Julia Lawall
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Yi Wang, Cheng Shengyu, Ma Jiang, Coccinelle, LKML

>> But with your modified SmPL, we can't find the bug.
>
> I do not see a difference here.

I have accidentally overlooked to pass the parameter “-D report”
to the spatch program.
Now I notice also an unexpected and undesirable difference for your test example
after the suggested addition of exclusion specifications.


> - I wonder also about this situation then.

How should the software behaviour be improved finally?

Will we need to work with any SmPL script versions in parallel
for selected source code analysis configurations?

Regards,
Markus

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

* Re: [3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses
       [not found] <201905151043340243098@zte.com.cn>
  2019-05-15  6:10 ` [PATCH 3/3] Coccinelle: pci_free_consistent: Extend whenconstraints " Julia Lawall
  2019-05-15  6:48 ` Markus Elfring
@ 2019-05-15  6:48 ` Markus Elfring
  2019-05-15  7:48   ` Markus Elfring
  2019-05-15 12:48 ` Markus Elfring
  3 siblings, 1 reply; 9+ messages in thread
From: Markus Elfring @ 2019-05-15  6:48 UTC (permalink / raw)
  To: Wen Yang, Julia Lawall
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Yi Wang, Cheng Shengyu, Ma Jiang, Coccinelle, LKML

> 1, "id = (T2)(e)" is rare.

I can follow this view for such a filter.


> It may be a minor detail that will have no impact in practice.

I suggest to reconsider this view once more.

Should such exclusion specifications take also “unexpected” source code
into account so that analysis results will be presented with a low
false positive rate?


> We've tested it, and this SmPL may only need to fix the following two false positives:

Thanks for your acknowledgement that my proposal can give us
another useful effect.


> 2,  If you really plan to add the two restrictions above,
> you may need to consider this further than simply adding a "when != id = (T2)(e)" statement.
> I constructed the flollowing code snippet as a test case:
> Using the original SmPL, we can find a bug.

I observe on my system that I do not get a desired warning
by the software combination “Coccinelle 1.0.7-00186-g99e081e9 (OCaml 4.07.1)”
(even from the unmodified SmPL script) for your test example.

Which version are you using for the spatch program?


> But with your modified SmPL, we can't find the bug.

I do not see a difference here. - I wonder also about this situation then.

But this gives us the opportunity to clarify the really desired
software behaviour in more detail.
How many developers would like to help with additional insights?

Regards,
Markus

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

* Re: [3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses
       [not found] <201905151043340243098@zte.com.cn>
  2019-05-15  6:10 ` [PATCH 3/3] Coccinelle: pci_free_consistent: Extend whenconstraints " Julia Lawall
@ 2019-05-15  6:48 ` Markus Elfring
  2019-05-15  6:48 ` Markus Elfring
  2019-05-15 12:48 ` Markus Elfring
  3 siblings, 0 replies; 9+ messages in thread
From: Markus Elfring @ 2019-05-15  6:48 UTC (permalink / raw)
  To: Wen Yang, Julia Lawall
  Cc: Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Yi Wang, Cheng Shengyu, Ma Jiang, Coccinelle, LKML

> 1, "id = (T2)(e)" is rare.

I can follow this view for such a filter.


> It may be a minor detail that will have no impact in practice.

I suggest to reconsider this view once more.

Should such exclusion specifications take also “unexpected” source code
into account so that analysis results will be presented with a low
false positive rate?


> We've tested it, and this SmPL may only need to fix the following two false positives:

Thanks for your acknowledgement that my proposal can give us
another useful effect.


> 2,  If you really plan to add the two restrictions above,
> you may need to consider this further than simply adding a "when != id = (T2)(e)" statement.
> I constructed the flollowing code snippet as a test case:
> Using the original SmPL, we can find a bug.

I observe on my system that I do not get a desired warning
by the software combination “Coccinelle 1.0.7-00186-g99e081e9 (OCaml 4.07.1)”
(even from the unmodified SmPL script) for your test example.

Which version are you using for the spatch program?


> But with your modified SmPL, we can't find the bug.

I do not see a difference here. - I wonder also about this situation then.

But this gives us the opportunity to clarify the really desired
software behaviour in more detail.
How many developers would like to help with additional insights?

Regards,
Markus

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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <201905151538552354689@zte.com.cn>
2019-05-15  8:06 ` [3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses Markus Elfring
     [not found] <201905151043340243098@zte.com.cn>
2019-05-15  6:10 ` [PATCH 3/3] Coccinelle: pci_free_consistent: Extend whenconstraints " Julia Lawall
2019-05-15  8:36   ` [3/3] Coccinelle: pci_free_consistent: Extend when constraints " Markus Elfring
     [not found]     ` <alpine.DEB.2.20.1905151119070.3231@hadrien>
2019-05-15  9:40       ` Markus Elfring
2019-05-15 10:19         ` Julia Lawall
2019-05-15 11:18           ` Markus Elfring
2019-05-15  6:48 ` Markus Elfring
2019-05-15  6:48 ` Markus Elfring
2019-05-15  7:48   ` Markus Elfring
2019-05-15 12:48 ` Markus Elfring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.