All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] Linux scripts/coccinelle/locks/double_lock.cocci not working ?
@ 2016-05-30 16:52 Iago Abal
  2016-05-31  9:34 ` Julia Lawall
  0 siblings, 1 reply; 12+ messages in thread
From: Iago Abal @ 2016-05-30 16:52 UTC (permalink / raw)
  To: cocci

Hi,

It seems that the script scripts/coccinelle/locks/double_lock.cocci
distributed with Linux 4.7-rc1 is broken. I'm using using Coccinelle 1.0.4:

Fatal error: exception Failure("False should not be in the final result.
Perhaps your rule doesn't contain any +/-/* code, or you have a failed
dependency.  If the problem is not clear, try the option
--debug-parse-cocci.")

See
https://github.com/torvalds/linux/blob/1a695a905c18548062509178b98bc91e67510864/scripts/coccinelle/locks/double_lock.cocci

Could you confirm if that's the case?

Thanks,

Iago
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20160530/c7b28307/attachment.html>

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

* [Cocci] Linux scripts/coccinelle/locks/double_lock.cocci not working ?
  2016-05-30 16:52 [Cocci] Linux scripts/coccinelle/locks/double_lock.cocci not working ? Iago Abal
@ 2016-05-31  9:34 ` Julia Lawall
  2016-06-01 13:31   ` Iago Abal
  0 siblings, 1 reply; 12+ messages in thread
From: Julia Lawall @ 2016-05-31  9:34 UTC (permalink / raw)
  To: cocci



On Mon, 30 May 2016, Iago Abal wrote:

> Hi,
>
> It seems that the script scripts/coccinelle/locks/double_lock.cocci distributed with Linux 4.7-rc1 is broken. I'm using using Coccinelle 1.0.4:
>
> Fatal error: exception Failure("False should not be in the final result.? Perhaps your rule doesn't contain any +/-/* code, or you have a failed dependency.? If the problem is not clear, try the option --debug-parse-cocci.")
>
> See https://github.com/torvalds/linux/blob/1a695a905c18548062509178b98bc91e67510864/scripts/coccinelle/locks/double_lock.cocci
>
> Could you confirm if that's the case?

It doesn't look broken.  Did you put either -D org or -D report on the
command line?  If not, it won't know what to do, and it will give a
message like the one you are seeing.

julia

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

* [Cocci] Linux scripts/coccinelle/locks/double_lock.cocci not working ?
  2016-05-31  9:34 ` Julia Lawall
@ 2016-06-01 13:31   ` Iago Abal
  2016-06-01 13:39     ` Julia Lawall
  0 siblings, 1 reply; 12+ messages in thread
From: Iago Abal @ 2016-06-01 13:31 UTC (permalink / raw)
  To: cocci

Passing -D indeed it works, thanks! Sorry for the confusion, I didn't know
about virtual rules.

Perhaps Coccinelle could be a bit more informative in this case? It
suggests that there was a parse error. Something like "I don't know what to
do, please note that rules @script:python depends on org@ and
@script:python depends on report@ are disabled" would have given me a
better chance of finding the solution myself.

Is it difficult to do that diagnosis or is just that nobody had the time so
far?

Iago

On Tue, May 31, 2016 at 11:34 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:

