smatch output

Artem Bityutskiy dedekind1 at gmail.com
Thu Apr 24 15:41:38 PDT 2014


Hi Dan,

here is the problematic warning.


-kernel/cgroup.c:2269 cgroup_release_agent_write() warn: inconsistent returns mutex:&cgroup_mutex: locked (2235 [(-22)], 2237 [(-19)]) unlocked (2242 [0]) [smatch]
+kernel/cgroup.c:2269 cgroup_release_agent_write() warn: inconsistent returns mutex:&cgroup_mutex: locked (2262 [(-22)], 2264 [(-19)]) unlocked (2269 [0]) [smatch]

Basically, this is the same warning, it  present before patching the
kernel and after patching it. So aiaiai should not tell about it, but it
does, which is a problem I need to fix somehow.

As you see, the line number is amended by aiaiai (2269). However, you
include other line numbers, which aiaiai does not amend.

At the moment aiaiai amends line numbers like this:

1. Pattern: ^path/to/file.c:XXX.* - XXX number is amended
2. Pattern: .*line XXX.* - XXX number is corrected

And I think it now only amends the first occurrence of "line XXX", but
this could be changes.

Would you consider to prefix all line numbers you output with "line",
sot that you'd end up with:

(line 2235 [(-22)], line 2237 [(-19)]) unlocked (line 2242 [0]) [smatch]

instead?

On Tue, 2014-02-04 at 11:28 +0300, Dan Carpenter wrote:
> On Tue, Feb 04, 2014 at 08:59:14AM +0200, Artem Bityutskiy wrote:
> > Hi Dan,
> > 
> > we use smatch in the Aiaiai project. Just to remind, what we do is:
> > 
> > 1. Build the kernel with smatch (and other checkers too) before applying
> > the "patch-set under test". Collect full log, let's call it "log1".
> > 
> > 2. Apply the patch-set under test and do the same, collect full log
> > again, let's call it "log2".
> > 
> > Then we compare log2 and log2, and trying to show users only _new_
> > gcc/smatch/spatch/coccinelle/cppcheck warnings.
> > 
> > log1 and log2 may have different line numbers, and we are able to take
> > this into account when the format of the warning is like this:
> > 
> > path/to/the/file.c:XXX: blah blah (line YYY) blah blah
> > 
> > I.e., we look for the "^path:XXX:" and "line YYY" patterns. And we can
> > then look to the patch, and change XXX and YYY accordingly.
> > 
> > Then if the warning is in both log1 and log2, we won't tell about it.
> > Otherwise, we will complain.
> > 
> > Also, all the lines starting with the same file prefix and line number
> > are treated as one single block, i.e., one warning.
> > 
> > This worked for smatch in the past quite well. But recently I started
> > seeing that smatch may output multi-line warnings. E.g., take a look at
> > Aiaiai output here:
> > 
> > https://review.tizen.org/gerrit/#/c/15980/
> > 
> 
> I can't log into that.  But I think I know what you're talking about.
> It's not a multi-line warning, it's just one really long line.  I need
> to fix it though because it's ugly and confusing to everyone except
> me...
> 
> Can you send me a problematic warning message so I can confirm?
> 
> regards,
> dan carpenter
> 

-- 
Best Regards,
Artem Bityutskiy




More information about the aiaiai mailing list