Bug 52182 - grep-2.5e-4 segfaults with argument of
Summary: grep-2.5e-4 segfaults with argument of
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: grep
Version: 1.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-08-21 14:16 UTC by Ed Marshall
Modified: 2007-04-18 16:36 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-08-21 14:16:41 UTC
Embargoed:


Attachments (Terms of Use)

Description Ed Marshall 2001-08-21 14:16:36 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010803

Description of problem:
When you run grep with the option '-C', with an invalid modifier (ie. some
non-numeric value), it segfaults.

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

How reproducible:
Always

Steps to Reproduce:
Run "grep -C 'foo' /etc/passwd".

Actual Results:  Segmentation fault:

Starting program: /bin/grep -riC 'f[t-v]ck' /usr/src/linux/.
grep: 
Program received signal SIGSEGV, Segmentation fault.
0x40081c3c in _IO_vfprintf (s=0xbfffcd20, format=0x805ce40 "%s: %s: %s\n", 
    ap=0xbffff8d8) at ../sysdeps/i386/i486/bits/string.h:530
530
../sysdeps/i386/i486/bits/string.h: No such file or directory.
	in ../sysdeps/i386/i486/bits/string.h
(gdb) where
#0  0x40081c3c in _IO_vfprintf (s=0xbfffcd20, format=0x805ce40 "%s: %s: %s\n", 
    ap=0xbffff8d8) at ../sysdeps/i386/i486/bits/string.h:530
#1  0x40084ff4 in buffered_vfprintf (s=0x4015d180, 
    format=0x805ce40 "%s: %s: %s\n", args=0x0) at vfprintf.c:2087
#2  0x4008001b in _IO_vfprintf (s=0x4015d180, format=0x805ce40 "%s: %s: %s\n", 
    ap=0xbffff8cc) at vfprintf.c:1272
#3  0x08054942 in error ()
#4  0x0804991d in strcpy ()
#5  0x0804b2e3 in strcpy ()
#6  0x400467c7 in __libc_start_main (main=0x804b180 <strcpy+6696>, argc=4, 
    ubp_av=0xbffff9b4, init=0x8049260, fini=0x805c8d0 <__umoddi3+560>, 
    rtld_fini=0x4000db74 <_dl_fini>, stack_end=0xbffff9ac)
    at ../sysdeps/generic/libc-start.c:129


Expected Results:  There should have been an error message indicating
invalid usage of the -C option.

Additional info:

Comment 1 Bernhard Rosenkraenzer 2001-08-22 10:39:37 UTC
That's one of the reason why we've gone back to 2.4. (along with the fact that 
we thought 2.5-final would be released earlier when we put the beta in the 
tree).




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