Bug 596520

Summary: grep-2.6.3-1.fc12.x86_64 broken
Product: [Fedora] Fedora Reporter: Maxim Egorushkin <maxim.yegorushkin>
Component: grepAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: low    
Version: 12CC: jskarvad, lkundrak
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-27 10:33:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Maxim Egorushkin 2010-05-26 21:11:51 UTC
Description of problem:
grep-2.6.3-1.fc12.x86_64 does not parse the command line.


Version-Release number of selected component (if applicable):
grep-2.6.3-1.fc12.x86_64

How reproducible:
always

Steps to Reproduce:
Actual results:
[max@truth ~]$ sudo yum update grep
Loaded plugins: presto, refresh-packagekit
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package grep.x86_64 0:2.6.3-1.fc12 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package        Arch             Version                Repository         Size
================================================================================
Updating:
 grep           x86_64           2.6.3-1.fc12           updates           228 k

Transaction Summary
================================================================================
Install       0 Package(s)
Upgrade       1 Package(s)

Total download size: 228 k
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
updates/prestodelta                                      | 8.3 kB     00:00     
Processing delta metadata
Package(s) data still to download: 228 k
grep-2.6.3-1.fc12.x86_64.rpm                             | 228 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating       : grep-2.6.3-1.fc12.x86_64                                 1/2 
  Cleanup        : grep-2.5.3-6.fc12.x86_64                                 2/2 

Updated:
  grep.x86_64 0:2.6.3-1.fc12                                                    

Complete!
[max@truth ~]$ grep -h
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
[max@truth ~]$ grep --help
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
[max@truth ~]$ grep x /dev/null
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.




Expected results:
[max@truth ~]$ sudo yum downgrade grep
Loaded plugins: presto, refresh-packagekit
Setting up Downgrade Process
Resolving Dependencies
--> Running transaction check
---> Package grep.x86_64 0:2.5.3-6.fc12 set to be updated
---> Package grep.x86_64 0:2.6.3-1.fc12 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package        Arch             Version                 Repository        Size
================================================================================
Downgrading:
 grep           x86_64           2.5.3-6.fc12            fedora           240 k

Transaction Summary
================================================================================
Remove        0 Package(s)
Reinstall     0 Package(s)
Downgrade     1 Package(s)

Total download size: 240 k
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 240 k
grep-2.5.3-6.fc12.x86_64.rpm                             | 240 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : grep-2.5.3-6.fc12.x86_64                                 1/2 
  Cleanup        : grep-2.6.3-1.fc12.x86_64                                 2/2 

Removed:
  grep.x86_64 0:2.6.3-1.fc12                                                    

Installed:
  grep.x86_64 0:2.5.3-6.fc12                                                    

Complete!
[max@truth ~]$ grep -h
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
[max@truth ~]$ grep --help
Usage: grep [OPTION]... PATTERN [FILE]...
Search for PATTERN in each FILE or standard input.
PATTERN is, by default, a basic regular expression (BRE).
Example: grep -i 'hello world' menu.h main.c

Regexp selection and interpretation:
  -E, --extended-regexp     PATTERN is an extended regular expression (ERE)
  -F, --fixed-strings       PATTERN is a set of newline-separated fixed strings
  -G, --basic-regexp        PATTERN is a basic regular expression (BRE)
  -P, --perl-regexp         PATTERN is a Perl regular expression
  -e, --regexp=PATTERN      use PATTERN for matching
  -f, --file=FILE           obtain PATTERN from FILE
  -i, --ignore-case         ignore case distinctions
  -w, --word-regexp         force PATTERN to match only whole words
  -x, --line-regexp         force PATTERN to match only whole lines
  -z, --null-data           a data line ends in 0 byte, not newline

Miscellaneous:
  -s, --no-messages         suppress error messages
  -v, --invert-match        select non-matching lines
  -V, --version             print version information and exit
      --help                display this help and exit
      --mmap                use memory-mapped input if possible

