* Issue in man page malloc.3
@ 2022-12-04 9:07 Helge Kreutzmann
2022-12-04 12:23 ` Alejandro Colomar
0 siblings, 1 reply; 4+ messages in thread
From: Helge Kreutzmann @ 2022-12-04 9:07 UTC (permalink / raw)
To: alx.manpages; +Cc: mario.blaettermann, linux-man
Without further ado, the following was found:
Issue: preserve errno → preserve I<errno>
"If your program uses a private memory allocator, it should do so by "
"replacing B<malloc>(), B<free>(), B<calloc>(), and B<realloc>(). The "
"replacement functions must implement the documented glibc behaviors, "
"including I<errno> handling, size-zero allocations, and overflow checking; "
"otherwise, other library routines may crash or operate incorrectly. For "
"example, if the replacement I<free>() does not preserve errno, then "
"seemingly unrelated library routines may fail without having a valid reason "
"in I<errno>. Private memory allocators may also need to replace other glibc "
"functions; see \"Replacing malloc\" in the glibc manual for details."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Issue in man page malloc.3
2022-12-04 9:07 Issue in man page malloc.3 Helge Kreutzmann
@ 2022-12-04 12:23 ` Alejandro Colomar
0 siblings, 0 replies; 4+ messages in thread
From: Alejandro Colomar @ 2022-12-04 12:23 UTC (permalink / raw)
To: Helge Kreutzmann; +Cc: mario.blaettermann, linux-man
[-- Attachment #1.1: Type: text/plain, Size: 907 bytes --]
On 12/4/22 10:07, Helge Kreutzmann wrote:
> Without further ado, the following was found:
>
> Issue: preserve errno → preserve I<errno>
>
> "If your program uses a private memory allocator, it should do so by"
> "replacing B<malloc>(), B<free>(), B<calloc>(), and B<realloc>(). The"
> "replacement functions must implement the documented glibc behaviors,"
> "including I<errno> handling, size-zero allocations, and overflow checking;"
> "otherwise, other library routines may crash or operate incorrectly. For"
> "example, if the replacement I<free>() does not preserve errno, then"
> "seemingly unrelated library routines may fail without having a valid reason"
> "in I<errno>. Private memory allocators may also need to replace other glibc"
> "functions; see \"Replacing malloc\" in the glibc manual for details."
Fixed. Thanks.
--
<http://www.alejandro-colomar.es/>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Issue in man page malloc.3
@ 2025-08-24 14:48 Helge Kreutzmann
2025-08-31 12:08 ` Alejandro Colomar
0 siblings, 1 reply; 4+ messages in thread
From: Helge Kreutzmann @ 2025-08-24 14:48 UTC (permalink / raw)
To: alx; +Cc: mario.blaettermann, linux-man
Without further ado, the following was found:
Issue: enough that → enough, so that
"The behavior of I<realloc(p,\\ 0)> in glibc doesn't conform to any of C99, "
"C11, POSIX.1-2001, POSIX.1-2004, POSIX.1-2008, POSIX.1-2013, POSIX.1-2017, "
"or POSIX.1-2024. The C17 specification was changed to make it conforming, "
"but that specification made it impossible to write code that reliably "
"determines if the input pointer is freed after I<realloc(p,\\ 0)>, and C23 "
"changed it again to make this undefined behavior, acknowledging that the C17 "
"specification was broad enough that undefined behavior wasn't worse than "
"that."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Issue in man page malloc.3
2025-08-24 14:48 Helge Kreutzmann
@ 2025-08-31 12:08 ` Alejandro Colomar
0 siblings, 0 replies; 4+ messages in thread
From: Alejandro Colomar @ 2025-08-31 12:08 UTC (permalink / raw)
To: Helge Kreutzmann; +Cc: mario.blaettermann, linux-man
[-- Attachment #1: Type: text/plain, Size: 1050 bytes --]
Hi Helge,
On Sun, Aug 24, 2025 at 02:48:43PM +0000, Helge Kreutzmann wrote:
> Without further ado, the following was found:
>
> Issue: enough that → enough, so that
Thanks; I've applied your suggestion.
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=5765b190cc2e6fba6c12fdf4174aab6734cb2a72>
(at port 80.)
Cheers,
Alex
>
> "The behavior of I<realloc(p,\\ 0)> in glibc doesn't conform to any of C99, "
> "C11, POSIX.1-2001, POSIX.1-2004, POSIX.1-2008, POSIX.1-2013, POSIX.1-2017, "
> "or POSIX.1-2024. The C17 specification was changed to make it conforming, "
> "but that specification made it impossible to write code that reliably "
> "determines if the input pointer is freed after I<realloc(p,\\ 0)>, and C23 "
> "changed it again to make this undefined behavior, acknowledging that the C17 "
> "specification was broad enough that undefined behavior wasn't worse than "
> "that."
>
--
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-08-31 12:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-04 9:07 Issue in man page malloc.3 Helge Kreutzmann
2022-12-04 12:23 ` Alejandro Colomar
-- strict thread matches above, loose matches on Subject: below --
2025-08-24 14:48 Helge Kreutzmann
2025-08-31 12:08 ` Alejandro Colomar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox