--track-origins option is not working

subhasish Karmakar <[email protected]>
Newsgroups gmane.comp.debugging.valgrind
Message-ID <CAHUeUU=GYmZpKZnS-bnUmVfPMYHJVkgvmBtzAM3dshU_35gXsQ@mail.gmail.com>
Hi,

I am using embedded linux to run my application.

I do not get any memory leak information with valgrind, when I set “
*--track-origins=yes*”.

Without *--track-origins* option, I can see memory leak errors, but file
name and line number is not displayed.

I have attached valgrind logs for reference.



My application is compiled with “*-g -o0*” compiler flags and my
open-embedded core does not support GDB.
Kindly let me know, how to get more debug information for memory leaks in
my application.

Thanks for your support,
Subhasish

_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
valgrind.log (application/octet-stream, 4.6 KB)
==2410== Memcheck, a memory error detector
==2410== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2410== Using Valgrind-3.14.0-353a3587bb-20181007X and LibVEX; rerun with -h for copyright info
==2410== Command: /usr/bin/control_app
==2410== Parent PID: 1
==2410== 
--2410-- 
--2410-- Valgrind options:
--2410--    --tool=memcheck
--2410--    --leak-check=full
--2410--    --show-leak-kinds=all
--2410--    --verbose
--2410--    --log-file=/data/valgrind.log
--2410-- Contents of /proc/version:
--2410--   Linux version 3.18.31 (user@ubuntu-72) (gcc version 4.9.2 (GCC) ) #1 PREEMPT Thu Jun 13 00:15:08 IST 2019
--2410-- 
--2410-- Arch and hwcaps: ARM, LittleEndian, ARMv7-neon-vfp
--2410-- Page sizes: currently 4096, max supported 4096
--2410-- Valgrind library directory: /usr/lib/valgrind
--2410-- Reading syms from /usr/bin/control_app
--2410-- Reading syms from /lib/ld-linux.so.3
--2410--   Considering /lib/.debug/ld-2.21.so ..
--2410--   .. CRC is valid
--2410-- Reading syms from /usr/lib/valgrind/memcheck-arm-linux
--2410--   Considering /usr/lib/valgrind/memcheck-arm-linux ..
--2410--   .. CRC mismatch (computed b87daa76 wanted 76f7664c)
--2410--    object doesn't have a symbol table
--2410--    object doesn't have a dynamic symbol table
--2410--   Reading EXIDX entries: 1 available
--2410--   Reading EXIDX entries: 0 attempted, 0 successful
--2410-- Scheduler: using generic scheduler lock implementation.
--2410-- Reading suppressions file: /usr/lib/valgrind/default.supp
==2410== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-2410-by-???-on-???
==2410== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-2410-by-???-on-???
==2410== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-2410-by-???-on-???
==2410== 
==2410== TO CONTROL THIS PROCESS USING vgdb (which you probably
==2410== don't want to do, unless you know exactly what you're doing,
==2410== or are doing some strange experiment):
==2410==   /usr/lib/valgrind/../../bin/vgdb --pid=2410 ...command...
==2410== 
==2410== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==2410==   /path/to/gdb /usr/bin/control_app
==2410== and then give GDB the following command
==2410==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=2410
==2410== --pid is optional if only one valgrind process is running
==2410== 
--2410-- REDIR: 0x4e8aa940 (ld-linux.so.3:memcpy) redirected to 0x580e64dc (???)
--2410-- REDIR: 0x4e8a9e01 (ld-linux.so.3:strlen) redirected to 0x580e6478 (???)
--2410-- REDIR: 0x4e8a9851 (ld-linux.so.3:strcmp) redirected to 0x580e65e8 (???)
--2410-- REDIR: 0x4e8a9760 (ld-linux.so.3:index) redirected to 0x580e64a4 (???)
--2410-- Reading syms from /usr/lib/valgrind/vgpreload_core-arm-linux.so
--2410--   Considering /usr/lib/valgrind/vgpreload_core-arm-linux.so ..
--2410--   .. CRC mismatch (computed 07e33f1a wanted ebe17f35)
--2410--    object doesn't have a symbol table
--2410-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-arm-linux.so
--2410--   Considering /usr/lib/valgrind/vgpreload_memcheck-arm-linux.so ..
--2410--   .. CRC mismatch (computed 858fd227 wanted 542f00a9)
--2410--    object doesn't have a symbol table
--2410-- REDIR: 0x4e8aa880 (ld-linux.so.3:mempcpy) redirected to 0x480f98c (mempcpy)
--2410-- Reading syms from /lib/libc.so.6
--2410--   Considering /lib/.debug/libc-2.21.so ..
--2410--   .. CRC is valid
--2410-- REDIR: 0x4e938080 (libc.so.6:rindex) redirected to 0x4809fb0 (rindex)
--2410-- REDIR: 0x4e93b9c0 (libc.so.6:strchrnul) redirected to 0x480f528 (strchrnul)
--2410-- REDIR: 0x4e939840 (libc.so.6:mempcpy) redirected to 0x480f65c (mempcpy)
--2410-- REDIR: 0x4e932c7c (libc.so.6:malloc) redirected to 0x48067a0 (malloc)
--2410-- REDIR: 0x4e9333f8 (libc.so.6:free) redirected to 0x4807cec (free)
--2410-- REDIR: 0x4e9397c0 (libc.so.6:memset) redirected to 0x480e974 (memset)
==2410== 
==2410== HEAP SUMMARY:
==2410==     in use at exit: 40 bytes in 1 blocks
==2410==   total heap usage: 1 allocs, 0 frees, 40 bytes allocated
==2410== 
==2410== Searching for pointers to 1 not-freed blocks
==2410== Checked 41,860 bytes
==2410== 
==2410== 40 bytes in 1 blocks are definitely lost in loss record 1 of 1
==2410==    at 0x4806844: malloc (in /usr/lib/valgrind/vgpreload_memcheck-arm-linux.so)
==2410== 
==2410== LEAK SUMMARY:
==2410==    definitely lost: 40 bytes in 1 blocks
==2410==    indirectly lost: 0 bytes in 0 blocks
==2410==      possibly lost: 0 bytes in 0 blocks
==2410==    still reachable: 0 bytes in 0 blocks
==2410==         suppressed: 0 bytes in 0 blocks
==2410== 
==2410== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==2410== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
valgrind-track-origin.log (application/octet-stream, 4 KB)

