Thursday, April 02, 2020

Re: [PATCH] Valgrind print symbol of ld.so

Sorry, this patch is not correct. I'm canceling this patch. I'll
consder it again.
--
ASOU Masato

From: Masato Asou <asou@soum.co.jp>
Date: Fri, 03 Apr 2020 12:24:32 +0900 (JST)

> Hello,
>
> I made patch for print symbold of ld.so, if error was occured as
> below:
>
>
> Before apply this patch:
> $ valgrind ./a.out
> ==62211== Memcheck, a memory error detector
> ==62211== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et
> al.
> ==62211== Using Valgrind-3.10.1 and LibVEX; rerun with -h for
> copyright info
> ==62211== Command: ./a.out
> ==62211==
> ==62211== Invalid write of size 1
> ==62211== at 0x4108E72: ???
> ==62211== by 0x4108374: ???
> ==62211== by 0x41096FA: ???
> ==62211== by 0x4102D4E: ???
> ==62211== by 0x4103986: ???
> ==62211== by 0x4104535: ???
> ==62211== Address 0x40052a0 is not stack'd, malloc'd or (recently) free'd
> ==62211==
>
> </snip>
>
>
> After apply this patch:
> $ valgrind ./a.out
> ==81691== Memcheck, a memory error detector
> ==81691== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et
> al.
> ==81691== Using Valgrind-3.10.1 and LibVEX; rerun with -h for
> copyright info
> ==81691== Command: ./a.out
> ==81691==
> ==81691== Invalid write of size 1
> ==81691== at 0x4108E72: chacha_encrypt_bytes (chacha_private.h:191)
> ==81691== by 0x4108374: _dl_arc4randombuf (util.c:98)
> ==81691== by 0x41096FA: rbytes_init (malloc.c:187)
> ==81691== by 0x4102D4E: _dl_malloc_init (in /usr/libexec/ld.so)
> ==81691== by 0x4103986: _dl_boot (in /usr/libexec/ld.so)
> ==81691== by 0x4104535: _dl_start (in /usr/libexec/ld.so)
> ==81691== Address 0x40053e0 is not stack'd, malloc'd or (recently) free'd
> ==81691==
>
> </snip>
>
> Regards
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/valgrind/Makefile,v
> retrieving revision 1.23
> diff -u -p -r1.23 Makefile
> --- Makefile 23 Dec 2019 23:26:32 -0000 1.23
> +++ Makefile 3 Apr 2020 03:12:38 -0000
> @@ -7,7 +7,7 @@ CATEGORIES = devel
>
> V = 3.10.1
> PV = 20160331
> -REVISION = 16
> +REVISION = 17
> DISTNAME = valgrind-${V}
> EXTRACT_SUFX = .tar.bz2
>
> Index: patches/patch-coregrind_m_libcfile_c
> ===================================================================
> RCS file: patches/patch-coregrind_m_libcfile_c
> diff -N patches/patch-coregrind_m_libcfile_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-coregrind_m_libcfile_c 3 Apr 2020 03:12:38 -0000
> @@ -0,0 +1,129 @@
> +--- coregrind/m_libcfile.c
> ++++ coregrind/m_libcfile.c
> +@@ -40,6 +40,9 @@
> + #include "pub_core_xarray.h"
> + #include "pub_core_clientstate.h" // VG_(fd_hard_limit)
> + #include "pub_core_syscall.h"
> ++#if defined(VGO_openbsd)
> ++#include "pub_core_mallocfree.h"
> ++

No comments:

Post a Comment