This is result of valgrind (tot, compiled using gcc 4.8) running ls on android aosp (nexus7): $ adb shell valgrind ls ==17554== Memcheck, a memory error detector ==17554== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==17554== Using Valgrind-3.11.0.SVN.aosp and LibVEX; rerun with -h for copyright info ==17554== Command: ls ==17554== WARNING: linker: Unsupported flags DT_FLAGS_1=0x421 WARNING: linker: Unsupported flags DT_FLAGS_1=0x421 acct build.prop cache charger config d data default.prop dev etc file_contexts firmware fstab.flo init init.environ.rc init.flo.diag.rc init.flo.rc init.flo.usb.rc init.rc init.trace.rc init.usb.rc init.zygote32.rc mnt oem persist proc property_contexts res root sbin sdcard seapp_contexts selinux_version sepolicy service_contexts storage sys system tombstones ueventd.flo.rc ueventd.rc vendor ==17554== ==17554== HEAP SUMMARY: ==17554== in use at exit: 188 bytes in 5 blocks ==17554== total heap usage: 56 allocs, 51 frees, 7,347 bytes allocated ==17554== ==17554== LEAK SUMMARY: ==17554== definitely lost: 0 bytes in 0 blocks ==17554== indirectly lost: 0 bytes in 0 blocks ==17554== possibly lost: 8 bytes in 1 blocks ==17554== still reachable: 180 bytes in 4 blocks ==17554== suppressed: 0 bytes in 0 blocks ==17554== Rerun with --leak-check=full to see details of leaked memory ==17554== ==17554== For counts of detected and suppressed errors, rerun with: -v ==17554== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) This is what happens when valgrind is recompiled using gcc 4.9 $ adb shell valgrind ls ==17649== Memcheck, a memory error detector ==17649== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==17649== Using Valgrind-3.11.0.SVN.aosp and LibVEX; rerun with -h for copyright info ==17649== Command: ls ==17649== WARNING: linker: Unsupported flags DT_FLAGS_1=0x421 WARNING: linker: Unsupported flags DT_FLAGS_1=0x421 ==17649== Invalid write of size 4 ==17649== at 0x48797A0: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0xFFFFFFFF: ??? ==17649== Address 0xbdf2b6e8 is on thread 1's stack ==17649== 24 bytes below stack pointer ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4977B3A: pthread_mutex_init (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4977B42: pthread_mutex_init (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4977B6C: pthread_mutex_init (in /system/lib/libc.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x48797A0: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x498DBE3: arena_init_locked (in /system/lib/libc.so) ==17649== Address 0xbdf2b6d0 is on thread 1's stack ==17649== 24 bytes below stack pointer ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4984B56: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x48797B4: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x4984B5D: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4879828: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x4984B5D: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4984B70: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x48797B4: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x4984B75: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4879828: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x4984B75: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4984B76: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4984B7C: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4984B88: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4984BA4: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4984BB4: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x48797B4: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x4977B39: pthread_mutex_init (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4879850: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x4977B39: pthread_mutex_init (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x498B4D6: je_extent_tree_szad_new (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x498B9AA: je_extent_tree_ad_new (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4984C0C: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4984C2A: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4984C54: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4984C6E: je_arena_new (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x498DCC8: malloc_init_hard_a0_locked (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4976F92: pthread_condattr_init (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4977AF0: pthread_mutexattr_settype (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4977AD4: pthread_mutexattr_destroy (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x497F4D8: __sinit (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x497F4A2: __sinit (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x497F4BA: __sinit (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x497F4CE: __sinit (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x497F4F4: __sinit (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x497F4FC: __sinit (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x48797B4: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x497F50B: __sinit (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4879828: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x497F50B: __sinit (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4879850: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x497F50B: __sinit (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x497F536: __sinit (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4977AF0: pthread_mutexattr_settype (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4977B56: pthread_mutex_init (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x496F676: fgets (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4977B88: pthread_mutex_lock (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x49778B2: __pthread_mutex_lock_with_timeout(pthread_mutex_internal_t*, timespec const*, int) (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4977900: __pthread_mutex_lock_with_timeout(pthread_mutex_internal_t*, timespec const*, int) (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x497790C: __pthread_mutex_lock_with_timeout(pthread_mutex_internal_t*, timespec const*, int) (in /system/lib/libc.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x4955993: __system_property_get (in /system/lib/libc.so) ==17649== Address 0xbdf2b5c4 is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x496F71C: fgets (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x496F722: fgets (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4951FF2: funlockfile (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4951FF4: funlockfile (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4977BD4: pthread_mutex_unlock (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4955004: get_nprocs (in /system/lib/libc.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x2033322F: ??? ==17649== Address 0xbdf2b5c4 is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x49737FA: __svfscanf (in /system/lib/libc.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x31203231: ??? ==17649== Address 0xbdf2b5c4 is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x3120352F: ??? ==17649== Address 0xbdf2b5c4 is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x3132311F: ??? ==17649== Address 0xbdf2b5c4 is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x35303033: ??? ==17649== Address 0xbdf2b5c4 is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x2030202F: ??? ==17649== Address 0xbdf2b5c4 is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x20393635: ??? ==17649== Address 0xbdf2b5c4 is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x496F6B6: fgets (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4971012: __srefill (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4971062: __srefill (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4971086: __srefill (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4971090: __srefill (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x49710C0: __srefill (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x49710CC: __srefill (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x496F6E2: fgets (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x496F6A0: fgets (in /system/lib/libc.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x3020301F: ??? ==17649== Address 0xbdf2b5c4 is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x30200009: ??? ==17649== Address 0xbdf2b5c4 is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x30000A31: ??? ==17649== Address 0xbdf2b5c4 is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x300009FF: ??? ==17649== Address 0xbdf2b5c4 is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x496F6CE: fgets (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x496F2CE: fclose (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x496F33E: fclose (in /system/lib/libc.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x48797A0: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x494E76D: jemalloc_constructor (in /system/lib/libc.so) ==17649== Address 0xbdf2b720 is on thread 1's stack ==17649== 24 bytes below stack pointer ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x498DE60: malloc_init_hard (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x498DA42: a0ialloc (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4977B78: pthread_mutex_lock (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4977B9C: pthread_mutex_lock (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4977BA4: pthread_mutex_lock (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4983084: je_arena_malloc_small (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4982A4C: arena_bin_malloc_hard (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4980B9E: arena_bin_nonfull_run_tryget (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4980BA4: arena_bin_nonfull_run_tryget (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4977BC6: pthread_mutex_unlock (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4977C22: pthread_mutex_unlock (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4982A6C: arena_bin_malloc_hard (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x498116A: arena_run_first_fit (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4981172: arena_run_first_fit (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x498119A: arena_run_first_fit (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x49816B2: arena_chunk_alloc (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x49816B6: arena_chunk_alloc (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x49816C6: arena_chunk_alloc (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4985C0E: chunk_recycle (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x498B9B2: je_extent_tree_ad_new (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x498B9B8: je_extent_tree_ad_first (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4981720: arena_chunk_alloc (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x49859BA: je_chunk_alloc_wrapper (in /system/lib/libc.so) ==17649== ==17649== ==17649== More than 100 errors detected. Subsequent errors ==17649== will still be recorded, but in less detail than before. ==17649== Use of uninitialised value of size 4 ==17649== at 0x4985E38: je_chunk_alloc_default (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x498177C: arena_chunk_alloc (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x498120A: arena_avail_tree_insert (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4981218: arena_avail_tree_insert (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x49812F0: arena_avail_tree_insert (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4981308: arena_avail_tree_remove (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4981320: arena_avail_tree_remove (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4981358: arena_avail_tree_remove (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x49813E0: arena_avail_tree_remove (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4981972: arena_run_split_remove (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4981048: arena_cactive_update.isra.19 (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x498197E: arena_run_split_remove (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4982AB4: arena_bin_malloc_hard (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4985668: je_bitmap_init (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x498566E: je_bitmap_init (in /system/lib/libc.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x48797A0: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x4A4087F: ??? ==17649== Address 0xbdf2b660 is on thread 1's stack ==17649== 24 bytes below stack pointer ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x498567A: je_bitmap_init (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x49856C4: je_bitmap_init (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x49856A0: je_bitmap_init (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4982AD0: arena_bin_malloc_hard (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4982AF2: arena_bin_malloc_hard (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4982B8A: arena_bin_malloc_hard (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4980E30: arena_run_reg_alloc (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4980E3A: arena_run_reg_alloc (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4980E56: arena_run_reg_alloc (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4980EDA: arena_run_reg_alloc (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x49830BE: je_arena_malloc_small (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x498DAF4: a0ialloc (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x498DB06: a0ialloc (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x498DB18: a0ialloc (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x494E770: jemalloc_constructor (in /system/lib/libc.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x20C3: ??? ==17649== Address 0xbdf2b6e4 is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x48F6CAA: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned int) (in /system/lib/libc++.so) ==17649== by 0x490C9FF: ??? (in /system/lib/libc++.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4976A20: strspn (in /system/lib/libc.so) ==17649== Address 0xbdf2b6d4 is on thread 1's stack ==17649== 20 bytes below stack pointer ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4952F88: newlocale (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4953018: uselocale (in /system/lib/libc.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x48797A0: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x48FE283: ??? (in /system/lib/libc++.so) ==17649== by 0x48FDC6B: ??? (in /system/lib/libc++.so) ==17649== Address 0xbdf2b728 is on thread 1's stack ==17649== 24 bytes below stack pointer ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x49107B0: std::__1::codecvt<wchar_t, char, mbstate_t>::do_encoding() const (in /system/lib/libc++.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x49107B8: std::__1::codecvt<wchar_t, char, mbstate_t>::do_encoding() const (in /system/lib/libc++.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x49107C4: std::__1::codecvt<wchar_t, char, mbstate_t>::do_encoding() const (in /system/lib/libc++.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x495303E: __ctype_get_mb_cur_max (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4953050: __ctype_get_mb_cur_max (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x49107D2: std::__1::codecvt<wchar_t, char, mbstate_t>::do_encoding() const (in /system/lib/libc++.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0xFFFFFFFF: ??? ==17649== Address 0xbdf2b32c is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Invalid write of size 4 ==17649== at 0x48797A0: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x1: ??? ==17649== Address 0xbdf2ba10 is on thread 1's stack ==17649== 24 bytes below stack pointer ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4954442: sigaction (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x495444C: sigaction (in /system/lib/libc.so) ==17649== ==17649== Syscall param sigaction(signum) contains uninitialised byte(s) ==17649== at 0x4978708: __sigaction (in /system/lib/libc.so) ==17649== by 0x4954463: sigaction (in /system/lib/libc.so) ==17649== ==17649== Syscall param sigaction(act->sa_flags) points to uninitialised byte(s) ==17649== at 0x4978708: __sigaction (in /system/lib/libc.so) ==17649== by 0x4954463: sigaction (in /system/lib/libc.so) ==17649== Address 0xbdf2ba20 is on thread 1's stack ==17649== ==17649== Invalid write of size 4 ==17649== at 0x48797A0: memset (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x11AB55: ??? (in /system/bin/toolbox) ==17649== Address 0xbdf2a8c0 is on thread 1's stack ==17649== 24 bytes below stack pointer ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4977B3C: pthread_mutex_init (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4977BA2: pthread_mutex_lock (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4977C36: pthread_mutex_unlock (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x10E01C: ??? (in /system/bin/toolbox) ==17649== by 0x10E6CD: ??? (in /system/bin/toolbox) ==17649== by 0x10E8DD: ??? (in /system/bin/toolbox) ==17649== by 0x10E9E3: ??? (in /system/bin/toolbox) ==17649== by 0x494F2E9: __libc_init (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x10E022: ??? (in /system/bin/toolbox) ==17649== by 0x10E6CD: ??? (in /system/bin/toolbox) ==17649== by 0x10E8DD: ??? (in /system/bin/toolbox) ==17649== by 0x10E9E3: ??? (in /system/bin/toolbox) ==17649== by 0x494F2E9: __libc_init (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x10E056: ??? (in /system/bin/toolbox) ==17649== by 0x10E6CD: ??? (in /system/bin/toolbox) ==17649== by 0x10E8DD: ??? (in /system/bin/toolbox) ==17649== by 0x10E9E3: ??? (in /system/bin/toolbox) ==17649== by 0x494F2E9: __libc_init (in /system/lib/libc.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x488029C: realloc (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0xFFFFFFFF: ??? ==17649== Address 0xbdf2a8d4 is on thread 1's stack ==17649== 12 bytes below stack pointer ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x10E062: ??? (in /system/bin/toolbox) ==17649== by 0x10E6CD: ??? (in /system/bin/toolbox) ==17649== by 0x10E8DD: ??? (in /system/bin/toolbox) ==17649== by 0x10E9E3: ??? (in /system/bin/toolbox) ==17649== by 0x494F2E9: __libc_init (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x10E066: ??? (in /system/bin/toolbox) ==17649== by 0x10E6CD: ??? (in /system/bin/toolbox) ==17649== by 0x10E8DD: ??? (in /system/bin/toolbox) ==17649== by 0x10E9E3: ??? (in /system/bin/toolbox) ==17649== by 0x494F2E9: __libc_init (in /system/lib/libc.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x3: ??? ==17649== Address 0xbdf295ec is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x49704B4: __sfvwrite (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4970466: __sfvwrite (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4970410: __sfvwrite (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x496F468: __sflush (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x496F472: __sflush (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x496F478: __sflush (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x496F486: __sflush (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x496F48C: __sflush (in /system/lib/libc.so) ==17649== acct ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x9: ??? ==17649== Address 0xbdf295ec is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== build.prop ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x5: ??? ==17649== Address 0xbdf295ec is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== cache ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x7: ??? ==17649== Address 0xbdf295ec is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== charger config ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x1: ??? ==17649== Address 0xbdf295ec is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== d data ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0xB: ??? ==17649== Address 0xbdf295ec is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== default.prop dev etc ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0xD: ??? ==17649== Address 0xbdf295ec is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== file_contexts firmware fstab.flo init ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0xF: ??? ==17649== Address 0xbdf295ec is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== init.environ.rc init.flo.diag.rc init.flo.rc init.flo.usb.rc init.rc init.trace.rc init.usb.rc init.zygote32.rc mnt oem persist proc ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x11: ??? ==17649== Address 0xbdf295ec is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== property_contexts res root sbin sdcard seapp_contexts selinux_version sepolicy service_contexts storage sys system tombstones ueventd.flo.rc ueventd.rc vendor ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x4977CD0: pthread_mutex_trylock (in /system/lib/libc.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4880004: calloc (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0xFFFFFFFF: ??? ==17649== Address 0xbdf2ba30 is on thread 1's stack ==17649== 16 bytes below stack pointer ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4998968: __emutls_get_address (in /system/lib/libc.so) ==17649== ==17649== Invalid write of size 4 ==17649== at 0x4874DDC: memcpy (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so) ==17649== by 0x494F2ED: __libc_init (in /system/lib/libc.so) ==17649== Address 0xbdf2ba14 is on thread 1's stack ==17649== 28 bytes below stack pointer ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x499897C: __emutls_get_address (in /system/lib/libc.so) ==17649== ==17649== Use of uninitialised value of size 4 ==17649== at 0x4979EE0: __cxa_thread_finalize (in /system/lib/libc.so) ==17649== ==17649== Conditional jump or move depends on uninitialised value(s) ==17649== at 0x491072E: std::__1::codecvt<wchar_t, char, mbstate_t>::do_unshift(mbstate_t&, char*, char*, char*&) const (in /system/lib/libc++.so) ==17649== ==17649== ==17649== HEAP SUMMARY: ==17649== in use at exit: 188 bytes in 5 blocks ==17649== total heap usage: 56 allocs, 51 frees, 7,347 bytes allocated ==17649== ==17649== LEAK SUMMARY: ==17649== definitely lost: 28 bytes in 3 blocks ==17649== indirectly lost: 0 bytes in 0 blocks ==17649== possibly lost: 0 bytes in 0 blocks ==17649== still reachable: 160 bytes in 2 blocks ==17649== suppressed: 0 bytes in 0 blocks ==17649== Rerun with --leak-check=full to see details of leaked memory ==17649== ==17649== For counts of detected and suppressed errors, rerun with: -v ==17649== Use --track-origins=yes to see where uninitialised values come from ==17649== ERROR SUMMARY: 2310 errors from 183 contexts (suppressed: 0 from 0) Reproducible: Always
(In reply to dimitry from comment #0) > This is what happens when valgrind is recompiled using gcc 4.9 > [..] Dmitry, just to be clear about this: are you saying that compiling valgrind with gcc 4.9 produces all this noise, even when the AOSP and all other code is still compiled with 4.8? Or do you mean "when entire system (including valgrind) is compiled with 4.9, I get all this noise that I didn't when the entire system was compiled with 4.8" ? I need to know in order to begin guessing what happened.
yes this is correct only valgrind was recompiled with gcc 4.8...
... the rest of the code in aosp was compiled with gcc 4.9
So if I understand correctly, basically the bug is that memcheck is noisy on gcc 4.9 compiled code. Yes?
yes. but interestingly only if valgrind is compiled with gcc 4.9 as well. If platform is compiled with gcc 4.9 and valgrind with gcc 4.8 it becomes less noisy..