Bug 261277

Summary: locate(1) may not work on very large databases
Product: Base System Reporter: Wolfram Schneider <wosch>
Component: binAssignee: Wolfram Schneider <wosch>
Status: Closed FIXED    
Severity: Affects Some People    
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description Wolfram Schneider freebsd_committer freebsd_triage 2022-01-17 15:28:48 UTC
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.
Comment 1 commit-hook freebsd_committer freebsd_triage 2022-01-19 19:33:13 UTC
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(-)