SUMMARY Hi, I cross compile valgrind version 3.20 and tried to run on android 11 device. <path>/data/local/Inst/bin # ./valgrind --help Segmentation fault STEPS TO REPRODUCE 1. export NDKROOT=<NDK local path> 2. export AR=$NDKROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar export LD=$NDKROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld export CC=$NDKROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang export CXX=$NDKROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang++ 3. ./autogen.sh 4. CPPFLAGS="--sysroot=$NDKROOT/toolchains/llvm/prebuilt/linux-x86_64/sysroot" \ CFLAGS="--sysroot=$NDKROOT/toolchains/llvm/prebuilt/linux-x86_64/sysroot" \ ./configure --prefix=/data/local/Inst \ --host=aarch64-linux --target=aarch64-linux-android\ --with-tmpdir=/data/local/tmp --enable-only64bit 5. make -j4 6. make -j4 install DESTDIR=`pwd`/Inst 7. push binaries to android device 8. run valgrind executable OBSERVED RESULT segmentation fault EXPECTED RESULT help menu SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: Ubunt 18.04 (host for cross compilation) (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
Can you post the output? Do verbose/debug options help (like -d -d -d -v -v -v)?
Reminder
Sorry for late response. Please find the log with -d option lahaina:/data/local/tmp/ramesh/Inst/data/local/Inst/bin # ./valgrind -d --help --10869:1:debuglog DebugLog system started by Stage 1, level 1 logging requested --10869:1:launcher no tool requested, defaulting to 'memcheck' --10869:1:launcher no client specified, defaulting platform to 'arm64-linux' --10869:1:launcher launching /data/local/tmp/ramesh/data/local/Inst/libexec/valgrind/memchSegmentation fault 139|lahaina:/data/local/tmp/ramesh/Inst/data/local/Inst/bin #
I moved valgrind bin folder to different location and I am getting below log 139|lahaina:/data/local/Inst/bin # ./valgrind -d --help --12517:1:debuglog DebugLog system started by Stage 1, level 1 logging requested --12517:1:launcher no tool requested, defaulting to 'memcheck' --12517:1:launcher no client specified, defaulting platform to 'arm64-linux' --12517:1:launcher launching /data/local/Inst/libexec/valgrind/memcheck-arm64-linux --12517:1:debuglog DebugLog system started by Stage 2 (main), level 1 logging requested --12517:1: main Welcome to Valgrind version 3.20.0 debug logging --12517:1: main Checking current stack is plausible --12517:1: main Checking initial stack was noted --12517:1: main Starting the address space manager --12517:1: main Address space manager is running --12517:1: main Starting the dynamic memory manager --12517:1:mallocfr newSuperblock at 0x1002001000 (pszB 4194272) owner VALGRIND/core --12517:1:mallocfr deferred_reclaimSuperblock at 0x1002001000 (pszB 4194272) (prev 0x0) oSegmentation fault
You should also be able to run Valgrind from your build directory with ./vg-in-place Your crash is quite early in Valgrind startup. I don't use android at all so I can't help much. Can you debug Valgrind as per the instructions in README_DEVELOPERS?