Output control:
  -m, --max-count=NUM       stop after NUM matches
  -b, --byte-offset         print the byte offset with output lines
  -n, --line-number         print line number with output lines
      --line-buffered       flush output on every line
  -H, --with-filename       print the filename for each match
  -h, --no-filename         suppress the prefixing filename on output
      --label=LABEL         print LABEL as filename for standard input
  -o, --only-matching       show only the part of a line matching PATTERN
  -q, --quiet, --silent     suppress all normal output
      --binary-files=TYPE   assume that binary files are TYPE;
                            TYPE is `binary', `text', or `without-match'
  -a, --text                equivalent to --binary-files=text
  -I                        equivalent to --binary-files=without-match
  -d, --directories=ACTION  how to handle directories;
                            ACTION is `read', `recurse', or `skip'
  -D, --devices=ACTION      how to handle devices, FIFOs and sockets;
                            ACTION is `read' or `skip'
  -R, -r, --recursive       equivalent to --directories=recurse
      --include=FILE_PATTERN  search only files that match FILE_PATTERN
      --exclude=FILE_PATTERN  skip files and directories matching FILE_PATTERN
      --exclude-from=FILE   skip files matching any file pattern from FILE
      --exclude-dir=PATTERN directories that match PATTERN will be skipped.
  -L, --files-without-match print only names of FILEs containing no match
  -l, --files-with-matches  print only names of FILEs containing matches
  -c, --count               print only a count of matching lines per FILE
  -T, --initial-tab         make tabs line up (if needed)
  -Z, --null                print 0 byte after FILE name

Context control:
  -B, --before-context=NUM  print NUM lines of leading context
  -A, --after-context=NUM   print NUM lines of trailing context
  -C, --context=NUM         print NUM lines of output context
  -NUM                      same as --context=NUM
      --color[=WHEN],
      --colour[=WHEN]       use markers to highlight the matching strings;
                            WHEN is `always', `never', or `auto'
  -U, --binary              do not strip CR characters at EOL (MSDOS)
  -u, --unix-byte-offsets   report offsets as if CRs were not there (MSDOS)

`egrep' means `grep -E'.  `fgrep' means `grep -F'.
Direct invocation as either `egrep' or `fgrep' is deprecated.
With no FILE, or when FILE is -, read standard input.  If less than two FILEs
are given, assume -h.  Exit status is 0 if any line was selected, 1 otherwise;
if any error occurs and -q was not given, the exit status is 2.

Report bugs to <bug-grep>.
[max@truth ~]$ grep x /dev/null


Additional info:

Comment 1 Jaroslav Škarvada 2010-05-27 08:53:15 UTC
I am unable to reproduce it, what is your locale?

Fresh F12 install with latest updates:

$ uname -srvpmi
Linux 2.6.32.12-115.fc12.x86_64 #1 SMP Fri Apr 30 19:46:25 UTC 2010 x86_64 x86_64 x86_64

$ yum list installed grep
Loaded plugins: presto, refresh-packagekit
Installed Packages
grep.x86_64                        2.6.3-1.fc12                         @updates

$ grep --version
GNU grep 2.6.3
...

$ grep -h
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.

$ grep --help

$ grep --help
Usage: grep [OPTION]... PATTERN [FILE]...
Search for PATTERN in each FILE or standard input.
PATTERN is, by default, a basic regular expression (BRE).
Example: grep -i 'hello world' menu.h main.c
...

$ grep x /dev/null
$

This grep package also undergoes the update process through bodhi with positive karma thus such a strange regression should be caught.

Please also try the "yum upgrade" command, or better:

$ yum clean all
$ yum upgrade
$ yum reinstall grep

Comment 2 Maxim Egorushkin 2010-05-27 10:33:34 UTC
(In reply to comment #1)
> I am unable to reproduce it, what is your locale?

Thank you for looking into this Jaroslav.

In my environment I had GREP_OPTIONS=--mmap. After unsetting GREP_OPTIONS grep-2.6.3-1.fc12.x86_64 works fine.

If only grep could give me a hint, saying "unknown option --mmap"...