Valgrind's memory management: out of memory:

I don’t see problem with WP76 R13 with attached binary:
valgrind.rar (3.3 MB)

  1. mkdir /tmp/valgrind
  2. mkdir /tmp/tmp_lib;mkdir /tmp/tmp_lib_wr;
  3. cp -rf /lib /tmp/tmp_lib
  4. mount -t overlay overlay /lib -o lowerdir=/lib,upperdir=/tmp/tmp_lib,workdir=/tmp/tmp_lib_wr;
  5. Use WINSCP to transfer all the binary to /tmp/valgrind
  6. Use WINSCP to transfer ld-linux.so.3 to /lib ( cannot copy directly from /tmp/valgrind to /lib)

chmod -R 777 /tmp/valgrind
export VALGRIND_LIB=/tmp/valgrind


root@swi-mdm9x28-wp:/tmp/valgrind# ./valgrind --leak-check=full --show-leak-kind
s=all  --verbose ./vgdb
==2961== Memcheck, a memory error detector
==2961== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2961== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==2961== Command: ./vgdb
==2961==
--2961-- Valgrind options:
--2961--    --leak-check=full
--2961--    --show-leak-kinds=all
--2961--    --verbose
--2961-- Contents of /proc/version:
--2961--   Linux version 3.18.131 (oe-user@oe-host) (gcc version 7.3.0 (GCC) ) #1 PREEMPT Tue May 21 06:09:42 UTC 2019
--2961--
--2961-- Arch and hwcaps: ARM, LittleEndian, ARMv7-neon-vfp
--2961-- Page sizes: currently 4096, max supported 4096
--2961-- Valgrind library directory: /tmp/valgrind
--2961-- Reading syms from /tmp/valgrind/vgdb
--2961-- Reading syms from /lib/ld-2.27.so
--2961-- Reading syms from /tmp/valgrind/memcheck-arm-linux
--2961--    object doesn't have a dynamic symbol table
--2961-- Scheduler: using generic scheduler lock implementation.
--2961-- Reading suppressions file: /tmp/valgrind/default.supp
==2961== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-2961-by-root-on-???
==2961== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-2961-by-root-on-???
==2961== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-2961-by-root-on-???
==2961==
==2961== TO CONTROL THIS PROCESS USING vgdb (which you probably
==2961== don't want to do, unless you know exactly what you're doing,
==2961== or are doing some strange experiment):
==2961==   /tmp/valgrind/../../bin/vgdb --pid=2961 ...command...
==2961==
==2961== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==2961==   /path/to/gdb ./vgdb
==2961== and then give GDB the following command
==2961==   target remote | /tmp/valgrind/../../bin/vgdb --pid=2961
==2961== --pid is optional if only one valgrind process is running
==2961==
--2961-- REDIR: 0x401a781 (ld-linux.so.3:strlen) redirected to 0x5805721c (???)
--2961-- REDIR: 0x401b300 (ld-linux.so.3:memcpy) redirected to 0x58057248 (???)
--2961-- REDIR: 0x401a071 (ld-linux.so.3:strcmp) redirected to 0x58057354 (???)
--2961-- Reading syms from /tmp/valgrind/vgpreload_core-arm-linux.so
--2961-- Reading syms from /lib/libpthread-2.27.so
--2961--   Considering /lib/libpthread-2.27.so ..
--2961--   .. CRC mismatch (computed 35a2dcd2 wanted 1371a2a7)
--2961--    object doesn't have a symbol table
--2961--   Reading EXIDX entries: 83 available
==2961==   Warning: whilst reading EXIDX: Implausible EXIDX last entry size 4294967199; using 1 instead.
--2961--   Reading EXIDX entries: 69 attempted, 69 successful
--2961-- Reading syms from /lib/libc-2.27.so
--2961--   Considering /lib/libc-2.27.so ..
--2961--   .. CRC mismatch (computed a90d284b wanted b733a7cc)
--2961--    object doesn't have a symbol table
--2961--   Reading EXIDX entries: 729 available
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryExtract: bytecode can't be represented
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==2961==   Warning: whilst reading EXIDX: Implausible EXIDX last entry size 4294964239; using 1 instead.
--2961--   Reading EXIDX entries: 530 attempted, 424 successful
==2961== Conditional jump or move depends on uninitialised value(s)
==2961==    at 0x454E5000: strlen (in /lib/libc-2.27.so)
==2961==
==2961== Use of uninitialised value of size 4
==2961==    at 0x454E483C: strcpy (in /lib/libc-2.27.so)
==2961==
Using vgdb standalone implies to give -D or -l or a COMMAND
args error. Try `vgdb --help` for more information
==2961==
==2961== HEAP SUMMARY:
==2961==     in use at exit: 0 bytes in 0 blocks
==2961==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==2961==
==2961== All heap blocks were freed -- no leaks are possible
==2961==
==2961== Use --track-origins=yes to see where uninitialised values come from
==2961== ERROR SUMMARY: 12 errors from 2 contexts (suppressed: 3 from 3)
==2961==
==2961== 1 errors in context 1 of 2:
==2961== Conditional jump or move depends on uninitialised value(s)
==2961==    at 0x454E5000: strlen (in /lib/libc-2.27.so)
==2961==
==2961==
==2961== 11 errors in context 2 of 2:
==2961== Use of uninitialised value of size 4
==2961==    at 0x454E483C: strcpy (in /lib/libc-2.27.so)
==2961==
--2961--
--2961-- used_suppression:      3 dl-hack3-cond-1 /tmp/valgrind/default.supp:1236
==2961==
==2961== ERROR SUMMARY: 12 errors from 2 contexts (suppressed: 3 from 3)