All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] Coccinelle issues with Linux kernel 4.8-rc1
@ 2016-08-18  0:34 Chegondi, Harish
  2016-08-18  2:32 ` Julia Lawall
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Chegondi, Harish @ 2016-08-18  0:34 UTC (permalink / raw)
  To: cocci

Hello,

With the 4.8-rc1 kernel, when I run Coccinelle check using the command "make coccicheck MODE=report M=<path to directory>", I get "coccicheck failed" message. I get the same failure message even with "MODE=patch" in the command. I didn't see this error message with 4.7 kernel.

However, with the 4.8-rc1 kernel, if I turn off parallelization with J=1 option, I don't see the error message. The check seem to be running successfully, even though it takes longer to run. I tried J=2, J=4,...  and I got error messages. So there seem to be a problem with J not equal to 1.

Below I have mentioned the spatch version and ocaml version.

-bash-4.2$ spatch --version
spatch version 1.0.4 with Python support and with PCRE support

-bash-4.2$ ocaml
        OCaml version 4.02.3



Can you please let me know how can I resolve the "coccicheck failed" message?

Thank You
Harish.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20160818/32dfe62f/attachment.html>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Cocci] Coccinelle issues with Linux kernel 4.8-rc1
  2016-08-18  0:34 [Cocci] Coccinelle issues with Linux kernel 4.8-rc1 Chegondi, Harish
@ 2016-08-18  2:32 ` Julia Lawall
  2016-08-26  0:44   ` Chegondi, Harish
  2016-08-18  2:37 ` Julia Lawall
  2016-08-18  7:06 ` [Cocci] “coccicheck failed” during parallel program runs SF Markus Elfring
  2 siblings, 1 reply; 10+ messages in thread
From: Julia Lawall @ 2016-08-18  2:32 UTC (permalink / raw)
  To: cocci



On Thu, 18 Aug 2016, Chegondi, Harish wrote:

>
> Hello,
>
> ?
>
> With the 4.8-rc1 kernel, when I run Coccinelle check using the command ?make
> coccicheck MODE=report M=<path to directory>?, I get ?coccicheck failed?
> message. I get the same failure message even with ?MODE=patch? in the
> command. I didn?t see this error message with 4.7 kernel.
>
> ?
>
> However, with the 4.8-rc1 kernel, if I turn off parallelization with J=1
> option, I don?t see the error message. The check seem to be running
> successfully, even though it takes longer to run. I tried J=2, J=4,?? and I
> got error messages. So there seem to be a problem with J not equal to 1.

OK, I think it is related to the treatment of standard output and standard
error.  I think that standard error is simply discarded with J=1.  Could
you try giving the argument --very-quiet to Coccinelle with J > 1?

thanks,
julia


>
> ?
>
> Below I have mentioned the spatch version and ocaml version.
>
> ?
>
> -bash-4.2$ spatch --version
>
> spatch version 1.0.4 with Python support and with PCRE support
>
> ?
>
> -bash-4.2$ ocaml
>
> ??????? OCaml version 4.02.3
>
> ?
>
> ?
>
> ?
>
> Can you please let me know how can I resolve the ?coccicheck failed?
> message?
>
> ?
>
> Thank You
>
> Harish.
>
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Cocci] Coccinelle issues with Linux kernel 4.8-rc1
  2016-08-18  0:34 [Cocci] Coccinelle issues with Linux kernel 4.8-rc1 Chegondi, Harish
  2016-08-18  2:32 ` Julia Lawall
@ 2016-08-18  2:37 ` Julia Lawall
  2016-08-18  7:06 ` [Cocci] “coccicheck failed” during parallel program runs SF Markus Elfring
  2 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2016-08-18  2:37 UTC (permalink / raw)
  To: cocci



On Thu, 18 Aug 2016, Chegondi, Harish wrote:

>
> Hello,
>
> ?
>
> With the 4.8-rc1 kernel, when I run Coccinelle check using the command ?make
> coccicheck MODE=report M=<path to directory>?, I get ?coccicheck failed?
> message. I get the same failure message even with ?MODE=patch? in the
> command. I didn?t see this error message with 4.7 kernel.
>
> ?
>
> However, with the 4.8-rc1 kernel, if I turn off parallelization with J=1
> option, I don?t see the error message. The check seem to be running
> successfully, even though it takes longer to run. I tried J=2, J=4,?? and I
> got error messages. So there seem to be a problem with J not equal to 1.

