All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: Lourdes Pedrajas <lu@pplo.net>, outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] Trying to use Coccinelle
Date: Mon, 16 Mar 2020 15:44:05 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.2003161543170.5216@hadrien> (raw)
In-Reply-To: <20200316153629.0fde04f8@elisabeth>



On Mon, 16 Mar 2020, Stefano Brivio wrote:

> On Mon, 16 Mar 2020 15:27:38 +0100 (CET)
> Julia Lawall <julia.lawall@inria.fr> wrote:
>
> > On Mon, 16 Mar 2020, Stefano Brivio wrote:
> >
> > > On Fri, 13 Mar 2020 10:40:46 +0100
> > > Lourdes Pedrajas <lu@pplo.net> wrote:
> > >
> > > > [...]
> > > >
> > > > Indeed, this is all the output: (this command is run in the sources root
> > > > directory)
> > > >
> > > > make coccicheck MODE=patch J=8 M=drivers/staging/android/
> > > >
> > > > Please check for false positives in the output before submitting a patch.
> > > > When using "patch" mode, carefully review the patch before submitting it.
> > > >
> > > > coccicheck failed
> > > > Makefile:1740: recipe for target 'coccicheck' failed
> > > > make: *** [coccicheck] Error 255
> > >
> > > Hah, I think I got the same issue on Debian. I installed coccinelle via
> > > opam, then:
> > >
> > > ---
> > > $ make coccicheck MODE=report M=drivers/staging/android/
> > >
> > > Please check for false positives in the output before submitting a patch.
> > > When using "patch" mode, carefully review the patch before submitting it.
> > >
> > > coccicheck failed
> > > make: *** [Makefile:1740: coccicheck] Error 255
> > > ---
> > >
> > > Debugging: looking at makefiles, I thought about using V=1:
> > >
> > > ---
> > > $ make V=1 coccicheck MODE=report M=drivers/staging/android/
> > > bash ./scripts/coccicheck
> > >
> > > Please check for false positives in the output before submitting a patch.
> > > When using "patch" mode, carefully review the patch before submitting it.
> > >
> > > Processing alloc_cast.cocci
> > > with option(s) " --no-includes --include-headers"
> > >
> > > Message example to submit a patch:
> > >  Remove casting the values returned by memory allocation functions
> > >  like kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc.
> > >
> > >  The semantic patch that makes this report is available
> > >  in scripts/coccinelle/api/alloc/alloc_cast.cocci.
> > >
> > >  More information about semantic patching is available at
> > >  http://coccinelle.lip6.fr/
> > >
> > > Semantic patch information:
> > >  This makes an effort to find cases of casting of values returned by
> > >  kmalloc, kzalloc, kcalloc, kmem_cache_alloc, kmem_cache_zalloc,
> > >  kmem_cache_alloc_node, kmalloc_node and kzalloc_node and removes
> > >  the casting as it is not required. The result in the patch case may
> > >  need some reformatting.
> > >
> > > Running (4 in parallel): /home/sbrivio/.opam/default/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/alloc/alloc_cast.cocci --no-includes --include-headers --patch . --dir drivers/staging/android/ -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 4 --chunksize 1
> > > coccicheck failed
> > > make: *** [Makefile:1740: coccicheck] Error 255
> > > ---
> > >
> > > so, yeah, spatch fails, but no error (see below) isn't propagated (even
> > > with V=1)
> > >
> > > Julia, do you think it's worth trying to fix this? Any quick idea?
> >
> > I will try to find the problem.  I think there is a way to get debug
> > information.
>
> One idea might be, in run_cmd_parmap(), to avoid redirecting stderr
> here:
> 	        $@ 2>>$DEBUG_FILE
>
> if DEBUG_FILE is not set (that is, it's /dev/null) and we detect V=1 --
> otherwise, spatch output is thrown away.
>
> That works for me, but I'm not sure how elegant you would consider that.

Actually, I was just going to try to fix the semantic patch that caused
the problem.  I don't really maintain make coccicheck, but I will suggest
it to the person who does.  Thanks.

julia


  reply	other threads:[~2020-03-16 14:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 18:11 Trying to use Coccinelle Lourdes Pedrajas
2020-03-11 23:23 ` [Outreachy kernel] " Stefano Brivio
2020-03-13  9:40   ` Lourdes Pedrajas
2020-03-16 14:08     ` Stefano Brivio
2020-03-16 14:27       ` Julia Lawall
2020-03-16 14:36         ` Stefano Brivio
2020-03-16 14:44           ` Julia Lawall [this message]
2020-03-16 15:23             ` Stefano Brivio
2020-03-16 15:32               ` Julia Lawall
2020-03-16 15:44                 ` Stefano Brivio
2020-03-19 20:15                   ` Lourdes Pedrajas
2020-03-19 20:25                     ` Julia Lawall
2020-03-19 20:43                     ` Stefano Brivio
2020-03-19 21:30                       ` Lourdes Pedrajas
2020-03-19 21:38                         ` Julia Lawall
2020-03-19 21:47                           ` Lourdes Pedrajas
2020-03-19 21:50                             ` Julia Lawall
2020-03-19 22:06                               ` Lourdes Pedrajas
2020-03-23  0:00                                 ` Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.2003161543170.5216@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=lu@pplo.net \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.