mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Christian Kujau <lists@nerdbynature.de>
Cc: Andi Kleen <andi@firstfloor.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: smatch 1.53 released
Date: Tue, 16 Jun 2009 16:54:15 +0200	[thread overview]
Message-ID: <a63d67fe0906160754ub38679ag9493d5090a9ca0c0@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.01.0906082208430.6439@bogon>

On 6/9/09, Christian Kujau <lists@nerdbynature.de> wrote:
> On Thu, 4 Jun 2009, Dan Carpenter wrote:
>>> Smatch is a source code checker for C.  Right now the focus is on
>>> checking
>>> for kernel bugs.
>
> Hm, smatch is pretty noisy. I'm getting hundreds of warnings and errors on
> a randconfig build: http://nerdbynature.de/bits/smatch/
>
> False positives or real issues?
>

If it´s not in drivers/ it´s a false positive.  Otherwise there is a
95% chance it is a false positive.  In an ideal world there would be
no bugs and no false positives.  But it´s easier to fix the bugs
smatch reports than to fix smatch so probably eventually it will be
100% false positives.

Quite a lot of the time, I don´t know the code well enough to say
whether a bug is a false positive or not.  Check the bits that you
care about.  The smatch output format is designed for vim.  "vim
filename.c +lineno"

If there was some way to get rid of the "field" messages that would
reduce the false positive count by 20.
kernel/trace/trace_functions_graph.c +808 print_graph_function(14)
error: dereferencing undefined:  'field'
I don´t see a heuristic to do that.

The rest are smatch bugs.  Code like:
foo->bar = NULL;
foo = frob();
foo->bar->baz = x;  // smatch thinks this is a bug since foo->bar was
set to NULL.

Sometimes running smatch with the --debug option can help to find
where smatch gets it wrong.  kchecker also takes the --debug option.

regards,
dan carpenter

> Thanks,
> Christian.
> --
> BOFH excuse #182:
>
> endothermal recalibration
>

      reply	other threads:[~2009-06-16 14:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-02  8:41 Dan Carpenter
2009-06-02 11:56 ` Andi Kleen
2009-06-04 19:50   ` Dan Carpenter
2009-06-04 20:10     ` Andi Kleen
2009-06-05 13:52       ` Dan Carpenter
2009-06-09  6:15     ` Christian Kujau
2009-06-16 14:54       ` Dan Carpenter [this message]

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=a63d67fe0906160754ub38679ag9493d5090a9ca0c0@mail.gmail.com \
    --to=error27@gmail.com \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lists@nerdbynature.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®