Concretely, this seems to be how to give extra arguments to Coccinelle:

# You can use SPFLAGS to append extra arguments to coccicheck or override any
# heuristics done in this file as Coccinelle accepts the last options when
# options conflict.

julia


>
> ?
>
> Below I have mentioned the spatch version and ocaml version.
>
> ?
>
> -bash-4.2$ spatch --version
>
> spatch version 1.0.4 with Python support and with PCRE support
>
> ?
>
> -bash-4.2$ ocaml
>
> ??????? OCaml version 4.02.3
>
> ?
>
> ?
>
> ?
>
> Can you please let me know how can I resolve the ?coccicheck failed?
> message?
>
> ?
>
> Thank You
>
> Harish.
>
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Cocci] “coccicheck failed” during parallel program runs
  2016-08-18  0:34 [Cocci] Coccinelle issues with Linux kernel 4.8-rc1 Chegondi, Harish
  2016-08-18  2:32 ` Julia Lawall
  2016-08-18  2:37 ` Julia Lawall
@ 2016-08-18  7:06 ` SF Markus Elfring
  2016-08-18  9:00   ` Julia Lawall
  2 siblings, 1 reply; 10+ messages in thread
From: SF Markus Elfring @ 2016-08-18  7:06 UTC (permalink / raw)
  To: cocci

> With the 4.8-rc1 kernel, when I run Coccinelle check using the command ?make coccicheck MODE=report M=<path to directory>?,
> I get ?coccicheck failed? message. I get the same failure message even with ?MODE=patch?
> in the command.

I noticed this error message also.

There are further software possibilities.


> I didn?t see this error message with 4.7 kernel.

I guess that a change like "enable parmap support" (from 2016-07-22) will be relevant
for further considerations here.
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/scripts/coccicheck


> However, with the 4.8-rc1 kernel, if I turn off parallelization with J=1 option,
> I don?t see the error message. The check seem to be running successfully,
> even though it takes longer to run. I tried J=2, J=4,?  and I got error messages.
> So there seem to be a problem with J not equal to 1.

I imagine that the Coccinelle software can occasionally return inappropriate
status codes for its program implementations.
https://github.com/coccinelle/coccinelle/blob/958fcf8df0bd0e464a490b86e4f78ad4daf082d1/main.ml#L1517


> Can you please let me know how can I resolve the ?coccicheck failed? message?

* Would you like to try any related command variants out for a moment?

* How do you think about to help with any more software development resources?

Regards,
Markus

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Cocci] “coccicheck failed” during parallel program runs
  2016-08-18  7:06 ` [Cocci] “coccicheck failed” during parallel program runs SF Markus Elfring
@ 2016-08-18  9:00   ` Julia Lawall
  2016-08-18 11:34     ` SF Markus Elfring
  0 siblings, 1 reply; 10+ messages in thread
From: Julia Lawall @ 2016-08-18  9:00 UTC (permalink / raw)
  To: cocci

It seems that make coccicheck interprets anything being written on
standard error as a fatal error.  This seems like a strange point of view,
as Coccinelle needs somewhere to print warnings that the user may also
find useful.  But I have changed Coccinelle such that it prints this
particular warning in a different way that will cause it to disappear when
the option --very-quiet is used.  You can find the solution in the latest
commit on github.

thanks,
julia

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Cocci] “coccicheck failed” during parallel program runs
  2016-08-18  9:00   ` Julia Lawall
@ 2016-08-18 11:34     ` SF Markus Elfring
  2016-08-18 12:26       ` Julia Lawall
  0 siblings, 1 reply; 10+ messages in thread
From: SF Markus Elfring @ 2016-08-18 11:34 UTC (permalink / raw)
  To: cocci

> It seems that make coccicheck interprets anything being written on
> standard error as a fatal error.

How do you come to this conclusion?


> This seems like a strange point of view,

I would agree ?


