[PATCH] manual: reallocarray and str*dup interposition is not supported
Florian Weimer
fweimer@redhat.com
Tue Jul 20 08:05:43 GMT 2021
* Siddhesh Poyarekar:
> These functions call the core allocator functions (realloc and malloc
> respectively) and are hence guaranteed to allocate memory using the
> correct functions when multiple allocators are interposed. Having
> these functions interposed in one allocator and not another may result
> in confusion, hence discourage interposing them altogether.
> ---
> manual/memory.texi | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/manual/memory.texi b/manual/memory.texi
> index 31ee36be8c..4560781f64 100644
> --- a/manual/memory.texi
> +++ b/manual/memory.texi
> @@ -2033,6 +2033,11 @@ when a replacement @code{malloc} is in use. However, failure to replace
> these functions typically does not result in crashes or other incorrect
> application behavior, but may result in static linking failures.
>
> +Replacing the @code{reallocarray} function and the @code{strdup} family of
> +functions is not supported and may produce incorrect results. @theglibc{}
> +implementations of these functions call the replacement @code{malloc} and
> +@code{realloc} functions whenever available.
There are other examples: realpath, getcwd, asprintf, and more. So
please rephrase this in such a way that reallocarray and strdup are just
examples of memory-allocating library functions that call the
replacement malloc implementation.
Thanks,
Florian
More information about the Libc-alpha
mailing list