During agent-facilitated porting of Unix V7 to the BESM-6 architecture sergev@GitHub has found out that the fgrep tool had an OOB bug in its Aho-Corasick algorithm implementation, resulting in silently missing valid matches.
A small example, produced by an online X86 port of Unix V7 is
mem = 14016512
# cat > patterns
bd
debdb
ebb
# echo debd | fgrep -f patterns
# cat > good
bd
debdb
# echo debd | fgrep -f good
debd
#
#
Searching for an occurrence of "bd" or "debdb" or "ebb" in "debd" finds nothing. If the seemingly irrelevant "ebb" is removed from the pattern list, the match is found.
Was it known that Unix V7 fgrep had a bug?

Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.