[Bug 286605] Regression since using LLV M’s strings

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 05 May 2025 15:22:06 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286605

            Bug ID: 286605
           Summary: Regression since using LLVM’s strings
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: olivier@freebsd.org

We have a memory usage regression since the migration from elftoolchain’s
strings to the LLVM’s version:

It seems the LLVM’s version isn’t able to mmap while used in a pipe, so it copy
ALL the file into memory.

Example:
$ dd if=/dev/urandom of=/tmp/test.file bs=1M count=1024
$ cat /tmp/test.file | strings > /dev/null &

Now with elftoolchain’s strings:
$ ps -o pid,command,vsz,rss | grep strings
53243 strings          12992  2556

And with LLVM’strings:
$ ps -o pid,command,vsz,rss | grep strings
41791 strings          5027836 3413864

And with our use-case, we are using strings on GB files (like core dump), and
it is now consumming all our memory.

Peraps commit "81fa5c4a828bec9f1ead280c59c31bd423e6eeea" (llvm-strings: Install
as strings when WITH_LLVM_BINUTILS=YES) should be reverted until fixed.

-- 
You are receiving this mail because:
You are the assignee for the bug.