All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry.Martinez@inria.fr (Thierry Martinez)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Python Output Not Flushed With -j > 1
Date: Fri, 17 Feb 2017 16:19:26 +0100	[thread overview]
Message-ID: <ow4wpco975t.fsf@inria.fr> (raw)
In-Reply-To: <9bb393fd-22cf-8b1e-33e8-755e0ba02ed3@redhat.com>

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

  reply	other threads:[~2017-02-17 15:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17 13:29 [Cocci] Python Output Not Flushed With -j > 1 Michael Stefaniuc
2017-02-17 15:19 ` Thierry Martinez [this message]
2017-02-17 18:15   ` Michael Stefaniuc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ow4wpco975t.fsf@inria.fr \
    --to=thierry.martinez@inria.fr \
    --cc=cocci@systeme.lip6.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.