This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/34979] New: Atomic line output requested in gcc


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]