[musl] BUG: realloc(p,0) should be consistent with malloc(0)
Paul Eggert
eggert@cs.ucla.edu
Mon Jun 16 17:35:07 GMT 2025
On 2025-06-16 05:24, Rich Felker wrote:
> Do you have numbers for how many packages have actually pulled in the
> updated gnulib and shipped with it? With this change, do you have it
> replacing realloc on glibc, so that the new realloc actually gets
> used? I would expect yes;
I don't have numbers, but I've helped to release new GNU coreutils,
diffutils, grep, and gzip with the new Gnulib. No realloc-related
problems have been reported. I expect other GNU apps have also been
released with the new Gnulib.
The new Gnulib replaces all app calls to realloc on platforms like glibc
where realloc does not have the desired behavior. It does not replace
realloc calls within libraries that are linked to.
Since these GNU apps are designed to be portable to musl etc. I would
not have expected the new Gnulib behavior to change observable app
behavior. The Gnulib change is mostly there to mask out any (unlikely)
bugs that would occur if a GNU app incorrectly assumed the current Glibc
realloc behavior (which is obviously bogus).
More information about the Libc-alpha
mailing list