> as Coccinelle needs somewhere to print warnings that the user may also
> find useful.

This is usually fine.

But I am more concerned about the safe handling for the program exit status.


Excerpt from scripts/coccicheck:
?
run_cmd_parmap() {
?
	$@ 2>$DEBUG_FILE
	if [[ $? -ne 0 ]]; then
		echo "coccicheck failed"
		exit $?
	fi
}
?


Would you like to take another look at the returned exit code?


> But I have changed Coccinelle such that it prints this particular warning

Will the message reformatting around the information "? with comm_assoc iso"
be really sufficient?



> in a different way that will cause it to disappear when
> the option --very-quiet is used.

Thanks for another bit of fine-tuning in your software.

Regards,
Markus

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Cocci] “coccicheck failed” during parallel program runs
  2016-08-18 11:34     ` SF Markus Elfring
@ 2016-08-18 12:26       ` Julia Lawall
  2016-08-18 13:13         ` SF Markus Elfring
  0 siblings, 1 reply; 10+ messages in thread
From: Julia Lawall @ 2016-08-18 12:26 UTC (permalink / raw)
  To: cocci



On Thu, 18 Aug 2016, SF Markus Elfring wrote:

> > It seems that make coccicheck interprets anything being written on
> > standard error as a fatal error.
>
> How do you come to this conclusion?

Because the message in question used to be sent to standard output, for
many years, and no one was complaining.

> > This seems like a strange point of view,
>
> I would agree ?
>
>
> > as Coccinelle needs somewhere to print warnings that the user may also
> > find useful.
>
> This is usually fine.
>
> But I am more concerned about the safe handling for the program exit status.
>
>
> Excerpt from scripts/coccicheck:
> ?
> run_cmd_parmap() {
> ?
> 	$@ 2>$DEBUG_FILE
> 	if [[ $? -ne 0 ]]; then
> 		echo "coccicheck failed"
> 		exit $?
> 	fi
> }
> ?

I don't see why printing a warning message to stderr would change the
return code only in the parallel case.

>
>
> Would you like to take another look at the returned exit code?
>
>
> > But I have changed Coccinelle such that it prints this particular warning
>
> Will the message reformatting around the information "? with comm_assoc iso"
> be really sufficient?

There is more information that is printed to standard output.  It should
go to standard error also, but this is not likely to be what is causing
the problem, and for technical reasons, it is not a competely trivial
change.

julia

>
>
> > in a different way that will cause it to disappear when
> > the option --very-quiet is used.
>
> Thanks for another bit of fine-tuning in your software.
>
> Regards,
> Markus
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Cocci] “coccicheck failed” during parallel program runs
  2016-08-18 12:26       ` Julia Lawall
@ 2016-08-18 13:13         ` SF Markus Elfring
  0 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2016-08-18 13:13 UTC (permalink / raw)
  To: cocci

>>> It seems that make coccicheck interprets anything being written on
>>> standard error as a fatal error.
>>
>> How do you come to this conclusion?
> 
> Because the message in question used to be sent to standard output,
> for many years, and no one was complaining.

Is it interesting to look on circumstances and why it was tolerated?

Did the expectations evolve a bit more for this software in the meantime?


> I don't see why printing a warning message to stderr would change the
> return code only in the parallel case.

I would also wonder about such a side effect.

Can a failed call of a function like "printf" in the OCaml source code
result in a questionable return value which will become the discussed
program exit status?


By the way:
This observation depends on the result from the following statements.

?
SPATCH="`which ${SPATCH:=spatch}`"
?
$SPATCH --help | grep "\-\-jobs" > /dev/null && USE_JOBS="yes"
?


Would an approach like the following help here?


Update candidate "scripts/coccicheck":
?
run_cmd_parmap() {
?
	$@ 2>$DEBUG_FILE
	if [[ $? -ne 0 ]]; then
		COMMAND_RESULT=$?
		echo "coccicheck failed"
		exit $COMMAND_RESULT
	fi
}
?

Regards,
Markus

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Cocci] Coccinelle issues with Linux kernel 4.8-rc1
  2016-08-18  2:32 ` Julia Lawall
@ 2016-08-26  0:44   ` Chegondi, Harish
  2016-08-26  0:54     ` Julia Lawall
  0 siblings, 1 reply; 10+ messages in thread
From: Chegondi, Harish @ 2016-08-26  0:44 UTC (permalink / raw)
  To: cocci

Hi Julia,

When I turned on the verbose mode, I see that "--very-quiet" argument is already being passed to spatch. I tried to find more debug information by turning on the verbose mode. What I found is that not all .cocci files are causing the ?coccicheck failed? error. In verbose mode, when I get the ?coccicheck failed? error, I took the command and ran it individually. I found that the spatch command for the following .cocci files resulted in fatal errors. I see that the fatal errors are of two types - "Directory <> used for temporary files already exists and should be removed." And "<>: No such file or directory." I am not sure what caused these fata errors for these .cocci files. But when I ran the below commands without the "--jobs 16 --chunksize 1" arguments, I didn't see the fatal errors. When I deleted the .cocci files mentioned in the commands below and ran coccicheck in report mode, I didn't see any ?coccicheck failed? errors. Can you please let me know if you have any ideas on why these fatal errors are showing up for these .cocci files?

Thank You
Harish.


-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/alloc/kzalloc-simple.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
2 files match
Fatal error: exception Failure("Directory kzalloc-simple used for temporary files already exists and should be removed.")

-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/alloc/pool_zalloc-simple.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
0 files match
Fatal error: exception Sys_error("pool_zalloc-simple: No such file or directory")

-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/d_find_alias.cocci --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
0 files match
Fatal error: exception Sys_error("d_find_alias: No such file or directory")

-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci --no-includes --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
0 files match
Fatal error: exception Sys_error("debugfs_simple_attr: No such file or directory")

-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/memdup.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
0 files match
Fatal error: exception Sys_error("memdup: No such file or directory")

-bash-4.2$  /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/platform_no_drv_owner.cocci --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
0 files match
Fatal error: exception Sys_error("platform_no_drv_owner: No such file or directory")

-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/pm_runtime.cocci --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
0 files match
Fatal error: exception Sys_error("pm_runtime: No such file or directory")

-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/setup_timer.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
0 files match
Fatal error: exception Sys_error("setup_timer: No such file or directory")

-bash-4.2$  /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/free/clk_put.cocci --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
0 files match
Fatal error: exception Sys_error("clk_put: No such file or directory")

-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/free/devm_free.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
0 files match
Fatal error: exception Sys_error("devm_free: No such file or directory")

-bash-4.2$  /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/iterators/device_node_continue.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
0 files match
Fatal error: exception Sys_error("device_node_continue: No such file or directory")

-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/iterators/list_entry_update.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
4 files match
Fatal error: exception Failure("Directory list_entry_update used for temporary files already exists and should be removed.")

-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/misc/badty.cocci --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
25 files match
Fatal error: exception Failure("Directory badty used for temporary files already exists and should be removed.")

-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/misc/boolreturn.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
13 files match
Fatal error: exception Failure("Directory boolreturn used for temporary files already exists and should be removed.")

-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/misc/bugon.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
0 files match
Fatal error: exception Sys_error("bugon: No such file or directory")

-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/misc/cstptr.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
3 files match
Fatal error: exception Failure("Directory cstptr used for temporary files already exists and should be removed.")
-bash-4.2$ 

-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/misc/doubleinit.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
Fatal error: exception Failure("Directory doubleinit used for temporary files already exists and should be removed.")

-bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/misc/of_table.cocci --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
0 files match
Fatal error: exception Sys_error("of_table: No such file or directory")





-----Original Message-----
From: Julia Lawall [mailto:julia.lawall at lip6.fr] 
Sent: Wednesday, August 17, 2016 7:32 PM
To: Chegondi, Harish <harish.chegondi@intel.com>
Cc: 'cocci at systeme.lip6.fr' <cocci@systeme.lip6.fr>; Dalessandro, Dennis <dennis.dalessandro@intel.com>
Subject: Re: [Cocci] Coccinelle issues with Linux kernel 4.8-rc1



On Thu, 18 Aug 2016, Chegondi, Harish wrote:

