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$'

Submitted by:  Stan Behrens <sbeh>
Submitted on:  Mon 02 Apr 2007 04:51:16 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned 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>

 

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 bens (Posted a comment)
  • -unavailable- added by sbeh (Submitted the item)
  •  

    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):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 04 Dec 2009 07:11:50 PM UTCbonziniOpen/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1