==2355== Memcheck, a memory error detector
==2355== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2355== Using Valgrind-3.14.0-353a3587bb-20181007X and LibVEX; rerun with -h for copyright info
==2355== Command: /usr/bin/control_app
==2355== Parent PID: 1
==2355== 
--2355-- 
--2355-- Valgrind options:
--2355--    --tool=memcheck
--2355--    --leak-check=full
--2355--    --show-leak-kinds=all
--2355--    --track-origins=yes
--2355--    --verbose
--2355--    --log-file=/data/valgrind.log
--2355-- Contents of /proc/version:
--2355--   Linux version 3.18.31 (user@ubuntu-72) (gcc version 4.9.2 (GCC) ) #1 PREEMPT Thu Jun 13 00:15:08 IST 2019
--2355-- 
--2355-- Arch and hwcaps: ARM, LittleEndian, ARMv7-neon-vfp
--2355-- Page sizes: currently 4096, max supported 4096
--2355-- Valgrind library directory: /usr/lib/valgrind
--2355-- core    :     8,388,608/    8,388,608 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd,         12,352/       10,956 max/curr,          39/     24388 totalloc-blocks/bytes,          37 searches 4 rzB
--2355-- dinfo   :             0/            0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd,              0/            0 max/curr,           0/         0 totalloc-blocks/bytes,           0 searches 4 rzB
--2355-- client  :             0/            0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd,              0/            0 max/curr,           0/         0 totalloc-blocks/bytes,           0 searches 20 rzB
--2355-- demangle:             0/            0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd,              0/            0 max/curr,           0/         0 totalloc-blocks/bytes,           0 searches 4 rzB
--2355-- ttaux   :             0/            0 max/curr mmap'd, 0/0 unsplit/split sb unmmap'd,              0/            0 max/curr,           0/         0 totalloc-blocks/bytes,           0 searches 4 rzB
--2355-- translate: no SP updates identified
--2355-- translate: PX: SPonly 0,  UnwRegs 0,  AllRegs 0,  AllRegsAllInsns 0
--2355--     tt/tc: 0 tt lookups requiring 0 probes
--2355--     tt/tc: 0 fast-cache updates, 0 flushes
--2355--  transtab: new        0 (0 -> 0; ratio 0.0) [0 scs] avg tce size 0
--2355--  transtab: dumped     0 (0 -> ??) (sectors recycled 0)
--2355--  transtab: discarded  0 (0 -> ??)
--2355-- scheduler: 0 event checks.
--2355-- scheduler: 0 indir transfers, 0 misses (1 in 0)
--2355-- scheduler: 0/0 major/minor sched events.
--2355--    sanity: 0 cheap, 0 expensive checks.
--2355--    exectx: 769 lists, 1 contexts (avg 0.00 per list) (avg 1.00 IP per context)
--2355--    exectx: 2 searches, 1 full compares (500 per 1000)
--2355--    exectx: 0 cmp2, 0 cmp4, 0 cmpAll
--2355--  errormgr: 0 supplist searches, 0 comparisons during search
--2355--  errormgr: 0 errlist searches, 0 comparisons during search
--2355--  memcheck: freelist: vol 0 length 0
--2355--  memcheck: sanity checks: 0 cheap, 1 expensive
--2355--  memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--2355--  memcheck: auxmaps_L1: 0 searches, 0 cmps, ratio 0:10
--2355--  memcheck: auxmaps_L2: 0 searches, 0 nodes
--2355--  memcheck: SMs: n_issued      = 0 (0k, 0M)
--2355--  memcheck: SMs: n_deissued    = 0 (0k, 0M)
--2355--  memcheck: SMs: max_noaccess  = 0 (0k, 0M)
--2355--  memcheck: SMs: max_undefined = 0 (0k, 0M)
--2355--  memcheck: SMs: max_defined   = 0 (0k, 0M)
--2355--  memcheck: SMs: max_non_DSM   = 0 (0k, 0M)
--2355--  memcheck: max sec V bit nodes:    0 (0k, 0M)
--2355--  memcheck: set_sec_vbits8 calls: 0 (new: 0, updates: 0)
--2355--  memcheck: max shadow mem size:   304k, 0M
--2355--  ocacheL1:            0 refs              0 misses (0 lossage)
--2355--  ocacheL1:            0 at 0              0 at 1
--2355--  ocacheL1:            0 at 2+             0 move-fwds
--2355--  ocacheL1:   92,274,688 sizeB    67,108,864 useful
--2355--  ocacheL2:            0 refs              0 misses
--2355--  ocacheL2:            0 max nodes         0 curr nodes
--2355--  niacache:            0 refs              0 misses
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.