Re: 答复: [HELP] Android use LD to link the program but the valgrind can not report malloc leak;

John Reiser <[email protected]>
Newsgroups gmane.comp.debugging.valgrind
Message-ID <[email protected]>
On 4/8/19 4:54 PM, Wuweijia wrote:
> localhost:/system/bin # ./valgrind -v --undef-value-errors=no  ./test
> ==30806== Memcheck, a memory error detector
> ==30806== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
> ==30806== Using Valgrind-3.14.0-353a3587bb-20181007X and LibVEX; rerun with -h for copyright info

> linker: Warning: "/system_Q_EA3/lib64/valgrind/vgpreload_core-arm64-linux.so" has unsupported flags DT_FLAGS_1=0x421 (ignoring unsupported flags)
> WARNING: linker: Warning: "/system_Q_EA3/lib64/valgrind/vgpreload_core-arm64-linux.so" has unsupported flags DT_FLAGS_1=0x421 (ignoring unsupported flags)
> linker: Warning: "/system_Q_EA3/lib64/valgrind/vgpreload_memcheck-arm64-linux.so" has unsupported flags DT_FLAGS_1=0x421 (ignoring unsupported flags)
> WARNING: linker: Warning: "/system_Q_EA3/lib64/valgrind/vgpreload_memcheck-arm64-linux.so" has unsupported flags DT_FLAGS_1=0x421 (ignoring unsupported flags)

Please visit https://bugs.kde.org/show_bug.cgi?id=406349
and enter the version of Android and/or /system_Q_EA3/bin/linker64
into an Additional Comment.  Also please attach the source code
of the test program ./test to the valgrind bug report.

The Android run-time linker /system_Q_EA3/bin/linker64
does not understand important flags in the DF_FLAGS_1
data item of the PT_DYNAMIC "segment" of
/lib64/valgrind/vgpreload_core-arm64-linux.so
and other valgrind shared libraries.
As a result, memcheck does not re-direct nor intercept calls
to malloc() or free().  This cripples memcheck.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.