>
>
> On Mon, 30 May 2016, Iago Abal wrote:
>
> > Hi,
> >
> > It seems that the script scripts/coccinelle/locks/double_lock.cocci
> distributed with Linux 4.7-rc1 is broken. I'm using using Coccinelle 1.0.4:
> >
> > Fatal error: exception Failure("False should not be in the final
> result.  Perhaps your rule doesn't contain any +/-/* code, or you have a
> failed dependency.  If the problem is not clear, try the option
> --debug-parse-cocci.")
> >
> > See
> https://github.com/torvalds/linux/blob/1a695a905c18548062509178b98bc91e67510864/scripts/coccinelle/locks/double_lock.cocci
> >
> > Could you confirm if that's the case?
>
> It doesn't look broken.  Did you put either -D org or -D report on the
> command line?  If not, it won't know what to do, and it will give a
> message like the one you are seeing.
>
> julia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20160601/a7f81982/attachment.html>

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

* [Cocci] Linux scripts/coccinelle/locks/double_lock.cocci not working ?
  2016-06-01 13:31   ` Iago Abal
@ 2016-06-01 13:39     ` Julia Lawall
  2016-06-01 14:50       ` Iago Abal
  0 siblings, 1 reply; 12+ messages in thread
From: Julia Lawall @ 2016-06-01 13:39 UTC (permalink / raw)
  To: cocci



On Wed, 1 Jun 2016, Iago Abal wrote:

> Passing -D indeed it works, thanks! Sorry for the confusion, I didn't know
> about virtual rules.
>
> Perhaps Coccinelle could be a bit more informative in this case? It suggests
> that there was a parse error. Something like "I don't know what to do,
> please note that rules @script:python depends on org@ and @script:python
> depends on report@ are disabled" would have given me a better chance of
> finding the solution myself.
>
> Is it difficult to do that diagnosis or is just that nobody had the time so
> far?

It did tell you to use --debug-parse-cocci :)  But if you didn't know
about virtual rules at all, the result might not be clear.  Perhaps it
could just detect that some virtual rules are declared and none are
selected?  That would be quite simple.

julia


>
> Iago
>
> On Tue, May 31, 2016 at 11:34 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
>       On Mon, 30 May 2016, Iago Abal wrote:
>
>       > Hi,
>       >
>       > It seems that the script
>       scripts/coccinelle/locks/double_lock.cocci distributed with
>       Linux 4.7-rc1 is broken. I'm using using Coccinelle 1.0.4:
>       >
>       > Fatal error: exception Failure("False should not be in the
>       final result.? Perhaps your rule doesn't contain any +/-/* code,
>       or you have a failed dependency.? If the problem is not clear,
>       try the option --debug-parse-cocci.")
>       >
>       > Seehttps://github.com/torvalds/linux/blob/1a695a905c18548062509178b98bc91e6751
>       0864/scripts/coccinelle/locks/double_lock.cocci
>       >
>       > Could you confirm if that's the case?
>
>       It doesn't look broken.? Did you put either -D org or -D report
>       on the
>       command line?? If not, it won't know what to do, and it will
>       give a
>       message like the one you are seeing.
>
>       julia
>
>
>
>

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

* [Cocci] Linux scripts/coccinelle/locks/double_lock.cocci not working ?
  2016-06-01 13:39     ` Julia Lawall
@ 2016-06-01 14:50       ` Iago Abal
  2016-06-01 14:54         ` Julia Lawall
  0 siblings, 1 reply; 12+ messages in thread
From: Iago Abal @ 2016-06-01 14:50 UTC (permalink / raw)
  To: cocci

That would help, where do you check virtual rules?

Iago

On Wed, Jun 1, 2016 at 3:39 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:

>
>
> On Wed, 1 Jun 2016, Iago Abal wrote:
>
> > Passing -D indeed it works, thanks! Sorry for the confusion, I didn't
> know
> > about virtual rules.
> >
> > Perhaps Coccinelle could be a bit more informative in this case? It
> suggests
> > that there was a parse error. Something like "I don't know what to do,
> > please note that rules @script:python depends on org@ and @script:python
> > depends on report@ are disabled" would have given me a better chance of
> > finding the solution myself.
> >
> > Is it difficult to do that diagnosis or is just that nobody had the time
> so
> > far?
>
> It did tell you to use --debug-parse-cocci :)  But if you didn't know
> about virtual rules at all, the result might not be clear.  Perhaps it
> could just detect that some virtual rules are declared and none are
> selected?  That would be quite simple.
>
> julia
>
>
> >
> > Iago
> >
> > On Tue, May 31, 2016 at 11:34 AM, Julia Lawall <julia.lawall@lip6.fr>
> wrote:
> >
> >
> >       On Mon, 30 May 2016, Iago Abal wrote:
> >
> >       > Hi,
> >       >
> >       > It seems that the script
> >       scripts/coccinelle/locks/double_lock.cocci distributed with
> >       Linux 4.7-rc1 is broken. I'm using using Coccinelle 1.0.4:
> >       >
> >       > Fatal error: exception Failure("False should not be in the
> >       final result.  Perhaps your rule doesn't contain any +/-/* code,
> >       or you have a failed dependency.  If the problem is not clear,
> >       try the option --debug-parse-cocci.")
> >       >
> >       > Seehttps://
> github.com/torvalds/linux/blob/1a695a905c18548062509178b98bc91e6751
> >       0864/scripts/coccinelle/locks/double_lock.cocci
> >       >
> >       > Could you confirm if that's the case?
> >
> >       It doesn't look broken.  Did you put either -D org or -D report
> >       on the
> >       command line?  If not, it won't know what to do, and it will
> >       give a
> >       message like the one you are seeing.
> >
> >       julia
> >
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20160601/ca8bd79c/attachment.html>

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

* [Cocci] Linux scripts/coccinelle/locks/double_lock.cocci not working ?
  2016-06-01 14:50       ` Iago Abal
@ 2016-06-01 14:54         ` Julia Lawall
  2016-06-01 15:00           ` Iago Abal
  0 siblings, 1 reply; 12+ messages in thread
From: Julia Lawall @ 2016-06-01 14:54 UTC (permalink / raw)
  To: cocci



On Wed, 1 Jun 2016, Iago Abal wrote:

> That would help, where do you check virtual rules?

To my recollection, they are just checked on the interpretation of
relevant depends ons.  But they could easily be checked for at the time of
generating the message.

julia

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

* [Cocci] Linux scripts/coccinelle/locks/double_lock.cocci not working ?
  2016-06-01 14:54         ` Julia Lawall
@ 2016-06-01 15:00           ` Iago Abal
  2016-06-01 15:21             ` Julia Lawall
  0 siblings, 1 reply; 12+ messages in thread
From: Iago Abal @ 2016-06-01 15:00 UTC (permalink / raw)
  To: cocci

The error is generated at parsing_cocci/get_constants2.ml but in several
places within that file. How are virtual rules represented in parsing_cocci/
ast_cocci.ml?

Iago

On Wed, Jun 1, 2016 at 4:54 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:

>
>
> On Wed, 1 Jun 2016, Iago Abal wrote:
>
> > That would help, where do you check virtual rules?
>
> To my recollection, they are just checked on the interpretation of
> relevant depends ons.  But they could easily be checked for at the time of
> generating the message.
>
> julia
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20160601/d896bea3/attachment-0001.html>

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

* [Cocci] Linux scripts/coccinelle/locks/double_lock.cocci not working ?
  2016-06-01 15:00           ` Iago Abal
@ 2016-06-01 15:21             ` Julia Lawall
  2016-06-01 15:51               ` Iago Abal
  0 siblings, 1 reply; 12+ messages in thread
From: Julia Lawall @ 2016-06-01 15:21 UTC (permalink / raw)
  To: cocci



On Wed, 1 Jun 2016, Iago Abal wrote:

> The error is generated at parsing_cocci/get_constants2.ml but in several
> places within that file. How are virtual rules represented in
> parsing_cocci/ast_cocci.ml?

There is just !Flags.defined_virtual_rules in the directory globals.

Afterwards, they are just simplified away in the parsing process
(parse_cocci.ml, function eval_depend).  They aren't explicitly
represented in the AST.

julia

>
> Iago
>
> On Wed, Jun 1, 2016 at 4:54 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
>       On Wed, 1 Jun 2016, Iago Abal wrote:
>
>       > That would help, where do you check virtual rules?
>
>       To my recollection, they are just checked on the interpretation
>       of
>       relevant depends ons.? But they could easily be checked for at
>       the time of
>       generating the message.
>
>       julia
>
>
>
>
>

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

* [Cocci] Linux scripts/coccinelle/locks/double_lock.cocci not working ?
  2016-06-01 15:21             ` Julia Lawall
@ 2016-06-01 15:51               ` Iago Abal
  2016-06-01 15:54                 ` Julia Lawall
                                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Iago Abal @ 2016-06-01 15:51 UTC (permalink / raw)
  To: cocci

What about adding a warning in parse_cocci.eval_virt ?

if not (List.is_empty virt) && List.is_empty !Flag.defined_virtual_rules
then <warning>

Iago

On Wed, Jun 1, 2016 at 5:21 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:

>
>
> On Wed, 1 Jun 2016, Iago Abal wrote:
>
> > The error is generated at parsing_cocci/get_constants2.ml but in several
> > places within that file. How are virtual rules represented in
> > parsing_cocci/ast_cocci.ml?
>
> There is just !Flags.defined_virtual_rules in the directory globals.
>
> Afterwards, they are just simplified away in the parsing process
> (parse_cocci.ml, function eval_depend).  They aren't explicitly
> represented in the AST.
>
> julia
>
> >
> > Iago
> >
> > On Wed, Jun 1, 2016 at 4:54 PM, Julia Lawall <julia.lawall@lip6.fr>
> wrote:
> >
> >
> >       On Wed, 1 Jun 2016, Iago Abal wrote:
> >
> >       > That would help, where do you check virtual rules?
> >
> >       To my recollection, they are just checked on the interpretation
> >       of
> >       relevant depends ons.  But they could easily be checked for at
> >       the time of
> >       generating the message.
> >
> >       julia
> >
> >
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20160601/6938075b/attachment.html>

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

* [Cocci] Linux scripts/coccinelle/locks/double_lock.cocci not working ?
  2016-06-01 15:51               ` Iago Abal
@ 2016-06-01 15:54                 ` Julia Lawall
  2016-06-01 16:07                 ` Julia Lawall
  2016-06-01 16:49                 ` Julia Lawall
  2 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2016-06-01 15:54 UTC (permalink / raw)
  To: cocci



On Wed, 1 Jun 2016, Iago Abal wrote:

> What about adding a warning in parse_cocci.eval_virt ?
>
> if not (List.is_empty virt) && List.is_empty !Flag.defined_virtual_rules
> then <warning>

OK, thanks for the suggestion.

julia

>
> Iago
>
> On Wed, Jun 1, 2016 at 5:21 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
>       On Wed, 1 Jun 2016, Iago Abal wrote:
>
>       > The error is generated at parsing_cocci/get_constants2.ml but
>       in several
>       > places within that file. How are virtual rules represented in
>       > parsing_cocci/ast_cocci.ml?
>
>       There is just !Flags.defined_virtual_rules in the directory
>       globals.
>
>       Afterwards, they are just simplified away in the parsing process
>       (parse_cocci.ml, function eval_depend).? They aren't explicitly
>       represented in the AST.
>
>       julia
>
>       >
>       > Iago
>       >
>       > On Wed, Jun 1, 2016 at 4:54 PM, Julia Lawall
>       <julia.lawall@lip6.fr> wrote:
>       >
>       >
>       >? ? ? ?On Wed, 1 Jun 2016, Iago Abal wrote:
>       >
>       >? ? ? ?> That would help, where do you check virtual rules?
>       >
>       >? ? ? ?To my recollection, they are just checked on the
>       interpretation
>       >? ? ? ?of
>       >? ? ? ?relevant depends ons.? But they could easily be checked
>       for at
>       >? ? ? ?the time of
>       >? ? ? ?generating the message.
>       >
>       >? ? ? ?julia
>       >
>       >
>       >
>       >
>       >
>
>
>
>

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

* [Cocci] Linux scripts/coccinelle/locks/double_lock.cocci not working ?
  2016-06-01 15:51               ` Iago Abal
  2016-06-01 15:54                 ` Julia Lawall
@ 2016-06-01 16:07                 ` Julia Lawall
  2016-06-01 16:49                 ` Julia Lawall
  2 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2016-06-01 16:07 UTC (permalink / raw)
  To: cocci



On Wed, 1 Jun 2016, Iago Abal wrote:

> What about adding a warning in parse_cocci.eval_virt ?
>
> if not (List.is_empty virt) && List.is_empty !Flag.defined_virtual_rules
> then <warning>

Actually, it's complex.  Eval_virt doesn't have all the information.  A
common scenario is when you do iteration.  Then you can have some rules
that depend on a virtual rule that is added in the iteration call.  But
the iteration call is ocaml or python code.  The Coccinelle parser
doesn't know what that code contains.

It seems easier to just point the user to the fact that none of the
virtual rules are defined, if a failure occurs.

julia

>
> Iago
>
> On Wed, Jun 1, 2016 at 5:21 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
>       On Wed, 1 Jun 2016, Iago Abal wrote:
>
>       > The error is generated at parsing_cocci/get_constants2.ml but
>       in several
>       > places within that file. How are virtual rules represented in
>       > parsing_cocci/ast_cocci.ml?
>
>       There is just !Flags.defined_virtual_rules in the directory
>       globals.
>
>       Afterwards, they are just simplified away in the parsing process
>       (parse_cocci.ml, function eval_depend).? They aren't explicitly
>       represented in the AST.
>
>       julia
>
>       >
>       > Iago
>       >
>       > On Wed, Jun 1, 2016 at 4:54 PM, Julia Lawall
>       <julia.lawall@lip6.fr> wrote:
>       >
>       >
>       >? ? ? ?On Wed, 1 Jun 2016, Iago Abal wrote:
>       >
>       >? ? ? ?> That would help, where do you check virtual rules?
>       >
>       >? ? ? ?To my recollection, they are just checked on the
>       interpretation
>       >? ? ? ?of
>       >? ? ? ?relevant depends ons.? But they could easily be checked
>       for at
>       >? ? ? ?the time of
>       >? ? ? ?generating the message.
>       >
>       >? ? ? ?julia
>       >
>       >
>       >
>       >
>       >
>
>
>
>

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

* [Cocci] Linux scripts/coccinelle/locks/double_lock.cocci not working ?
  2016-06-01 15:51               ` Iago Abal
  2016-06-01 15:54                 ` Julia Lawall
  2016-06-01 16:07                 ` Julia Lawall
@ 2016-06-01 16:49                 ` Julia Lawall
  2 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2016-06-01 16:49 UTC (permalink / raw)
  To: cocci



On Wed, 1 Jun 2016, Iago Abal wrote:

> What about adding a warning in parse_cocci.eval_virt ?
>
> if not (List.is_empty virt) && List.is_empty !Flag.defined_virtual_rules
> then <warning>

I've updated github so that it generates an error message that mentions
one of the virtual rule names as an example, if any are declared.

julia

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

end of thread, other threads:[~2016-06-01 16:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-30 16:52 [Cocci] Linux scripts/coccinelle/locks/double_lock.cocci not working ? Iago Abal
2016-05-31  9:34 ` Julia Lawall
2016-06-01 13:31   ` Iago Abal
2016-06-01 13:39     ` Julia Lawall
2016-06-01 14:50       ` Iago Abal
2016-06-01 14:54         ` Julia Lawall
2016-06-01 15:00           ` Iago Abal
2016-06-01 15:21             ` Julia Lawall
2016-06-01 15:51               ` Iago Abal
2016-06-01 15:54                 ` Julia Lawall
2016-06-01 16:07                 ` Julia Lawall
2016-06-01 16:49                 ` Julia Lawall

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.