smatch output

Dan Carpenter dan.carpenter at
Mon Apr 28 06:07:48 PDT 2014

On Thu, Apr 24, 2014 at 03:41:38PM -0700, Artem Bityutskiy wrote:
> 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?

I've been promising to fix this error message format for a while...
Part of the problem is that the warning is too long, and adding a bunch
of "line " words in the middle will just make it longer.

The other problem is that it's just confusing.  In your example the
-22 and -19 are the error return codes.  I don't think people understand

Maybe the warning should be:
kernel/cgroup.c:2269 cgroup_release_agent_write() warn: inconsistent returns mutex:&cgroup_mutex. Locked on line 2235, line 2237. Unlocked on line 2269.

A line number could appear as both locked and unlocked as well.

How do people like that format?

dan carpenter

More information about the aiaiai mailing list