Re: [Cocci] coccinelle issues

2020-06-14 Thread Mike Galbraith
P.S. > > warning: Can't find macro file: > > /usr/local/coccinelle/bin/../lib/coccinelle/standard.h > > warning: Can't find default iso file: > > /usr/local/coccinelle/bin/../lib/coccinelle/standard.iso The hard coded "lib" causing this issue lives in globals/config.ml.in. diff --git

[Cocci] [PATCH v3] coccinelle: api: add kzfree script

2020-06-14 Thread Denis Efremov
Check for memset()/memzero_explicit() followed by kfree()/vfree()/kvfree(). Signed-off-by: Denis Efremov --- Changes in v2: - memset_explicit() added - kvfree_sensitive() added - forall added to r1 - ... between memset and kfree added Changes in v3: - Explicit filter for definitions instead

Re: [Cocci] [PATCH] coccinelle: api: add kzfree script

2020-06-14 Thread Joe Perches
On Sun, 2020-06-14 at 22:42 +0300, Denis Efremov wrote: > On 6/4/20 7:27 PM, Joe Perches wrote: > > On Thu, 2020-06-04 at 17:08 +0300, Denis Efremov wrote: > > > Check for memset() with 0 followed by kfree(). > > > > Perhaps those uses should be memzero_explicit or kvfree_sensitive. > > > Is it

Re: [Cocci] [PATCH] coccinelle: api: add kzfree script

2020-06-14 Thread Denis Efremov
On 6/4/20 7:27 PM, Joe Perches wrote: > On Thu, 2020-06-04 at 17:08 +0300, Denis Efremov wrote: >> Check for memset() with 0 followed by kfree(). > > Perhaps those uses should be memzero_explicit or kvfree_sensitive. > Is it safe to suggest to use kzfree instead of memzero_explicit && kfree? Or

Re: [Cocci] coccinelle issues

2020-06-14 Thread Julia Lawall
On Sun, 14 Jun 2020, Mike Galbraith wrote: > On Sun, 2020-06-14 at 14:59 +0200, Julia Lawall wrote: > > > > On Sun, 14 Jun 2020, Mike Galbraith wrote: > > > > > On Sun, 2020-06-14 at 10:43 +0200, Julia Lawall wrote: > > > > > > > > What is your Linux distribution? > > > > > > openSUSE

[Cocci] [PATCH v2] coccinelle: api: add kvfree script

2020-06-14 Thread Denis Efremov
Check that alloc and free types of functions match each other. Signed-off-by: Denis Efremov --- Changes in v2: - Lines are limited to 80 characters where possible - Confidence changed from High to Medium because of fs/btrfs/send.c:1119 false-positive - __vmalloc_area_node() explicitly

Re: [Cocci] coccinelle issues

2020-06-14 Thread Mike Galbraith
On Sun, 2020-06-14 at 14:59 +0200, Julia Lawall wrote: > > On Sun, 14 Jun 2020, Mike Galbraith wrote: > > > On Sun, 2020-06-14 at 10:43 +0200, Julia Lawall wrote: > > > > > > What is your Linux distribution? > > > > openSUSE Leap-15.1 > > Our CI already has an entry for openSUSE Leap. We will

Re: [Cocci] coccinelle issues

2020-06-14 Thread Markus Elfring
> > Note2: https://github.com/coccinelle/coccinelle/blob/master/install.txt > > says that 'spatch' is a script, but it seems to be a binary executable file. > > Actually, it is a script, and the fact that you say it is a binary may be > the reason for your python problem. Normally there is a

Re: [Cocci] coccinelle issues

2020-06-14 Thread Julia Lawall
On Sun, 14 Jun 2020, Randy Dunlap wrote: > On 6/14/20 12:39 AM, Julia Lawall wrote: > > > > > > On Sat, 13 Jun 2020, Randy Dunlap wrote: > > > >> Hi, > >> > >> OK, I've not used Coccinelle and now I am trying to use it. > >> It seems that I am having a few issues. > >> The primary one is when

