lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 10 Aug 2018 16:28:58 +0200 (CEST)
From:   Julia Lawall <julia.lawall@...6.fr>
To:     Denis Efremov <efremov@...ux.com>
cc:     Masahiro Yamada <yamada.masahiro@...ionext.com>,
        "Luis R . Rodriguez" <mcgrof@...nel.org>,
        Nicolas Palix <nicolas.palix@...g.fr>,
        Gilles Muller <Gilles.Muller@...6.fr>,
        Michal Marek <michal.lkml@...kovi.net>,
        linux-kernel@...r.kernel.org, ldv-project@...uxtesting.org
Subject: Re: [PATCH] coccicheck: return proper error code on check fail



On Fri, 10 Aug 2018, Denis Efremov wrote:

> > Do you mean that there is an error in the behavior of coccicheck or that coccicheck finds an error in the source code?
>
> An error in the source code.
>
> Here is an example of how the patch changes the behavior of 'make
> coccicheck' (my comments after the ###):
> Current behavior:
> $ make M=mymodule coccicheck
> mymodule/file1.c:97:4-14: ERROR: Assignment of bool to non-0/1 constant
> mymodule/file2.c:104:4-19: ERROR: Assignment of bool to non-0/1 constant
> mymodule/file2.c:577:1-15: code aligned with following code on line 583
> mymodule/file3.c:439:5-10: Unneeded variable: "error". Return "0" on line 449
> mymodule/file4.c:451:5-7: Unneeded variable: "rc". Return "0" on line 455
> mymodule/file5.c:433:5-8: Unneeded variable: "ret". Return "0" on line 607
> mymodule/file6.c:433:5-10: Unneeded variable: "error". Return "0" on line 440
> mymodule/file7.c:774:2-3: Unneeded semicolon
> coccicheck failed     ### <-- Check failed

Are you sure that this coccicheck failed has any connection to the various
messages printed above it?  Normally Coccinelle has no idea about the
semantics of messages printed using python script code.  I'm not sure what
would cause it to return an error code because a particular script was
activated.

julia

> $ echo $?
> 0 ### <-- But error code signals that everthing is OK
>
> After this patch:
> $ make M=mymodule coccicheck
> ...
> coccicheck failed
> make: *** [Makefile:1636: coccicheck] Error 2
> $ echo $?
> 2 ### <-- The patch changes error code
>
> Why does this matter?
> 1) Because it's clear from the source code that the original intention
> was to return an error code of checking command, not the "echo
> 'coccicheck failed'" command.
> 2) Automated testing systems (CI, for example) rely on the return code.
>

Powered by blists - more mailing lists