From nobody@FreeBSD.org  Thu Aug  1 20:54:49 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 0FE6ED7A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  1 Aug 2013 20:54:49 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id F126729FB
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  1 Aug 2013 20:54:48 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r71KsmPb003548
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 1 Aug 2013 20:54:48 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r71KsmE4003544;
	Thu, 1 Aug 2013 20:54:48 GMT
	(envelope-from nobody)
Message-Id: <201308012054.r71KsmE4003544@oldred.freebsd.org>
Date: Thu, 1 Aug 2013 20:54:48 GMT
From: Nathan Weeks <nathan.weeks@ars.usda.gov>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bsdgrep segfaults when pattern file contains many lines 
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         180990
>Category:       bin
>Synopsis:       bsdgrep(1) segfaults when pattern file contains many lines
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 01 21:00:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Fri Aug 02 02:48:56 UTC 2013
>Originator:     Nathan Weeks
>Release:        9.1-RELEASE
>Organization:
USDA-ARS
>Environment:
FreeBSD fully.qualified.domain.name 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
"bsdgrep -f pattern_file file" segfaults when the pattern_file has more than a few dozen lines.
>How-To-Repeat:
$ echo 128 > file
$ seq 1 128 > pattern_file
$ bsdgrep -xf pattern_file file
Segmentation fault (core dumped)
>Fix:


>Release-Note:
>Audit-Trail:

From: Andrey Chernov <ache@freebsd.org>
To: Nathan Weeks <nathan.weeks@ars.usda.gov>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/180990: bsdgrep segfaults when pattern file contains many
 lines
Date: Fri, 02 Aug 2013 02:52:56 +0400

 On 02.08.2013 0:54, Nathan Weeks wrote:
 >> Environment:
 > FreeBSD fully.qualified.domain.name 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
 >> Description:
 > "bsdgrep -f pattern_file file" segfaults when the pattern_file has more than a few dozen lines.
 >> How-To-Repeat:
 > $ echo 128 > file
 > $ seq 1 128 > pattern_file
 > $ bsdgrep -xf pattern_file file
 > Segmentation fault (core dumped)
 
 I don't see segfault on i386, but grep -x is fundamentally broken - it
 just finds nothing in contrast with gnu grep.
 
 -- 
 http://ache.vniz.net/
 bitcoin:1G6ugdNY6e5jx1GVnAU2ntj2NEfmjKG85r
>Unformatted:
