While testing locate(1) with a very large database (>2GB apparent size) I noticed that it sometimes does not work with mmap (default). Workaround: use the -s flag and run with stdio library (ca. 30% slower than mmap). Note: you should not be affected by this issue if you have less than 500 mio files (or < 30TB) on your partition.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a97ce14abcf9252cfb14e9759d4ff2f89a2ca10f commit a97ce14abcf9252cfb14e9759d4ff2f89a2ca10f Author: Wolfram Schneider <wosch@FreeBSD.org> AuthorDate: 2022-01-19 19:20:11 +0000 Commit: Wolfram Schneider <wosch@FreeBSD.org> CommitDate: 2022-01-19 19:32:16 +0000 correct type of mmap len parameter Using locate -m on a database > 2GB should work now. PR: 261277 usr.bin/locate/locate/fastfind.c | 4 ++-- usr.bin/locate/locate/locate.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-)