Subject: bug#64316: [bug-diffutils] bug#64316: ASAN failures in dir.c

From: Paul Eggert <[email-masked]>
Date: Tue, 27 Jun 2023 18:04:29 -0700

On 2023-06-27 12:52, Gisle Vanem wrote:
> with MSVC's 'cl.exe', I often get:
>    diff.exe: memory exhausted
> 
> (on directory branches with approx. > 7000 files)

I can't reproduce that on Ubuntu x86 or x86-64. I built a test case this 
way:

   for dir in d e; do
     (mkdir $dir &&
      cd $dir &&
      for i in $(seq 8000); do
        echo $dir$i>$i
      done)
   done

and "diff d e >f" worked just fine. Do you have a reproducible test case?

>  From where the allocation fails, I've no idea since Gnulib is so
> unfriendly telling where this occurs. Is there really no
> xmalloc_die() with some more useful messages than this? Yikes!

When you run out of memory, bad things happen pretty much everywhere. 
Too bad Microsoft gives you a bad backtrace.

You might try running the leak detector though to be honest I've not had 
much luck with that.

Another possibility is to try to find the commit that introduced the 
problem, if it's reproducible.