|
From: Scott S. <sis...@gm...> - 2012-02-02 20:04:38
|
I'm trying to get valgrind to work on Android, but am having little luck. Here's the latest development. In this example I'm attempting to debug 'tinycap', which comes with Android's tinyalsa implementation. I think __cx_finalize is part of libc.so? # valgrind ./tinycap ==1706== Memcheck, a memory error detector ==1706== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. ==1706== Using Valgrind-3.8.0.SVN and LibVEX; rerun with -h for copyright info ==1706== Command: ./tinycap ==1706== ==1706== Conditional jump or move depends on uninitialised value(s) ==1706== at 0xB0005B04: ??? (in /system/bin/linker) ==1706== ==1706== Conditional jump or move depends on uninitialised value(s) ==1706== at 0xB0005B08: ??? (in /system/bin/linker) ==1706== link_image[1947]: 1706 could not load needed library '/data/local/Inst/lib/valgrind/vgpreload_core-arm-linux.so' for './tinycap' (reloc_library[1311]: 1706 cannot locate '__cxa_finalize'... )CANNOT LINK EXECUTABLE ==1706== Jump to the invalid address stated on the next line ==1706== at 0x80000324: ??? ==1706== Address 0x80000324 is not stack'd, malloc'd or (recently) free'd ==1706== ==1706== ==1706== Process terminating with default action of signal 11 (SIGSEGV) ==1706== Access not within mapped region at address 0x80000324 ==1706== at 0x80000324: ??? ==1706== If you believe this happened as a result of a stack ==1706== overflow in your program's main thread (unlikely but ==1706== possible), you can try to increase the size of the ==1706== main thread stack using the --main-stacksize= flag. ==1706== The main thread stack size used in this run was 8388608. ==1706== ==1706== HEAP SUMMARY: ==1706== in use at exit: 0 bytes in 0 blocks ==1706== total heap usage: 0 allocs, 0 frees, 0 bytes allocated ==1706== ==1706== All heap blocks were freed -- no leaks are possible ==1706== ==1706== For counts of detected and suppressed errors, rerun with: -v ==1706== Use --track-origins=yes to see where uninitialised values come from ==1706== ERROR SUMMARY: 9 errors from 3 contexts (suppressed: 0 from 0) # |
|
From: Philippe W. <phi...@sk...> - 2012-02-02 21:30:44
|
On Thu, 2012-02-02 at 14:04 -0600, Scott Sibley wrote:
> link_image[1947]: 1706 could not load needed library
> '/data/local/Inst/lib/valgrind/vgpreload_core-arm-linux.so' for
> './tinycap' (reloc_library[1311]: 1706 cannot locate
> '__cxa_finalize'...
> )CANNOT LINK EXECUTABLE
I have not digged in depth where this problem is coming from.
As part of the patch I am applying to have something working
on the Android emulator, I have the following hack to solve the
above problem. Don't ask me to explain neither the problem
nor the solution :).
Index: coregrind/vg_preloaded.c
===================================================================
--- coregrind/vg_preloaded.c (revision 12361)
+++ coregrind/vg_preloaded.c (working copy)
@@ -49,6 +49,10 @@
#if defined(VGO_linux)
+void __cxa_finalize(void)
+{
+}
+
/* ---------------------------------------------------------------------
Hook for running __libc_freeres once the program exits.
------------------------------------------------------------------ */
|