buggrep - Bugs: bug #19491, Segmentation fault: -m 1 -A 99 '^a...

 
 

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

bug #19491: Segmentation fault: -m 1 -A 99 '^a .b$'

Submitter:  Stan Behrens <sbeh>
Submitted:  Mon 02 Apr 2007 04:51:16 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Fri 04 Dec 2009 07:11:51 PM UTC, comment #2: 

Closing per comment #1.

Paolo Bonzini <bonzini>
Mon 02 Apr 2007 09:08:47 PM UTC, comment #1: 

Current cvs does not have this problem anymore:

  $ src/grep -m 1 -A 99 '^a .b$' ~/test.txt
  a .b
  a .c

But indeed with grep-2.5.1:

  $ LC_ALL=C src/grep -m 1 -A 99 '^a .b$' ~/test.txt
  a .b
  Segmentation fault

  $ LC_ALL=en_GB.utf8 src/grep -m 1 -A 99 '^a .b$' ~/test.txt
  a .b
  grep: Memory exhausted

Thanks for reporting.

Benno Schulenberg <bens>
Mon 02 Apr 2007 04:51:16 PM UTC, original submission:  

Hi,

Here is a way to get grep into trouble:

> cat >test.txt

a .b
a .c
^D

> grep -m 1 -A 99 '^a .b$' test.txt

a .b
Segmentation fault (core dumped)


Backtrace is:

(gdb) bt
#0  0x0804de4d in dfaexec (d=0x8059a40, begin=0x8062005 "a .c\n",
    size=4160348156, backref=0xbfbfe680) at dfa.c:2854
#1  0x08053a1e in EGexecute (buf=0x8062005 "a .c\n", size=4, match_size=0x1,
    exact=0) at search.c:430
#2  0x0804f8f0 in prpending (lim=0x806200a "") at grep.c:672
#3  0x08050366 in grepfile (file=0xbfbfea71 "test.txt", stats=0x8059680)
    at grep.c:887
#4  0x080514d7 in main (argc=7, argv=0xbfbfe944) at grep.c:1850


Bye.

Stan Behrens <sbeh>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bonzini (Posted a comment)
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by sbeh (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-12-04 bonzini Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code