misc/153124: "grep foo * > somefile" goes into an infinite loop
kenorb
kenorb at gmail.com
Mon Dec 13 16:10:10 UTC 2010
>Number: 153124
>Category: misc
>Synopsis: "grep foo * > somefile" goes into an infinite loop
>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: Mon Dec 13 16:10:09 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: kenorb
>Release: 8.1-STABLE
>Organization:
>Environment:
FreeBSD kenorb 8.1-STABLE FreeBSD 8.1-STABLE #4: Mon Nov 15 14:40:15 GMT 2010 root at kenorb:/usr/obj/usr/src/sys/BRO amd64
>Description:
I don't know what's the difference between list.txt and zz.txt, but on zz.txt it always freezing, on list.txt it doesn't;/
It freezing always when you use the name as last file in alphabetical order.
It does work when you grep "table", but doesn't when you grep "td".
>How-To-Repeat:
> perl -e '$i = 1; while($i++ < 5) { system("wget -nc \"http://ai-contest.com/rankings.php?page=$i\""); }'
> grep "td" * > list.txt
# WORKS
> grep "td" * > list.txt
# WORKS
> grep "td" * > zz.txt
# BIG FREEZE UNTIL YOU RUN OF SPACE!
load: 0.66 cmd: grep 39619 [biord] 68.52r 34.09u 15.73s 72% 1156k
load: 0.74 cmd: grep 39619 [running] 78.90r 39.41u 18.58s 80% 1156k
load: 0.96 cmd: grep 39619 [running] 118.59r 60.64u 28.60s 82% 1156k
load: 0.75 cmd: grep 39619 [running] 267.90r 122.22u 62.36s 53% 1156k
39668: read(3,"xt:zz.txt:zz.txt:zz.txt:zz.txt:z"...,24576) = 24576 (0x6000)
39668: write(1,"zz.txt:zz.txt:zz.txt:zz.txt:zz.t"...,16384) = 16384 (0x4000)
39668: read(3,"t:zz.txt:zz.txt:zz.txt:zz.txt:zz"...,24576) = 24576 (0x6000)
39668: write(1,":zz.txt:zz.txt:zz.txt:zz.txt:zz."...,16384) = 16384 (0x4000)
39668: write(1,"z.txt:zz.txt:zz.txt:zz.txt:zz.tx"...,16384) = 16384 (0x4000)
39668: read(3,"z.txt:zz.txt:zz.txt:zz.txt:zz.tx"...,24576) = 24576 (0x6000)
39668: write(1,"txt:zz.txt:zz.txt:zz.txt:zz.txt:"...,16384) = 16384 (0x4000)
39668: read(3,"t:zz.txt:zz.txt:zz.txt:zz.txt:zz"...,24576) = 24576 (0x6000)
39668: write(1,":zz.txt:zz.txt:zz.txt:zz.txt:zz."...,16384) = 16384 (0x4000)
39668: write(1,"z.txt:zz.txt:zz.txt:zz.txt:zz.tx"...,16384) = 16384 (0x4000)
39668: read(3,":zz.txt:zz.txt:zz.txt:zz.txt:zz."...,24576) = 24576 (0x6000)
39668: write(1,".txt:zz.txt:zz.txt:zz.txt:zz.txt"...,16384) = 16384 (0x4000)
39668: read(3,"xt:zz.txt:zz.txt:zz.txt:zz.txt:z"...,24576) = 24576 (0x6000)
39668: write(1,"xt:zz.txt:zz.txt:zz.txt:zz.txt:z"...,16384) = 16384 (0x4000)
>Fix:
Related:
http://savannah.gnu.org/bugs/?17457
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list