Bug 64113 - Output mangled when multiple child processes write to standard out
Output mangled when multiple child processes write to standard out
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: gcc3 (Show other bugs)
7.2
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-04-25 16:54 EDT by Tim Korsrud
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-12-15 15:06:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Attachment of test case that exposes the problem (745 bytes, application/octet-stream)
2002-04-25 16:55 EDT, Tim Korsrud
no flags Details

  None (edit)
Description Tim Korsrud 2002-04-25 16:54:02 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Description of problem:
When a parent process starts up several child processes that share the same 
standard output stream, the output to cout is mangled in the output file.

Some of the child tasks are multithreaded, and the calls to cout are contained 
with in a flockfile( stdout ) and funlockfile( stout ) calls.  Output from 
multiple threads in the same task is correct; it is just output from the 
several child processes that are mangled.

I have created a test program that exposes the problem.  Ten child process are 
forked that each output the same line of text repeatedly.  All processes are 
single threaded in the test case.  The test case output is correct on g++ 2.96, 
or 2.95.

The output is not mangled on gcc 3 if the cout output operators are replaced 
with printf calls.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. make
2. ./parent
3.
	

Actual Results:  'This is the first one'
'This is the first one'
'This is the first one'
'This is the first one'
'This is the first one'
'This is the first one'
'This is the first one'
'This is the first one'
'This is the first one'
'This is the first one'Seive 
eT'
'I am ven comes next'
'
'This is the first one'
'This is the first one'
'This is h'The third process'
'The third process six'
'I guei' am number four'
'The third process'
is the nethe second'



Expected Results:  'Five is the next one'
'Five is the next one'
'Five is the next one'
'Five is the next one'
'Five is the next one'
'Five is the next one'
'Five is the next one'
'Five is the next one'
'Five is the next one'
'I guess this should be six'
'I guess this should be six'
'I guess this should be six'
'I guess this should be six'
'I guess this should be six'
'I guess this should be six'
'I guess this should be six'
'I guess this should be six'
'I guess this should be six'
'I guess this should be six'
'I guess this should be six'
'I guess this should be six'
'I guess this should be six'


Additional info:

RPMS:
gcc3-3.0.4-1
gcc3-c++-3.0.4-1
libgcc-3.0.4-1
libstdc++3-devel-3.0.4-1
libstdc++3-3.0.4-1
glibc-2.2.4-24
Comment 1 Tim Korsrud 2002-04-25 16:55:47 EDT
Created attachment 55366 [details]
Attachment of test case that exposes the problem
Comment 2 Alan Cox 2002-12-15 15:06:05 EST
flockfile is internal to a threaded app only

Note You need to log in before you can comment on or make changes to this bug.