diff mbox series

[v2,6/7] linux: Decorate __libc_fatal error buffer

Message ID 20231028195559.390407-7-adhemerval.zanella@linaro.org
State Superseded
Headers show
Series Add a tunable to decorate anonymous memory maps | expand

Commit Message

Adhemerval Zanella Oct. 28, 2023, 7:55 p.m. UTC
---
 sysdeps/posix/libc_fatal.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

DJ Delorie Nov. 1, 2023, 2:32 a.m. UTC | #1
LGTM
Reviewed-by: DJ Delorie <dj@redhat.com>

Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
> diff --git a/sysdeps/posix/libc_fatal.c b/sysdeps/posix/libc_fatal.c
> index cf28387ee6..f564d232bf 100644
> --- a/sysdeps/posix/libc_fatal.c
> +++ b/sysdeps/posix/libc_fatal.c
> @@ -31,6 +31,7 @@
>  #include <sys/mman.h>
>  #include <sys/uio.h>
>  #include <not-cancel.h>
> +#include <setvmaname.h>
>  
>  #ifdef FATAL_PREPARE_INCLUDE
>  #include FATAL_PREPARE_INCLUDE
> @@ -116,6 +117,8 @@ __libc_message_impl (const char *fmt, ...)
>  	    wp = mempcpy (wp, iov[cnt].iov_base, iov[cnt].iov_len);
>  	  *wp = '\0';
>  
> +	  __set_vma_name (buf, total, " glibc: fatal");
> +
>  	  /* We have to free the old buffer since the application might
>  	     catch the SIGABRT signal.  */
>  	  struct abort_msg_s *old = atomic_exchange_acquire (&__abort_msg,

Ok.
diff mbox series

Patch

diff --git a/sysdeps/posix/libc_fatal.c b/sysdeps/posix/libc_fatal.c
index cf28387ee6..f564d232bf 100644
--- a/sysdeps/posix/libc_fatal.c
+++ b/sysdeps/posix/libc_fatal.c
@@ -31,6 +31,7 @@ 
 #include <sys/mman.h>
 #include <sys/uio.h>
 #include <not-cancel.h>
+#include <setvmaname.h>
 
 #ifdef FATAL_PREPARE_INCLUDE
 #include FATAL_PREPARE_INCLUDE
@@ -116,6 +117,8 @@  __libc_message_impl (const char *fmt, ...)
 	    wp = mempcpy (wp, iov[cnt].iov_base, iov[cnt].iov_len);
 	  *wp = '\0';
 
+	  __set_vma_name (buf, total, " glibc: fatal");
+
 	  /* We have to free the old buffer since the application might
 	     catch the SIGABRT signal.  */
 	  struct abort_msg_s *old = atomic_exchange_acquire (&__abort_msg,