[Bug 280371] diff(1) attempts to allocate ~10^20 bytes while comparing 32GB text files

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 27 Jul 2024 17:17:32 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280371

Dag-Erling Smørgrav <des@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|bugs@FreeBSD.org            |des@FreeBSD.org
             Status|Open                        |In Progress
           Severity|Affects Only Me             |Affects Some People

--- Comment #2 from Dag-Erling Smørgrav <des@FreeBSD.org> ---
I can fix the integer overflow, but I can't easily make diff work with files
that big.  Its running time is proportional to the square of the total number
of lines in its inputs, and it consumes memory roughly equivalent to the sum of
the sizes of its input plus a nontrivial multiple of the total number of lines
in its inputs.  The best I can do is error out if the files are too large.

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