* [Cocci] Python Output Not Flushed With -j > 1
@ 2017-02-17 13:29 Michael Stefaniuc
2017-02-17 15:19 ` Thierry Martinez
0 siblings, 1 reply; 3+ messages in thread
From: Michael Stefaniuc @ 2017-02-17 13:29 UTC (permalink / raw)
To: cocci
Hello,
this is a follow up on the "[Cocci] coccilib.report.print_report Broken
For Redirected STDOUT".
But this not only affects coccilib.report.print_report but also the
normal print. I noticed this only when running my real script in my own
coccicheck implementation that automatically uses -j <nr_cpus>.
I have another script that uses the python print() but that produces so
much output to more than fill the buffers.
With a slightly modified .cocci file from last time:
sibiu:/tmp$ spatch -j 1 cocciprint.cocci cocciprint.c > out 2> /dev/null
&& cat out
cocciprint.c:3:8-9: coccilib.report.print_report Suceeded
print() Succeded
sibiu:/tmp$ spatch -j 2 cocciprint.cocci cocciprint.c > out 2> /dev/null
&& cat out
sibiu:/tmp$ spatch -j 3 cocciprint.cocci cocciprint.c > out 2> /dev/null
&& cat out
sibiu:/tmp$
I use for now print(..., flush=True) to workaround the issue.
bye
michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cocciprint.c
Type: text/x-csrc
Size: 42 bytes
Desc: not available
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20170217/3adf9aa6/attachment.bin>
-------------- next part --------------
@r@
identifier i;
position p;
@@
int i at p;
@ script:python @
p << r.p;
@@
coccilib.report.print_report(p[0], "coccilib.report.print_report Suceeded")
print("print() Succeded")
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cocci] Python Output Not Flushed With -j > 1
2017-02-17 13:29 [Cocci] Python Output Not Flushed With -j > 1 Michael Stefaniuc
@ 2017-02-17 15:19 ` Thierry Martinez
2017-02-17 18:15 ` Michael Stefaniuc
0 siblings, 1 reply; 3+ messages in thread
From: Thierry Martinez @ 2017-02-17 15:19 UTC (permalink / raw)
To: cocci
Michael:
> With a slightly modified .cocci file from last time:
> sibiu:/tmp$ spatch -j 1 cocciprint.cocci cocciprint.c > out 2> /dev/null
> && cat out
> cocciprint.c:3:8-9: coccilib.report.print_report Suceeded
> print() Succeded
> sibiu:/tmp$ spatch -j 2 cocciprint.cocci cocciprint.c > out 2> /dev/null
> && cat out
> sibiu:/tmp$ spatch -j 3 cocciprint.cocci cocciprint.c > out 2> /dev/null
> && cat out
> sibiu:/tmp$
It should be fixed now (commit 8996213b).
Thank you for the report.
--
Thierry.
Michael Stefaniuc (2017/02/17, 13:29 UTC)?:
> Hello,
>
> this is a follow up on the "[Cocci] coccilib.report.print_report Broken
> For Redirected STDOUT".
>
> But this not only affects coccilib.report.print_report but also the
> normal print. I noticed this only when running my real script in my own
> coccicheck implementation that automatically uses -j <nr_cpus>.
> I have another script that uses the python print() but that produces so
> much output to more than fill the buffers.
>
>
> With a slightly modified .cocci file from last time:
> sibiu:/tmp$ spatch -j 1 cocciprint.cocci cocciprint.c > out 2> /dev/null
> && cat out
> cocciprint.c:3:8-9: coccilib.report.print_report Suceeded
> print() Succeded
> sibiu:/tmp$ spatch -j 2 cocciprint.cocci cocciprint.c > out 2> /dev/null
> && cat out
> sibiu:/tmp$ spatch -j 3 cocciprint.cocci cocciprint.c > out 2> /dev/null
> && cat out
> sibiu:/tmp$
>
>
> I use for now print(..., flush=True) to workaround the issue.
>
> bye
> michael
> @r@
> identifier i;
> position p;
> @@
> int i at p;
>
>
> @ script:python @
> p << r.p;
> @@
> coccilib.report.print_report(p[0], "coccilib.report.print_report Suceeded")
> print("print() Succeded")
> _______________________________________________
> Cocci mailing list
> Cocci at systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cocci] Python Output Not Flushed With -j > 1
2017-02-17 15:19 ` Thierry Martinez
@ 2017-02-17 18:15 ` Michael Stefaniuc
0 siblings, 0 replies; 3+ messages in thread
From: Michael Stefaniuc @ 2017-02-17 18:15 UTC (permalink / raw)
To: cocci
On 02/17/2017 04:19 PM, Thierry Martinez wrote:
> Michael:
>> With a slightly modified .cocci file from last time:
>> sibiu:/tmp$ spatch -j 1 cocciprint.cocci cocciprint.c > out 2> /dev/null
>> && cat out
>> cocciprint.c:3:8-9: coccilib.report.print_report Suceeded
>> print() Succeded
>> sibiu:/tmp$ spatch -j 2 cocciprint.cocci cocciprint.c > out 2> /dev/null
>> && cat out
>> sibiu:/tmp$ spatch -j 3 cocciprint.cocci cocciprint.c > out 2> /dev/null
>> && cat out
>> sibiu:/tmp$
>
> It should be fixed now (commit 8996213b).
> Thank you for the report.
Thanks, that fixed it, for my real cocci script too.
bye
michael
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-17 18:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-17 13:29 [Cocci] Python Output Not Flushed With -j > 1 Michael Stefaniuc
2017-02-17 15:19 ` Thierry Martinez
2017-02-17 18:15 ` Michael Stefaniuc
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.