Skip to content

llvm-strings excessive memory use when used in a pipe #138855

@emaste

Description

@emaste

As reported in FreeBSD bugzilla, after FreeBSD switched from ELF Tool Chain's binary utilities to using LLVM's by default:

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions