bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep -A1 -m1 segfaults with multiple line matches bug


From: Benno Schulenberg
Subject: Re: grep -A1 -m1 segfaults with multiple line matches bug
Date: Fri, 23 Feb 2007 19:28:22 +0100
User-agent: KMail/1.9.6

Justin Pryzby wrote:
> On Fri, Feb 23, 2007 at 03:02:14PM +0100, Benno Schulenberg wrote:
> > Justin Pryzby wrote:
> > > grep segfaults when invoked like:
> > >
> > > { echo h; echo yz; } |grep -A1 -m1 "`echo h; echo zz`"
>
> It segfaults on redhat too (with the same upstream version).

Confirmed on Feisty:

# { echo h; echo yz; } | grep -A1 -m1 "`echo h; echo zz`"
h
Segmentation fault


# dpkg --list grep | tail -3
||/ Name           Version        Description
+++-==============-==============-============================================
ii  grep           2.5.1.ds2-6    GNU grep, egrep and fgrep


You might try to find out which patches both Debian and Red Hat 
apply that Gentoo doesn't apply to their grep.  Or build the source 
package on Debian and enable debugging symbols and get a usable 
backtrace.


# gdb -q grep
(no debugging symbols found)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) run -A1 -m1 "`echo h; echo zz`"
Starting program: /bin/grep -A1 -m1 "`echo h; echo zz`"
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
h
h
yz

Program received signal SIGSEGV, Segmentation fault.
0x0805194c in ?? ()
(gdb) bt
#0  0x0805194c in ?? ()
#1  0x00000000 in ?? ()
(gdb)


Benno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]