bin/165471: /usr/bin/bsdgrep hang/very slow with mmap

Patrick Dung patrick_dkt at
Sat Feb 25 14:40:15 UTC 2012

>Number:         165471
>Category:       bin
>Synopsis:       /usr/bin/bsdgrep hang/very slow with mmap
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 25 14:40:14 UTC 2012
>Originator:     Patrick Dung
>Release:        Freebsd 9.0
root at  i386
bsdgrep with --mmap would sometimes cause hang/slow response.
Also it is eating memory when it is very slow/hang.

cd /usr/local/share and compare grep and bsdgrep:

[root at fbsd9-test /usr/local/share]# time grep --mmap -r -e '^Feb' *

real    0m1.875s
user    0m0.085s
sys     0m1.327s
[root at fbsd9-test /usr/local/share]# time bsdgrep --mmap -r -e '^Feb' *

real    1m40.931s
user    0m0.427s
sys     1m22.064s

only encounter problem with some files
use GNU grep


More information about the freebsd-bugs mailing list