x86 - cross-compiled Valgrind does not detect obvious leaks -
i cross compiled valgrind openwrt x86 platform. doesn't detect leaks when running on target. on ubuntu, works fine.
my test program simple
main() { char *p = malloc(10000); *(p-1) = 1; }
relevant compilation steps
i486-openwrt-linux-uclibc-gcc -c -o leak.o -pipe -march=i486 -fhonour-copts -i/home/r2/external/openwrt/staging_dir/target-i386_uclibc-0.9.30.1/usr/include -i/home/r2/external/openwrt/staging_dir/target-i386_uclibc-0.9.30.1/include -i/home/r2/external/openwrt/staging_dir/toolchain-i386_gcc-4.1.2_uclibc-0.9.30.1/include -o0 -g -i. -idbus -i/home/r2/external/openwrt/staging_dir/target-i386_uclibc-0.9.30.1/usr/include leak.c leak.c: in function 'main': leak.c:3: warning: incompatible implicit declaration of built-in function 'malloc' cc leak.c i486-openwrt-linux-uclibc-gcc leak.o -l/hom e/r2/external/openwrt/staging_dir/target-i386_uclibc-0.9.30.1/usr/lib -l/home/r2/external/openwrt/staging_dir/target-i386_uclibc-0.9.30.1/lib -l/home/r2/external/openwrt/staging_dir/toolchain-i386_gcc-4.1.2_uclibc-0.9.30.1/lib -o leak ld leak
it's not statically linked. objdump confirms that
objdump -x build_dir/target-i386_uclibc-0.9.30.1/test/leak build_dir/target-i386_uclibc-0.9.30.1/test/leak: file format elf32-i386 build_dir/target-i386_uclibc-0.9.30.1/test/leak architecture: i386, flags 0x00000112: exec_p, has_syms, d_paged start address 0x08048340 program header: phdr off 0x00000034 vaddr 0x08048034 paddr 0x08048034 align 2**2 filesz 0x000000c0 memsz 0x000000c0 flags r-x interp off 0x000000f4 vaddr 0x080480f4 paddr 0x080480f4 align 2**0 filesz 0x00000014 memsz 0x00000014 flags r-- load off 0x00000000 vaddr 0x08048000 paddr 0x08048000 align 2**12 filesz 0x000004ac memsz 0x000004ac flags r-x load off 0x000004ac vaddr 0x080494ac paddr 0x080494ac align 2**12 filesz 0x000000f4 memsz 0x00000110 flags rw- dynamic off 0x000004c0 vaddr 0x080494c0 paddr 0x080494c0 align 2**2 filesz 0x000000b8 memsz 0x000000b8 flags rw- stack off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2 filesz 0x00000000 memsz 0x00000000 flags rw- dynamic section: needed libgcc_s.so.1 needed libc.so.0 init 0x080482d4 fini 0x08048490 hash 0x08048108 strtab 0x080481e4 symtab 0x08048144 strsz 0x0000009c syment 0x00000010 debug 0x00000000 pltgot 0x08049578 pltrelsz 0x00000020 pltrel 0x00000011 jmprel 0x080482b4 verneed 0x08048294 verneednum 0x00000001 versym 0x08048280 version references: required libgcc_s.so.1: 0x0b792650 0x00 02 gcc_3.0 sections: idx name size vma lma file off algn 0 .interp 00000014 080480f4 080480f4 000000f4 2**0 contents, alloc, load, readonly, data 1 .hash 0000003c 08048108 08048108 00000108 2**2 contents, alloc, load, readonly, data 2 .dynsym 000000a0 08048144 08048144 00000144 2**2 contents, alloc, load, readonly, data 3 .dynstr 0000009c 080481e4 080481e4 000001e4 2**0 contents, alloc, load, readonly, data 4 .gnu.version 00000014 08048280 08048280 00000280 2**1 contents, alloc, load, readonly, data 5 .gnu.version_r 00000020 08048294 08048294 00000294 2**2 contents, alloc, load, readonly, data 6 .rel.plt 00000020 080482b4 080482b4 000002b4 2**2 contents, alloc, load, readonly, data 7 .init 0000001c 080482d4 080482d4 000002d4 2**0 contents, alloc, load, readonly, code 8 .plt 00000050 080482f0 080482f0 000002f0 2**2 contents, alloc, load, readonly, code 9 .text 00000150 08048340 08048340 00000340 2**4 contents, alloc, load, readonly, code 10 .fini 00000017 08048490 08048490 00000490 2**0 contents, alloc, load, readonly, code 11 .eh_frame 00000004 080484a8 080484a8 000004a8 2**2 contents, alloc, load, readonly, data 12 .ctors 00000008 080494ac 080494ac 000004ac 2**2 contents, alloc, load, data 13 .dtors 00000008 080494b4 080494b4 000004b4 2**2 contents, alloc, load, data 14 .jcr 00000004 080494bc 080494bc 000004bc 2**2 contents, alloc, load, data 15 .dynamic 000000b8 080494c0 080494c0 000004c0 2**2 contents, alloc, load, data 16 .got.plt 0000001c 08049578 08049578 00000578 2**2 contents, alloc, load, data 17 .data 0000000c 08049594 08049594 00000594 2**2 contents, alloc, load, data 18 .bss 0000001c 080495a0 080495a0 000005a0 2**2 alloc 19 .comment 00000036 00000000 00000000 000005a0 2**0 contents, readonly 20 .debug_aranges 00000020 00000000 00000000 000005d6 2**0 contents, readonly, debugging 21 .debug_pubnames 0000001b 00000000 00000000 000005f6 2**0 contents, readonly, debugging 22 .debug_info 000000b1 00000000 00000000 00000611 2**0 contents, readonly, debugging 23 .debug_abbrev 0000004e 00000000 00000000 000006c2 2**0 contents, readonly, debugging 24 .debug_line 00000039 00000000 00000000 00000710 2**0 contents, readonly, debugging 25 .debug_frame 00000058 00000000 00000000 0000074c 2**2 contents, readonly, debugging 26 .debug_loc 00000043 00000000 00000000 000007a4 2**0 contents, readonly, debugging symbol table: 080480f4 l d .interp 00000000 .interp 08048108 l d .hash 00000000 .hash 08048144 l d .dynsym 00000000 .dynsym 080481e4 l d .dynstr 00000000 .dynstr 08048280 l d .gnu.version 00000000 .gnu.version 08048294 l d .gnu.version_r 00000000 .gnu.version_r 080482b4 l d .rel.plt 00000000 .rel.plt 080482d4 l d .init 00000000 .init 080482f0 l d .plt 00000000 .plt 08048340 l d .text 00000000 .text 08048490 l d .fini 00000000 .fini 080484a8 l d .eh_frame 00000000 .eh_frame 080494ac l d .ctors 00000000 .ctors 080494b4 l d .dtors 00000000 .dtors 080494bc l d .jcr 00000000 .jcr 080494c0 l d .dynamic 00000000 .dynamic 08049578 l d .got.plt 00000000 .got.plt 08049594 l d .data 00000000 .data 080495a0 l d .bss 00000000 .bss 00000000 l d .comment 00000000 .comment 00000000 l d .debug_aranges 00000000 .debug_aranges 00000000 l d .debug_pubnames 00000000 .debug_pubnames 00000000 l d .debug_info 00000000 .debug_info 00000000 l d .debug_abbrev 00000000 .debug_abbrev 00000000 l d .debug_line 00000000 .debug_line 00000000 l d .debug_frame 00000000 .debug_frame 00000000 l d .debug_loc 00000000 .debug_loc 00000000 l df *abs* 00000000 crtstuff.c 080494ac l o .ctors 00000000 __ctor_list__ 080494b4 l o .dtors 00000000 __dtor_list__ 080484a8 l o .eh_frame 00000000 __eh_frame_begin__ 080494bc l o .jcr 00000000 __jcr_list__ 080495a0 l o .bss 00000001 completed.2431 0804959c l o .data 00000000 p.2429 08048370 l f .text 00000000 __do_global_dtors_aux 080495a4 l o .bss 00000018 object.2483 080483d0 l f .text 00000000 frame_dummy 00000000 l df *abs* 00000000 crtstuff.c 080494b0 l o .ctors 00000000 __ctor_end__ 080494b8 l o .dtors 00000000 __dtor_end__ 080484a8 l o .eh_frame 00000000 __frame_end__ 080494bc l o .jcr 00000000 __jcr_end__ 08048460 l f .text 00000000 __do_global_ctors_aux 00000000 l df *abs* 00000000 initfini.c 00000000 l df *abs* 00000000 leak.c 080494c0 l o .dynamic 00000000 .hidden _dynamic 08049598 l o .data 00000000 .hidden __dso_handle 08049578 l o .got.plt 00000000 .hidden _global_offset_table_ 00000000 f *und* 00000000 malloc 08048310 w f *und* 00000000 __deregister_frame_info_bases@@gcc_3.0 080482d4 g f .init 00000000 _init 08048340 g f .text 00000022 _start 00000000 f *und* 00000000 __uclibc_main 080495a0 g *abs* 00000000 __bss_start 08048424 g f .text 00000033 main 08048330 w f *und* 00000000 __register_frame_info_bases@@gcc_3.0 08049594 w .data 00000000 data_start 08048490 g f .fini 00000000 _fini 08048364 g f .text 00000000 .hidden __get_pc_thunk_bx 080495a0 g *abs* 00000000 _edata 080495bc g *abs* 00000000 _end 08049594 g .data 00000000 __data_start 00000000 w *und* 00000000 _jv_registerclasses
here valgrind output on target x86 board
valgrind --leak-check=full -v -d -d -d -d -d ./leak --5221:1:debuglog debuglog system started stage 1, level 5 logging requested --5221:1:launcher no tool requested, defaulting 'memcheck' --5221:2:launcher selecting platform './leak' --5221:2:launcher selecting platform './leak' --5221:2:launcher opened './leak' --5221:2:launcher read 4096 bytes './leak' --5221:2:launcher selected platform 'x86-linux' --5221:1:launcher selected platform 'x86-linux' --5221:1:launcher launching /usr/lib/valgrind/memcheck-x86-linux --5221:1:debuglog debuglog system started stage 2 (main), level 5 logging requested --5221:1:main welcome valgrind version 3.8.0 debug logging --5221:1:main checking current stack plausible --5221:1:main checking initial stack noted --5221:1:main starting address space manager --5221:2:aspacem sp_at_startup = 0x00bfafb800 (supplied) --5221:2:aspacem minaddr = 0x0004000000 (computed) --5221:2:aspacem maxaddr = 0x00bfafafff (computed) --5221:2:aspacem cstart = 0x0004000000 (computed) --5221:2:aspacem vstart = 0x0061d7e000 (computed) --5221:2:aspacem suggested_clstack_top = 0x00beafbfff (computed) --5221:2:aspacem <<< show_segments: initial layout (5 segments, 0 segnames) --5221:2:aspacem 0: rsvn 0000000000-0003ffffff 64m ----- smfixed --5221:2:aspacem 1: 0004000000-0061d7dfff 1501m --5221:2:aspacem 2: rsvn 0061d7e000-0061d7efff 4096 ----- smfixed --5221:2:aspacem 3: 0061d7f000-00bfafafff 1501m --5221:2:aspacem 4: rsvn 00bfafb000-00ffffffff 1029m ----- smfixed --5221:2:aspacem >>> --5221:2:aspacem reading /proc/self/maps --5221:2:aspacem <<< show_segments: contents of /proc/self/maps (12 segments, 1 segnames) --5221:2:aspacem ( 0) /usr/lib/valgrind/memcheck-x86-linux --5221:2:aspacem 0: rsvn 0000000000-0003ffffff 64m ----- smfixed --5221:2:aspacem 1: 0004000000-0037ffffff 832m --5221:2:aspacem 2: file 0038000000-0038288fff 2658304 r-x-- d=0x803 i=33422 o=4096 (0) --5221:2:aspacem 3: file 0038289000-003828afff 8192 rw--- d=0x803 i=33422 o=2658304 (0) --5221:2:aspacem 4: anon 003828b000-0038d20fff 10m rw--- --5221:2:aspacem 5: 0038d21000-0061d7dfff 656m --5221:2:aspacem 6: rsvn 0061d7e000-0061d7efff 4096 ----- smfixed --5221:2:aspacem 7: 0061d7f000-00bfae7fff 1501m --5221:2:aspacem 8: anon 00bfae8000-00bfafcfff 86016 rw--- --5221:2:aspacem 9: rsvn 00bfafd000-00ffffdfff 1029m ----- smfixed --5221:2:aspacem 10: anon 00ffffe000-00ffffefff 4096 r-x-- --5221:2:aspacem 11: rsvn 00fffff000-00ffffffff 4096 ----- smfixed --5221:2:aspacem >>> --5221:1:main address space manager running --5221:1:main starting dynamic memory manager --5221:1:mallocfr newsuperblock @ 0x61d7f000 (pszb 4194288) owner valgrind/tool --5221:1:mallocfr deferred_reclaimsuperblock @ 0x61d7f000 (pszb 4194288) (prev 0x0) owner valgrind/tool --5221:1:main dynamic memory manager running --5221:1:main initialise m_debuginfo --5221:1:main vg_(libdir) = /usr/lib/valgrind --5221:1:main getting launcher's name ... --5221:1:main ... /usr/bin/valgrind --5221:1:main hardware capabilities ... --5221:1:main ... arch = x86, hwcaps = x86-sse1-sse2 --5221:1:main getting working directory @ startup --5221:1:main ... /root --5221:1:main split command line --5221:1:main (early_) process valgrind's command line options --5221:1:main create initial image --5221:1:initimg loading client --5221:1:initimg setup client env --5221:2:initimg preload_string: --5221:2:initimg "/usr/lib/valgrind/vgpreload_core-x86-linux.so:/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so" --5221:1:initimg setup client stack: size 16777216 --5221:2:initimg client info: initial_ip=0x40008b4 initial_toc=0x0 brk_base=0x804a000 --5221:2:initimg client info: initial_sp=0xbeafbd80 max_stack_size=16777216 --5221:1:initimg setup client data (brk) segment --5221:1:main setup file descriptors --5221:1:main create fake /proc/<pid>/cmdline --5221:1:main initialise tool part 1 (pre_clo_init) --5221:1:mallocfr deferred_reclaimsuperblock null (prev 0x61d7f000) owner valgrind/tool --5221:1:mallocfr newsuperblock @ 0x6217f000 (pszb 1048560) owner valgrind/exectxt --5221:1:main print , quit, if requested --5221:1:main (main_) process valgrind's command line options, setup logging --5221:1:mallocfr newsuperblock @ 0x6227f000 (pszb 1048560) owner valgrind/core --5221:1:main print preamble... ==5221== memcheck, memory error detector ==5221== copyright (c) 2002-2012, , gnu gpl'd, julian seward et al. ==5221== using valgrind-3.8.0 , libvex; rerun -h copyright info ==5221== command: ./leak ==5221== --5221-- valgrind options: --5221-- --leak-check=full --5221-- -v --5221-- -d --5221-- -d --5221-- -d --5221-- -d --5221-- -d --5221-- contents of /proc/version: --5221-- linux version 2.6.32.27 (ramesh@r2) (gcc version 4.1.2) #16 mon apr 1 15:37:49 pdt 2013 --5221-- arch , hwcaps: x86, x86-sse1-sse2 --5221-- page sizes: 4096, max supported 4096 --5221-- valgrind library directory: /usr/lib/valgrind --5221:1:main ...finished preamble --5221:1:main initialise tool part 2 (post_clo_init) --5221:1:main initialise tt/tc --5221:2:transtab cache: 8 sectors of 27597024 bytes each = 220776192 total --5221:2:transtab table: 524168 total entries, max occupancy 340704 (65%) --5221:1:main initialise redirects --5221:1:mallocfr newsuperblock @ 0x623fa000 (pszb 1048560) owner valgrind/dinfo --5221:1:main load initial debug info --5221-- reading syms /root/leak --5221:1:redir transfer ownership v -> c of 0x3803d000 .. 0x3803dfff --5221:1:main initialise scheduler (phase 1) --5221:1:sched sched_init_phase1 --5221-- scheduler: using generic scheduler lock implementation. --5221:1:main tell tool initial permissions --5221:2:main tell tool 0004000000-0004003fff r-x --5221:2:main tell tool 0004004000-0004005fff rw- --5221:2:main tell tool 0008048000-0008048fff r-x --5221:2:main tell tool 0008049000-0008049fff rw- --5221:2:main tell tool 000804a000-000804afff rwx --5221:2:main tell tool 003803d000-003803dfff r-x --5221:2:main tell tool 00beafb000-00beafbfff rwx --5221:2:main mark stack inaccessible 00beafb000-00beafbd7f --5221:1:main initialise scheduler (phase 2) --5221:1:sched sched_init_phase2: tid_main=1, cls_end=0xbeafbfff, cls_sz=16777216 --5221:1:main finalise initial image --5221:1:main initialise signal management --5221:1:main load suppressions --5221-- reading suppressions file: /usr/lib/valgrind/default.supp --5221:2:stacks register 0xbeafb000-0xbeafbfff stack 0 --5221:1:main --5221:1:main --5221:1:aspacem <<< show_segments: memory layout @ client startup (25 segments, 3 segnames) --5221:1:aspacem ( 0) /usr/lib/valgrind/memcheck-x86-linux --5221:1:aspacem ( 1) /root/leak --5221:1:aspacem ( 2) /lib/ld-uclibc-0.9.30.1.so --5221:1:aspacem 0: rsvn 0000000000-0003ffffff 64m ----- smfixed --5221:1:aspacem 1: file 0004000000-0004003fff 16384 r-x-- d=0x803 i=86 o=0 (2) --5221:1:aspacem 2: file 0004004000-0004005fff 8192 rw--- d=0x803 i=86 o=12288 (2) --5221:1:aspacem 3: 0004006000-0008047fff 64m --5221:1:aspacem 4: file 0008048000-0008048fff 4096 r-x-- d=0x803 i=33471 o=0 (1) --5221:1:aspacem 5: file 0008049000-0008049fff 4096 rw--- d=0x803 i=33471 o=0 (1) --5221:1:aspacem 6: anon 000804a000-000804afff 4096 rwx-- --5221:1:aspacem 7: rsvn 000804b000-0008849fff 8384512 ----- smlower --5221:1:aspacem 8: 000884a000-0037ffffff 759m --5221:1:aspacem 9: file 0038000000-003803cfff 249856 r-x-- d=0x803 i=33422 o=4096 (0) --5221:1:aspacem 10: file 003803d000-003803dfff 4096 r-x-- d=0x803 i=33422 o=253952 (0) --5221:1:aspacem 11: file 003803e000-0038288fff 2404352 r-x-- d=0x803 i=33422 o=258048 (0) --5221:1:aspacem 12: file 0038289000-003828afff 8192 rw--- d=0x803 i=33422 o=2658304 (0) --5221:1:aspacem 13: anon 003828b000-0038d20fff 10m rw--- --5221:1:aspacem 14: 0038d21000-0061d7dfff 656m --5221:1:aspacem 15: rsvn 0061d7e000-0061d7efff 4096 ----- smfixed --5221:1:aspacem 16: anon 0061d7f000-0062509fff 7909376 rwx-- --5221:1:aspacem 17: 006250a000-00bdafbfff 1461m --5221:1:aspacem 18: rsvn 00bdafc000-00beafafff 15m ----- smupper --5221:1:aspacem 19: anon 00beafb000-00beafbfff 4096 rwx-- --5221:1:aspacem 20: 00beafc000-00bfae7fff 15m --5221:1:aspacem 21: anon 00bfae8000-00bfafcfff 86016 rw--- --5221:1:aspacem 22: rsvn 00bfafd000-00ffffdfff 1029m ----- smfixed --5221:1:aspacem 23: anon 00ffffe000-00ffffefff 4096 r-x-- --5221:1:aspacem 24: rsvn 00fffff000-00ffffffff 4096 ----- smfixed --5221:1:aspacem >>> --5221:1:main --5221:1:main --5221:1:main running thread 1 --5221:1:syswrap- entering vg_(main_thread_wrapper_noreturn) --5221:1:aspacem allocated thread stack @ 0x6250a000 size 1064960 --5221:1:syswrap- run_a_thread_noreturn(tid=1): pre-thread_wrapper --5221:1:syswrap- thread_wrapper(tid=1): entry --5221:1:gdbsrv entering call_gdbserver init_reason ... pid 5221 tid 1 status vgts_runnable sched_jmpbuf_valid 0 --5221:1:gdbsrv gdbserver_init gdbserver embedded in valgrind: gdbserver protocol box extracted gdb 6.6 ==5221== embedded gdbserver: reading /tmp/vgdb-pipe-from-vgdb-to-5221-by-root-on-??? ==5221== embedded gdbserver: writing /tmp/vgdb-pipe-to-vgdb-from-5221-by-root-on-??? ==5221== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-5221-by-root-on-??? ==5221== ==5221== control process using vgdb (which ==5221== don't want do, unless know you're doing, ==5221== or doing strange experiment): ==5221== /usr/lib/valgrind/../../bin/vgdb --pid=5221 ...command... ==5221== ==5221== debug process using gdb: start gdb ==5221== /path/to/gdb ./leak ==5221== , give gdb following command ==5221== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=5221 ==5221== --pid optional if 1 valgrind process running ==5221== --5221:1:gdbsrv opening read side /tmp/vgdb-pipe-from-vgdb-to-5221-by-root-on-??? --5221:1:gdbsrv result fd 3 --5221:1:gdbsrv result safe_fd 1019 --5221:1:transtab allocate sector 0 --5221:1:mallocfr newsuperblock @ 0x64ae1000 (pszb 65520) owner valgrind/ttaux --5221:1:mallocfr newsuperblock @ 0x64af1000 (pszb 65520) owner valgrind/errors --5221:1:signals extending stack base 0xbeafb000 down 4096 --5221:2:stacks change stack 0 0xbeafb000-0xbeafbfff 0xbeafa000-0xbeafbfff --5221:1:syswrap- thread_wrapper(tid=1): exit --5221:1:syswrap- run_a_thread_noreturn(tid=1): post-thread_wrapper --5221:1:syswrap- run_a_thread_noreturn(tid=1): last 1 standing --5221:1:main entering vg_(shutdown_actions_noreturn) --5221:1:aspacem <<< show_segments: memory layout @ client shutdown (43 segments, 8 segnames) --5221:1:aspacem ( 0) /usr/lib/valgrind/memcheck-x86-linux --5221:1:aspacem ( 1) /root/leak --5221:1:aspacem ( 2) /lib/ld-uclibc-0.9.30.1.so --5221:1:aspacem ( 3) /tmp/vgdb-pipe-shared-mem-vgdb-5221-by-root-on-??? --5221:1:aspacem ( 4) /usr/lib/valgrind/vgpreload_core-x86-linux.so --5221:1:aspacem ( 5) /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so --5221:1:aspacem ( 6) /lib/libgcc_s.so.1 --5221:1:aspacem ( 7) /lib/libuclibc-0.9.30.1.so --5221:1:aspacem 0: rsvn 0000000000-0003ffffff 64m ----- smfixed --5221:1:aspacem 1: file 0004000000-0004003fff 16384 r-xt- d=0x803 i=86 o=0 (2) --5221:1:aspacem 2: file 0004004000-0004004fff 4096 r---- d=0x803 i=86 o=12288 (2) --5221:1:aspacem 3: file 0004005000-0004005fff 4096 rw--- d=0x803 i=86 o=16384 (2) --5221:1:aspacem 4: anon 0004006000-0004006fff 4096 rw--- --5221:1:aspacem 5: 0004007000-0004007fff 4096 --5221:1:aspacem 6: file 0004008000-0004008fff 4096 r-xt- d=0x803 i=33412 o=0 (4) --5221:1:aspacem 7: file 0004009000-0004009fff 4096 rw--- d=0x803 i=33412 o=0 (4) --5221:1:aspacem 8: file 000400a000-0004012fff 36864 r-xt- d=0x803 i=33423 o=0 (5) --5221:1:aspacem 9: file 0004013000-0004013fff 4096 rw--- d=0x803 i=33423 o=32768 (5) --5221:1:aspacem 10: file 0004014000-000401dfff 40960 r-xt- d=0x803 i=338 o=0 (6) --5221:1:aspacem 11: file 000401e000-000401efff 4096 rw--- d=0x803 i=338 o=36864 (6) --5221:1:aspacem 12: file 000401f000-0004064fff 286720 r-xt- d=0x803 i=135 o=0 (7) --5221:1:aspacem 13: file 0004065000-0004065fff 4096 r---- d=0x803 i=135 o=282624 (7) --5221:1:aspacem 14: file 0004066000-0004066fff 4096 rw--- d=0x803 i=135 o=286720 (7) --5221:1:aspacem 15: anon 0004067000-000406bfff 20480 rw--- --5221:1:aspacem 16: 000406c000-0008047fff 63m --5221:1:aspacem 17: file 0008048000-0008048fff 4096 r-xt- d=0x803 i=33471 o=0 (1) --5221:1:aspacem 18: file 0008049000-0008049fff 4096 rw--- d=0x803 i=33471 o=0 (1) --5221:1:aspacem 19: anon 000804a000-000804cfff 12288 rwx-- --5221:1:aspacem 20: rsvn 000804d000-0008849fff 8376320 ----- smlower --5221:1:aspacem 21: 000884a000-0037ffffff 759m --5221:1:aspacem 22: file 0038000000-003803cfff 249856 r-x-- d=0x803 i=33422 o=4096 (0) --5221:1:aspacem 23: file 003803d000-003803dfff 4096 r-x-- d=0x803 i=33422 o=253952 (0) --5221:1:aspacem 24: file 003803e000-0038288fff 2404352 r-x-- d=0x803 i=33422 o=258048 (0) --5221:1:aspacem 25: file 0038289000-003828afff 8192 rw--- d=0x803 i=33422 o=2658304 (0) --5221:1:aspacem 26: anon 003828b000-0038d20fff 10m rw--- --5221:1:aspacem 27: 0038d21000-0061d7dfff 656m --5221:1:aspacem 28: rsvn 0061d7e000-0061d7efff 4096 ----- smfixed --5221:1:aspacem 29: anon 0061d7f000-0062509fff 7909376 rwx-- --5221:1:aspacem 30: anon 006250a000-006250bfff 8192 ----- --5221:1:aspacem 31: anon 006250c000-006260bfff 1048576 rwx-- --5221:1:aspacem 32: anon 006260c000-006260dfff 8192 ----- --5221:1:aspacem 33: file 006260e000-006260efff 4096 rw--- d=0x00b i=8236 o=0 (3) --5221:1:aspacem 34: anon 006260f000-0064b08fff 36m rwx-- --5221:1:aspacem 35: 0064b09000-00bdafbfff 1423m --5221:1:aspacem 36: rsvn 00bdafc000-00beaf9fff 15m ----- smupper --5221:1:aspacem 37: anon 00beafa000-00beafbfff 8192 rwx-- --5221:1:aspacem 38: 00beafc000-00bfae7fff 15m --5221:1:aspacem 39: anon 00bfae8000-00bfafcfff 86016 rw--- --5221:1:aspacem 40: rsvn 00bfafd000-00ffffdfff 1029m ----- smfixed --5221:1:aspacem 41: anon 00ffffe000-00ffffefff 4096 r-x-- --5221:1:aspacem 42: rsvn 00fffff000-00ffffffff 4096 ----- smfixed --5221:1:aspacem >>> ==5221== ==5221== heap summary: ==5221== in use @ exit: 0 bytes in 0 blocks ==5221== total heap usage: 0 allocs, 0 frees, 0 bytes allocated ==5221== ==5221== heap blocks freed -- no leaks possible ==5221== ==5221== error summary: 0 errors 0 contexts (suppressed: 1 1) --5221-- --5221-- used_suppression: 1 ld(cond) ==5221== ==5221== error summary: 0 errors 0 contexts (suppressed: 1 1) --5221:1:gdbsrv remote_finish (reason orderly_finish) 1019 -1 --5221:1:gdbsrv unlinking /tmp/vgdb-pipe-from-vgdb-to-5221-by-root-on-??? /tmp/vgdb-pipe-to-vgdb-from-5221-by-root-on-??? /tmp/vgdb-pipe-shared-mem-vgdb-5221-by-root-on-??? --5221:1:core_os vg_(terminate_noreturn)(tid=1)
it turns out openwrt strips libraries including valgrind's vgpreload_xxxxxx.so libs , libc.so. however, valgrind needs section headers , symbols in .so files. disabled stripping libc , valgrind packages, working charm. took digging valgrind code understand going on. wish there warnings or errors valgrind if can't find symbols redir. have saved me 3 days. oh well, learnt new anyways.
Comments
Post a Comment