Bug 261277 - locate(1) may not work on very large databases
Summary: locate(1) may not work on very large databases
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Wolfram Schneider
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-17 15:28 UTC by Wolfram Schneider
Modified: 2022-01-19 19:57 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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(-)