while testing memcheck catches mismatched mmap free" test failure as "no leaks were detected
Steps to reproduce:
- Cross compilation the c program as below :
aarch64-linux-gnu-gcc -g memory_leak_demo.c -o memory_leak_demo
OR
aarch64-linux-gnu-gcc -g memory_leak_demo.c -o memory_leak_demo.o
- Root the device "adb root"
- Run following commands
"setenforce 0"
"mount -o rw,remount /"
- Push the above binary onto device using "adb push memory_leak_demo /var/lib"
- Move to shell using "adb shell"
- Move to directory "/usr/bin"
- Give valgrind command :
"valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes /var/lib/memory_leak_demo"
Observed Results:
==2141== Process terminating with default action of signal 4 (SIGILL): dumping core
==2141== Illegal opcode at address 0x4028268
==2141== at 0x4028268: _dl_sysdep_parse_arguments (dl-sysdep.c:96)
==2141== by 0x40285DF: _dl_sysdep_start (dl-sysdep.c:106)
==2141== by 0x402994B: _dl_start_final (rtld.c:496)
==2141== by 0x402994B: _dl_start (rtld.c:581)
==2141== by 0x402D853: (below main) (dl-start.S:31)
==2141==
==2141== FILE DESCRIPTORS: 3 open (3 inherited) at exit.
==2141==
==2141== HEAP SUMMARY:
==2141== in use at exit: 0 bytes in 0 blocks
==2141== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==2141==
==2141== All heap blocks were freed -- no leaks are possible
==2141==
==2141== For lists of detected and suppressed errors, rerun with: -s
==2141== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Expected Results: [As in Lemans]
==2093== LEAK SUMMARY:
==2093== definitely lost: 108 bytes in 2 blocks
==2093== indirectly lost: 50 bytes in 1 blocks
==2093== possibly lost: 0 bytes in 0 blocks
==2093== still reachable: 0 bytes in 0 blocks
==2093== suppressed: 0 bytes in 0 blocks
==2093==
==2093== For lists of detected and suppressed errors, rerun with: -s
==2093== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
while testing memcheck catches mismatched mmap free" test failure as "no leaks were detected
Steps to reproduce:
aarch64-linux-gnu-gcc -g memory_leak_demo.c -o memory_leak_demo
OR
aarch64-linux-gnu-gcc -g memory_leak_demo.c -o memory_leak_demo.o
"setenforce 0"
"mount -o rw,remount /"
"valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes /var/lib/memory_leak_demo"
Observed Results:
==2141== Process terminating with default action of signal 4 (SIGILL): dumping core
==2141== Illegal opcode at address 0x4028268
==2141== at 0x4028268: _dl_sysdep_parse_arguments (dl-sysdep.c:96)
==2141== by 0x40285DF: _dl_sysdep_start (dl-sysdep.c:106)
==2141== by 0x402994B: _dl_start_final (rtld.c:496)
==2141== by 0x402994B: _dl_start (rtld.c:581)
==2141== by 0x402D853: (below main) (dl-start.S:31)
==2141==
==2141== FILE DESCRIPTORS: 3 open (3 inherited) at exit.
==2141==
==2141== HEAP SUMMARY:
==2141== in use at exit: 0 bytes in 0 blocks
==2141== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==2141==
==2141== All heap blocks were freed -- no leaks are possible
==2141==
==2141== For lists of detected and suppressed errors, rerun with: -s
==2141== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Expected Results: [As in Lemans]
==2093== LEAK SUMMARY:
==2093== definitely lost: 108 bytes in 2 blocks
==2093== indirectly lost: 50 bytes in 1 blocks
==2093== possibly lost: 0 bytes in 0 blocks
==2093== still reachable: 0 bytes in 0 blocks
==2093== suppressed: 0 bytes in 0 blocks
==2093==
==2093== For lists of detected and suppressed errors, rerun with: -s
==2093== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)