>
> Hello,
>
> ?
>
> With the 4.8-rc1 kernel, when I run Coccinelle check using the command 
> ?make coccicheck MODE=report M=<path to directory>?, I get ?coccicheck failed?
> message. I get the same failure message even with ?MODE=patch? in the 
> command. I didn?t see this error message with 4.7 kernel.
>
> ?
>
> However, with the 4.8-rc1 kernel, if I turn off parallelization with 
> J=1 option, I don?t see the error message. The check seem to be 
> running successfully, even though it takes longer to run. I tried J=2, 
> J=4,?? and I got error messages. So there seem to be a problem with J not equal to 1.

OK, I think it is related to the treatment of standard output and standard error.  I think that standard error is simply discarded with J=1.  Could you try giving the argument --very-quiet to Coccinelle with J > 1?

thanks,
julia


>
> ?
>
> Below I have mentioned the spatch version and ocaml version.
>
> ?
>
> -bash-4.2$ spatch --version
>
> spatch version 1.0.4 with Python support and with PCRE support
>
> ?
>
> -bash-4.2$ ocaml
>
> ??????? OCaml version 4.02.3
>
> ?
>
> ?
>
> ?
>
> Can you please let me know how can I resolve the ?coccicheck failed?
> message?
>
> ?
>
> Thank You
>
> Harish.
>
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Cocci] Coccinelle issues with Linux kernel 4.8-rc1
  2016-08-26  0:44   ` Chegondi, Harish
@ 2016-08-26  0:54     ` Julia Lawall
  0 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2016-08-26  0:54 UTC (permalink / raw)
  To: cocci



On Fri, 26 Aug 2016, Chegondi, Harish wrote:

> Hi Julia,
>
> When I turned on the verbose mode, I see that "--very-quiet" argument is already being passed to spatch. I tried to find more debug information by turning on the verbose mode. What I found is that not all .cocci files are causing the ?coccicheck failed? error. In verbose mode, when I get the ?coccicheck failed? error, I took the command and ran it individually. I found that the spatch command for the following .cocci files resulted in fatal errors. I see that the fatal errors are of two types - "Directory <> used for temporary files already exists and should be removed." And "<>: No such file or directory." I am not sure what caused these fata errors for these .cocci files. But when I ran the below commands without the "--jobs 16 --chunksize 1" arguments, I didn't see the fatal errors. When I deleted the .cocci files mentioned in the commands below and ran coccicheck in report mode, I didn't see any ?coccicheck failed? errors. Can you please let me know if you !
 have any ideas on why these fatal errors are showing up for these .cocci files?

I think you are in an unpleasant state and should clean up and start over.
Look around and see if you have any directories that have the names of
semantic patches and remove them.

Otherwise, it looks like you are not running these commands from the root
of the kernel directory?  Because it is not finding any of the .cocci
files.

julia

