RSS Amplifier

Recent Questions - Retrocomputing Stack Exchange · Aug 1, 2026

Was it known before that Unix V7 fgrep had a bug?

0
Sign in to vote or save

This page did not load. You can still read it on the original site — the toolbar below keeps your place in the directory.

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 |…

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?

Read on retrocomputing.stackexchange.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.