diff mbox series

[v2,5/7] assert: Decorate error message buffer

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

Commit Message

Adhemerval Zanella Netto Oct. 28, 2023, 7:55 p.m. UTC
---
 assert/assert.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

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

Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
> diff --git a/assert/assert.c b/assert/assert.c
> index b7c7a4a1ba..bf0f4a69f5 100644
> --- a/assert/assert.c
> +++ b/assert/assert.c
> @@ -24,6 +24,7 @@
>  #include <sysdep.h>
>  #include <unistd.h>
>  #include <sys/mman.h>
> +#include <setvmaname.h>
>  
>  
>  extern const char *__progname;
> @@ -71,6 +72,7 @@ __assert_fail_base (const char *fmt, const char *assertion, const char *file,
>  	{
>  	  buf->size = total;
>  	  strcpy (buf->msg, str);
> +	  __set_vma_name (buf, total, " glibc: assert");
>  
>  	  /* We have to free the old buffer since the application might
>  	     catch the SIGABRT signal.  */

Ok.
diff mbox series

Patch

diff --git a/assert/assert.c b/assert/assert.c
index b7c7a4a1ba..bf0f4a69f5 100644
--- a/assert/assert.c
+++ b/assert/assert.c
@@ -24,6 +24,7 @@ 
 #include <sysdep.h>
 #include <unistd.h>
 #include <sys/mman.h>
+#include <setvmaname.h>
 
 
 extern const char *__progname;
@@ -71,6 +72,7 @@  __assert_fail_base (const char *fmt, const char *assertion, const char *file,
 	{
 	  buf->size = total;
 	  strcpy (buf->msg, str);
+	  __set_vma_name (buf, total, " glibc: assert");
 
 	  /* We have to free the old buffer since the application might
 	     catch the SIGABRT signal.  */