Re: [Cocci] coccinelle: api: add kvfree script

2020-06-14 Thread Markus Elfring
> … Looks like it's impossible to break "when" lines. Thus I became also curious on clarification for further software development possibilities around the safer application of code exclusion specifications by the means of the semantic patch language. Regards, Markus

Re: [Cocci] coccinelle issues

2020-06-14 Thread Randy Dunlap
On 6/14/20 12:39 AM, Julia Lawall wrote: > > > On Sat, 13 Jun 2020, Randy Dunlap wrote: > >> Hi, >> >> OK, I've not used Coccinelle and now I am trying to use it. >> It seems that I am having a few issues. >> The primary one is when I run spatch (via 'make coccicheck' in >> the kernel source

Re: [Cocci] coccinelle issues

2020-06-14 Thread Julia Lawall
On Sun, 14 Jun 2020, Mike Galbraith wrote: > On Sun, 2020-06-14 at 10:43 +0200, Julia Lawall wrote: > > > > What is your Linux distribution? > > openSUSE Leap-15.1 Our CI already has an entry for openSUSE Leap. We will look into it, but if you have any further information about the problem,

Re: [Cocci] [PATCH] coccinelle: api: add kvfree script

2020-06-14 Thread Denis Efremov
On 6/14/20 12:17 PM, Julia Lawall wrote: > > > On Sun, 14 Jun 2020, Denis Efremov wrote: > >> >> >> On 6/5/20 11:51 PM, Julia Lawall wrote: >>> Also, there is no need to exceed 80 characters here. You can put a >>> newline in the middle of a \( ... \) >> >> It's required. Looks like it's

Re: [Cocci] [PATCH] coccinelle: api: add kvfree script

2020-06-14 Thread Julia Lawall
On Sun, 14 Jun 2020, Denis Efremov wrote: > > > On 6/5/20 11:51 PM, Julia Lawall wrote: > > Also, there is no need to exceed 80 characters here. You can put a > > newline in the middle of a \( ... \) > > It's required. Looks like it's impossible to break "when" lines. That's true. Sorry for

Re: [Cocci] [PATCH] coccinelle: api: add kvfree script