>
> Thank You
> Harish.
>
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/alloc/kzalloc-simple.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 2 files match
> Fatal error: exception Failure("Directory kzalloc-simple used for temporary files already exists and should be removed.")
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/alloc/pool_zalloc-simple.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 0 files match
> Fatal error: exception Sys_error("pool_zalloc-simple: No such file or directory")
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/d_find_alias.cocci --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 0 files match
> Fatal error: exception Sys_error("d_find_alias: No such file or directory")
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci --no-includes --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 0 files match
> Fatal error: exception Sys_error("debugfs_simple_attr: No such file or directory")
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/memdup.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 0 files match
> Fatal error: exception Sys_error("memdup: No such file or directory")
>
> -bash-4.2$  /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/platform_no_drv_owner.cocci --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 0 files match
> Fatal error: exception Sys_error("platform_no_drv_owner: No such file or directory")
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/pm_runtime.cocci --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 0 files match
> Fatal error: exception Sys_error("pm_runtime: No such file or directory")
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/setup_timer.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 0 files match
> Fatal error: exception Sys_error("setup_timer: No such file or directory")
>
> -bash-4.2$  /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/free/clk_put.cocci --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 0 files match
> Fatal error: exception Sys_error("clk_put: No such file or directory")
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/free/devm_free.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 0 files match
> Fatal error: exception Sys_error("devm_free: No such file or directory")
>
> -bash-4.2$  /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/iterators/device_node_continue.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 0 files match
> Fatal error: exception Sys_error("device_node_continue: No such file or directory")
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/iterators/list_entry_update.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 4 files match
> Fatal error: exception Failure("Directory list_entry_update used for temporary files already exists and should be removed.")
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/misc/badty.cocci --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 25 files match
> Fatal error: exception Failure("Directory badty used for temporary files already exists and should be removed.")
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/misc/boolreturn.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 13 files match
> Fatal error: exception Failure("Directory boolreturn used for temporary files already exists and should be removed.")
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/misc/bugon.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 0 files match
> Fatal error: exception Sys_error("bugon: No such file or directory")
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/misc/cstptr.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 3 files match
> Fatal error: exception Failure("Directory cstptr used for temporary files already exists and should be removed.")
> -bash-4.2$
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/misc/doubleinit.cocci --no-includes --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> Fatal error: exception Failure("Directory doubleinit used for temporary files already exists and should be removed.")
>
> -bash-4.2$ /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/misc/of_table.cocci --include-headers --patch . --dir drivers/infiniband/hw/hfi1/ -I ./arch/x86/include -I ./arch/x86/include/generated/uapi -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 16 --chunksize 1
> 0 files match
> Fatal error: exception Sys_error("of_table: No such file or directory")
>
>
>
>
>
> -----Original Message-----
> From: Julia Lawall [mailto:julia.lawall at lip6.fr]
> Sent: Wednesday, August 17, 2016 7:32 PM
> To: Chegondi, Harish <harish.chegondi@intel.com>
> Cc: 'cocci at systeme.lip6.fr' <cocci@systeme.lip6.fr>; Dalessandro, Dennis <dennis.dalessandro@intel.com>
> Subject: Re: [Cocci] Coccinelle issues with Linux kernel 4.8-rc1
>
>
>
> On Thu, 18 Aug 2016, Chegondi, Harish wrote:
>
> >
> > Hello,
> >
> > ?
> >
> > With the 4.8-rc1 kernel, when I run Coccinelle check using the command
> > ?make coccicheck MODE=report M=<path to directory>?, I get ?coccicheck failed?
> > message. I get the same failure message even with ?MODE=patch? in the
> > command. I didn?t see this error message with 4.7 kernel.
> >
> > ?
> >
> > However, with the 4.8-rc1 kernel, if I turn off parallelization with
> > J=1 option, I don?t see the error message. The check seem to be
> > running successfully, even though it takes longer to run. I tried J=2,
> > J=4,?? and I got error messages. So there seem to be a problem with J not equal to 1.
>
> OK, I think it is related to the treatment of standard output and standard error.  I think that standard error is simply discarded with J=1.  Could you try giving the argument --very-quiet to Coccinelle with J > 1?
>
> thanks,
> julia
>
>
> >
> > ?
> >
> > Below I have mentioned the spatch version and ocaml version.
> >
> > ?
> >
> > -bash-4.2$ spatch --version
> >
> > spatch version 1.0.4 with Python support and with PCRE support
> >
> > ?
> >
> > -bash-4.2$ ocaml
> >
> > ??????? OCaml version 4.02.3
> >
> > ?
> >
> > ?
> >
> > ?
> >
> > Can you please let me know how can I resolve the ?coccicheck failed?
> > message?
> >
> > ?
> >
> > Thank You
> >
> > Harish.
> >
> >
> >
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-08-26  0:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-18  0:34 [Cocci] Coccinelle issues with Linux kernel 4.8-rc1 Chegondi, Harish
2016-08-18  2:32 ` Julia Lawall
2016-08-26  0:44   ` Chegondi, Harish
2016-08-26  0:54     ` Julia Lawall
2016-08-18  2:37 ` Julia Lawall
2016-08-18  7:06 ` [Cocci] “coccicheck failed” during parallel program runs SF Markus Elfring
2016-08-18  9:00   ` Julia Lawall
2016-08-18 11:34     ` SF Markus Elfring
2016-08-18 12:26       ` Julia Lawall
2016-08-18 13:13         ` SF Markus Elfring

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.