https://bugs.kde.org/show_bug.cgi?id=406349

            Bug ID: 406349
           Summary: Android runtime linker ignores DF_1_INTERPOSE in
                    vgpreload_core-*
           Product: valgrind
           Version: 3.14.0
          Platform: Android
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: memcheck
          Assignee: jsew...@acm.org
          Reporter: jrei...@bitwagon.com
  Target Milestone: ---

SUMMARY
The Android runtime linker /bin/linker64 does not understand the DF_1_INTERPOSE
and DF_1_INITFIRST flags in DF_FLAGS_1 as used by vgpreload_core_* of
valgrind-3.14.  As a result no re-directions or interceptions of calls to
malloc/free/etc are performed.  Thus memcheck does not track allocations, so
there is no leak checking.


STEPS TO REPRODUCE
1. Build a simple leak-producing test program as an ET_DYN executable file for
Android.
2. Run valgrind (memcheck) on the test program under Android
3. 

OBSERVED RESULT
No leak reported because malloc is not tracked.


EXPECTED RESULT
malloc is tracked, and leak is reported.


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Originally posted in [valgrind-users] by wuweijia@h###.com on 2019-Apr-08
Terminal transcript:
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
==30806== Command: ./test
==30806==
--30806-- Valgrind options:
--30806--    -v
--30806--    --undef-value-errors=no
--30806-- Contents of /proc/version:
--30806--   Linux version 4.4.7+ (root@baixin-HP-Compaq-8200-Elite-MT-PC) (gcc
version 4.9.3 20151223 (prerelease) (SDK V100R005C00SPC030B080) ) #1 SMP
PREEMPT Fri Sep 9 14:57:05 CST 2016
--30806--
--30806-- Arch and hwcaps: ARM64, LittleEndian, baseline
--30806-- Page sizes: currently 4096, max supported 65536
--30806-- Valgrind library directory: /system/lib64/valgrind
--30806-- Reading syms from /system_Q_EA3/bin/test
--30806-- Reading syms from /system_Q_EA3/bin/linker64
--30806-- Scheduler: using generic scheduler lock implementation.
--30806-- Reading suppressions file: /system/lib64/valgrind/default.supp
--30806-- Reading syms from /system_Q_EA3/lib64/libm.so
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)
new lld  p=0x5613000
==30806==
==30806== HEAP SUMMARY:
==30806==     in use at exit: 0 bytes in 0 blocks
==30806==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==30806==
==30806== All heap blocks were freed -- no leaks are possible
==30806==
==30806== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==30806== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)


----- /usr/include/elf.h
#define DF_1_INTERPOSE  0x00000400      /* Object is used to interpose.  */
#define DF_1_INITFIRST  0x00000020      /* Set RTLD_INITFIRST for this object*/
#define DF_1_NOW        0x00000001      /* Set RTLD_NOW for this object.  */

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to