2020-06-14 Thread Denis Efremov
On 6/5/20 11:51 PM, Julia Lawall wrote: > Also, there is no need to exceed 80 characters here. You can put a > newline in the middle of a \( ... \) It's required. Looks like it's impossible to break "when" lines. ... when != if (...) { ... E =

Re: [Cocci] coccinelle issues

2020-06-14 Thread Julia Lawall
On Sun, 14 Jun 2020, Mike Galbraith wrote: > On Sun, 2020-06-14 at 10:43 +0200, Julia Lawall wrote: > > > > What is your Linux distribution? > > openSUSE Leap-15.1 OK, this problem has occurred before. I think we should add openSUSE to our CI. Thanks for the report. julia

Re: [Cocci] coccinelle issues

2020-06-14 Thread Julia Lawall
On Sun, 14 Jun 2020, Mike Galbraith wrote: > On Sun, 2020-06-14 at 10:00 +0200, Mike Galbraith wrote: > > On Sun, 2020-06-14 at 09:57 +0200, Mike Galbraith wrote: > > > On Sun, 2020-06-14 at 09:42 +0200, Julia Lawall wrote: > > > > > > > > On Sun, 14 Jun 2020, Mike Galbraith wrote: > > > > > >

Re: [Cocci] coccinelle issues

2020-06-14 Thread Julia Lawall
On Sun, 14 Jun 2020, Mike Galbraith wrote: > On Sun, 2020-06-14 at 09:57 +0200, Mike Galbraith wrote: > > On Sun, 2020-06-14 at 09:42 +0200, Julia Lawall wrote: > > > > > > On Sun, 14 Jun 2020, Mike Galbraith wrote: > > > > > > > > > > I didn't download, rather pulled/built. I didn't have the

Re: [Cocci] coccinelle issues

2020-06-14 Thread Mike Galbraith
On Sun, 2020-06-14 at 10:43 +0200, Julia Lawall wrote: > > What is your Linux distribution? openSUSE Leap-15.1 ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci

Re: [Cocci] coccinelle issues

2020-06-14 Thread Julia Lawall
On Sun, 14 Jun 2020, Mike Galbraith wrote: > On Sun, 2020-06-14 at 09:42 +0200, Julia Lawall wrote: > > > > On Sun, 14 Jun 2020, Mike Galbraith wrote: > > > > > > > I didn't download, rather pulled/built. I didn't have the same issue > > > you did, but make coccicheck was a bust here until I

Re: [Cocci] coccinelle issues

2020-06-14 Thread Mike Galbraith
On Sun, 2020-06-14 at 10:00 +0200, Mike Galbraith wrote: > On Sun, 2020-06-14 at 09:57 +0200, Mike Galbraith wrote: > > On Sun, 2020-06-14 at 09:42 +0200, Julia Lawall wrote: > > > > > > On Sun, 14 Jun 2020, Mike Galbraith wrote: > > > > > > > > > > I didn't download, rather pulled/built. I

Re: [Cocci] coccinelle issues

2020-06-14 Thread Mike Galbraith
Aha, trying a fresh build/install of 1.0.7 reproduced Randy's problem.. /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/alloc/alloc_cast.cocci --no-includes --include-headers --dir . -I ./arch/x86/include -I ./arch/x86/include/generated -I

Re: [Cocci] coccinelle issues

2020-06-14 Thread Mike Galbraith
On Sun, 2020-06-14 at 09:57 +0200, Mike Galbraith wrote: > On Sun, 2020-06-14 at 09:42 +0200, Julia Lawall wrote: > > > > On Sun, 14 Jun 2020, Mike Galbraith wrote: > > > > > > > I didn't download, rather pulled/built. I didn't have the same issue > > > you did, but make coccicheck was a bust

Re: [Cocci] coccinelle issues

2020-06-14 Thread Mike Galbraith
On Sun, 2020-06-14 at 09:42 +0200, Julia Lawall wrote: > > On Sun, 14 Jun 2020, Mike Galbraith wrote: > > > > I didn't download, rather pulled/built. I didn't have the same issue > > you did, but make coccicheck was a bust here until I backed down to > > version 1.0.6. Neither HEAD, 1.0.8 or

Re: [Cocci] coccinelle issues

2020-06-14 Thread Julia Lawall
On Sun, 14 Jun 2020, Mike Galbraith wrote: > On Sat, 2020-06-13 at 21:07 -0700, Randy Dunlap wrote: > > Hi, > > > > OK, I've not used Coccinelle and now I am trying to use it. > > I've never used it either, or intend to really, but seeing that it > lives on github and more importantly, it's

Re: [Cocci] coccinelle issues

2020-06-14 Thread Julia Lawall
On Sat, 13 Jun 2020, Randy Dunlap wrote: > Hi, > > OK, I've not used Coccinelle and now I am trying to use it. > It seems that I am having a few issues. > The primary one is when I run spatch (via 'make coccicheck' in > the kernel source tree), it tells me: > > Python error: No module named

[Cocci] coccinelle issues

2020-06-14 Thread Randy Dunlap
Hi, OK, I've not used Coccinelle and now I am trying to use it. It seems that I am having a few issues. The primary one is when I run spatch (via 'make coccicheck' in the kernel source tree), it tells me: Python error: No module named coccilib.elems I do see "elems.py" in

Re: [Cocci] coccinelle issues

2020-06-14 Thread Mike Galbraith
On Sat, 2020-06-13 at 21:07 -0700, Randy Dunlap wrote: > Hi, > > OK, I've not used Coccinelle and now I am trying to use it. I've never used it either, or intend to really, but seeing that it lives on github and more importantly, it's raining outside > It seems that I am having a few