public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34979]  New: Atomic line output requested in gcc
@ 2008-01-26  8:31 bkustel at yahoo dot com
  2008-01-26  8:53 ` [Bug preprocessor/34979] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bkustel at yahoo dot com @ 2008-01-26  8:31 UTC (permalink / raw)
  To: gcc-bugs

When running gcc in a parallel build or multi-threaded environment, I run into
cases where gcc's error output gets broken in the middle of line or worse,
individual gcc error output lines from different threads/processes get broken
up and mixed together. While I would fully expect interleaving of LINES in a
multithreaded environment with a shared file descriptor (stderr) I would have
hoped that the output of each error LINE would be atomic. I eventually tracked
this down into libcpp/errors.c where I saw that the output of error lines is
often broken up into many output calls to stderr. I believe POSIX dictates that
each individual output call is atomic with respect to other threads or
processes sharing the same file descriptor but of course if a single error line
is output using numerous fputs(), fputc() and *fprintf() calls then POSIX
provides no guarantee that the line will appear unbroken in the final output.

I have filed this as "enhancement" since I'm not prepared to call the lack of
"atomic line output" a bug, but it would sure be a nice feature to have.
Otherwise in parallel build environments one sometimes get fragments of error
message lines intermixed in stderr and it can be quite confusing.
Thanks.


-- 
           Summary: Atomic line output requested in gcc
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bkustel at yahoo dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34979


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

* [Bug preprocessor/34979] Atomic line output requested in gcc
  2008-01-26  8:31 [Bug c++/34979] New: Atomic line output requested in gcc bkustel at yahoo dot com
@ 2008-01-26  8:53 ` pinskia at gcc dot gnu dot org
  2008-01-26 11:38 ` rguenth at gcc dot gnu dot org
  2009-03-30  0:02 ` [Bug other/34979] " jsm28 at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-26  8:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-01-26 05:43 -------
Really libcpp (the C preprocessor) should be using the normal diagnostic part
of GCC and not its own.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
          Component|c++                         |preprocessor


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34979


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

* [Bug preprocessor/34979] Atomic line output requested in gcc
  2008-01-26  8:31 [Bug c++/34979] New: Atomic line output requested in gcc bkustel at yahoo dot com
  2008-01-26  8:53 ` [Bug preprocessor/34979] " pinskia at gcc dot gnu dot org
@ 2008-01-26 11:38 ` rguenth at gcc dot gnu dot org
  2009-03-30  0:02 ` [Bug other/34979] " jsm28 at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-26 11:38 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-26 11:35:25
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34979


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

* [Bug other/34979] Atomic line output requested in gcc
  2008-01-26  8:31 [Bug c++/34979] New: Atomic line output requested in gcc bkustel at yahoo dot com
  2008-01-26  8:53 ` [Bug preprocessor/34979] " pinskia at gcc dot gnu dot org
  2008-01-26 11:38 ` rguenth at gcc dot gnu dot org
@ 2009-03-30  0:02 ` jsm28 at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-30  0:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jsm28 at gcc dot gnu dot org  2009-03-30 00:02 -------
cpplib does now use GCC's diagnostic.c, so if there is a bug here any more it
is not a preprocessor one.  It looks like diagnostic.c (in turn using
pretty-print.c) will write the diagnostic in one fputs call, then the final
newline in an fputc call, then flush the stream, so it's not yet using the
minimal number of stdio calls - though even with the minimal number of such
calls that doesn't and can't guarantee that multiple write() calls aren't used
underneath by libc.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|preprocessor                |other


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34979


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

end of thread, other threads:[~2009-03-30  0:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-26  8:31 [Bug c++/34979] New: Atomic line output requested in gcc bkustel at yahoo dot com
2008-01-26  8:53 ` [Bug preprocessor/34979] " pinskia at gcc dot gnu dot org
2008-01-26 11:38 ` rguenth at gcc dot gnu dot org
2009-03-30  0:02 ` [Bug other/34979] " jsm28 at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).