buggrep - Bugs: bug #35022, Grep jumbles output...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #35022: Grep jumbles output nondeterministically

Submitted by:  Larry Reaves <yrral86>
Submitted on:  Fri 09 Dec 2011 02:46:41 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: Closed

Fri 09 Dec 2011 08:14:53 AM UTC, comment #2:

The problem is that output to stdout is done by one process (the second grep) and output to stderr is done by another (the first grep). Under these conditions it is not possible to combine the two outputs deterministically.

If you do

( grep -rn redirect test/ | grep -v assert ) > stdout 2> stderr
cat stdout
cat stderr

You can see that the output is correct.

Paolo Bonzini <bonzini>
Fri 09 Dec 2011 02:48:20 AM UTC, comment #1:

Ok, in the example I gave it shows up after the first match. I have also seen it show up after both matches:

grep: test/functional/.#tickets_controller_test.rbtest/functional/settings_controller_test.rb:57: attribs[:redirect] = :search
test/functional/settings_controller_test.rb:61: attribs[:redirect] = :payment
: No such file or directory

Larry Reaves <yrral86>
Fri 09 Dec 2011 02:46:41 AM UTC, original submission:

Command is:
grep -rn redirect test/ | grep -v assert

Correct output (given most times):
grep: test/functional/.#tickets_controller_test.rb: No such file or directory
test/functional/settings_controller_test.rb:57: attribs[:redirect] = :search
test/functional/settings_controller_test.rb:61: attribs[:redirect] = :payment

Jumbled output (given sometimes):
grep: test/functional/.#tickets_controller_test.rbtest/functional/settings_controller_test.rb:57: attribs[:redirect] = :search
: No such file or directory
test/functional/settings_controller_test.rb:61: attribs[:redirect] = :payment

As you can see, the ": No such file or directory" shows up after the matches.

Larry Reaves <yrral86>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bonzini (Posted a comment)
  • -unavailable- added by yrral86 (Submitted the item)
  • -unavailable- added by yrral86
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 09 Dec 2011 08:14:53 AM UTCbonziniStatusNone=>Invalid
      Open/ClosedOpen=>Closed
    Fri 09 Dec 2011 02:46:41 AM UTCyrral86Carbon-Copy-=>Added yrral86

    Back to the top


    Powered by Savane 3.1-cleanup1