class MyClass{ public: int get(void) { return myData; } MyClass(int data) { myData = data; cout << "Construct MyClass,myData = " << myData << endl; } private: int myData;};
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { cout << "Successfuly enter LLVMFuzzerTestOneInput!" << endl; MyClass myObject((int)Size); int data = myObject.get(); cout << "Successfuly! data = " << data << endl; return 0; }
include $(CLEAR_VARS)LOCAL_SRC_FILES := fuzz_me.cppLOCAL_SHARED_LIBRARIES := liblog LOCAL_STATIC_LIBRARIES := libsan libasanLOCAL_SANITIZE := address LOCAL_CFLAGS := -Wno-multichar -gLOCAL_MODULE_TAGS := optionalLOCAL_CLANG := trueLOCAL_MODULE := fuzz_meinclude $(BUILD_FUZZ_TEST)make -j$(nproc) ANDROID_USE_BUILDCACHE=falsePRODUCT-$TARGET_PRODUCT-$TARGET_BUILD_VARIANT$ make -j$(nproc) PRODUCT-$TARGET_PRODUCT-$TARGET_BUILD_VARIANT userdataimageuserdatatarball SANITIZE_TARGET='address coverage'
$ make -j$(nproc) fuzz_me
$ adb push $OUT/data/nativetest/fuzzers/cxa_demangle_fuzzer/fuzz_me /data/local/tmp
$ adb shell /data/local/tmp/fuzz_me -max_len=64
C:\Users\pKirinAutoTest\Desktop\yyp_test\o_android>adb shell /data/local/tmp/fuzz_me -max_len=64 -use_counters=1 -runs=1000000WARNING: Failed to find function "__sanitizer_get_coverage_pc_buffer".INFO: Seed: 3085682192INFO: A corpus is not provided, starting from an empty corpus#0 READ units: 1 exec/s: 0Successfuly enter LLVMFuzzerTestOneInput!Size:0Construct MyClass,myData = 0Successfuly! data = 0ASAN:DEADLYSIGNAL================================================================= [1m [31m==2576==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000000000 bp 0x007ff80b18c0 sp 0x007ff80b1890 T0) [1m [0m==2576==Hint: pc points to the zero page.==2576==The signal is caused by a READ memory access.==2576==Hint: address points to the zero page.
AddressSanitizer can not provide additional info.SUMMARY: AddressSanitizer: SEGV (<unknown module>)==2576==ABORTING
artifact_prefix='./'; Test unit written to ./crash-da39a3ee5e6b4b0d3255bfef95601890afd80709Base64:==2576== ERROR: libFuzzer: deadly signal #0 0x7ee71a01c7 (/data/lib64/libclang_rt.asan-aarch64-android.so+0x7d1c7) #1 0x608162df53 (/data/local/tmp/fuzz_me+0xcf53) #2 0x608162df17 (/data/local/tmp/fuzz_me+0xcf17) #3 0x7ee80bf4df ([vdso]+0x4df)--
You received this message because you are subscribed to the Google Groups "libfuzzer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libfuzzer+unsubscribe@googlegroups.com.
To post to this group, send email to libf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libfuzzer/533fe563-aa50-4733-a840-a46e8de2830a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to libfuzzer+...@googlegroups.com.
thank you for your reply~the stable libFuzzer is provided by original android AOSP and version of clang in android is 3.8I just write a Android.mk and one cpp file ,then build it to get a executable binary file running on phone.using new version of clang and libFuzzer by changing the compile toolchain is diffcult
in android compile strunction.I run it ok, using a libFuzzer example as https://github.com/google/fuzzer-test-suite/blob/master/tutorial/fuzz_me.cc
To unsubscribe from this group and stop receiving emails from it, send an email to libfuzzer+unsubscribe@googlegroups.com.
To post to this group, send email to libf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libfuzzer/25f091da-0e08-49c9-a126-6f0f8446ee4f%40googlegroups.com.
clang++: error: unsupported argument 'trace-pc-guard' to option 'fsanitize-coverage='
[ 92% 127/137 1.396] host C++: libLLVMFuzzerNoMain <= external/llvm/lib/Fuzzer/FuzzerInterface.cppFAILED: /bin/bash -c "(PWD=/proc/self/cwd prebuilts/clang/host/linux-x86/clang-2690385/bin/clang++ -I external/compiler-rt/include -I external/llvm/lib/Fuzzer -I out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMFuzzerNoMain_intermediates -I out/host/linux-x86/gen/STATIC_LIBRARIES/libLLVMFuzzerNoMain_intermediates -I libnativehelper/include/nativehelper \$(cat out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMFuzzerNoMain_intermediates/import_includes) -isystem system/core/include -isystem system/media/audio/include -isystem hardware/libhardware/include -isystem hardware/libhardware_legacy/include -isystem hardware/ril/include -isystem libnativehelper/include -isystem frameworks/native/include -isystem frameworks/native/opengl/include -isystem frameworks/av/include -isystem frameworks/base/include -isystem tools/include -isystem out/host/linux-x86/obj/include -c -fno-exceptions -Wno-multichar -m64 -Wa,--noexecstack -fPIC -no-canonical-prefixes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Wformat -DOEMINFO_VERSION6 -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 -fstack-protector-strong --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 --sysroot prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot -target x86_64-linux-gnu -Wsign-promo -Wno-inconsistent-missing-override --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 --sysroot prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8 -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/x86_64-linux -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/backward -target x86_64-linux-gnu -fPIC -D_USING_LIBCXX -std=gnu++14 -nostdinc++ -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=null-dereference -Werror=return-type -MD -MF out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMFuzzerNoMain_intermediates/FuzzerInterface.d -o out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMFuzzerNoMain_intermediates/FuzzerInterface.o external/llvm/lib/Fuzzer/FuzzerInterface.cpp ) && (cp out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMFuzzerNoMain_intermediates/FuzzerInterface.d out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMFuzzerNoMain_intermediates/FuzzerInterface.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\\\\$//' -e '/^\$/ d' -e 's/\$/ :/' < out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMFuzzerNoMain_intermediates/FuzzerInterface.d >> out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMFuzzerNoMain_intermediates/FuzzerInterface.P; rm -f out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMFuzzerNoMain_intermediates/FuzzerInterface.d )"external/llvm/lib/Fuzzer/FuzzerInterface.cpp:18:6: error: use of undeclared identifier 'FuzzerRandomLibc'void FuzzerRandomLibc::ResetSeed(unsigned int seed) { srand(seed); } ^external/llvm/lib/Fuzzer/FuzzerInterface.cpp:20:8: error: use of undeclared identifier 'FuzzerRandomLibc'size_t FuzzerRandomLibc::Rand() { return rand(); } ^external/llvm/lib/Fuzzer/FuzzerInterface.cpp:22:1: error: use of undeclared identifier 'UserSuppliedFuzzer'UserSuppliedFuzzer::UserSuppliedFuzzer(FuzzerRandomBase *Rand)^external/llvm/lib/Fuzzer/FuzzerInterface.cpp:22:40: error: unknown type name 'FuzzerRandomBase'UserSuppliedFuzzer::UserSuppliedFuzzer(FuzzerRandomBase *Rand) ^external/llvm/lib/Fuzzer/FuzzerInterface.cpp:25:1: error: use of undeclared identifier 'UserSuppliedFuzzer'UserSuppliedFuzzer::~UserSuppliedFuzzer() {^5 errors generated.
################################################################################include $(CLEAR_VARS)
LOCAL_SRC_FILES := FuzzerExtFunctionsWeakAlias.cpp FuzzerIOPosix.cpp FuzzerShmemWindows.cpp FuzzerTracePC.cpp FuzzerExtFunctionsWeak.cpp FuzzerMain.cpp FuzzerExtFunctionsDlsym.cpp FuzzerLoop.cpp FuzzerShmemPosix.cpp FuzzerUtilLinux.cpp FuzzerUtilWindows.cpp FuzzerIOWindows.cpp FuzzerIO.cpp FuzzerUtilDarwin.cpp FuzzerMutate.cpp FuzzerUtilPosix.cpp FuzzerDriver.cpp FuzzerTraceState.cpp FuzzerSHA1.cpp FuzzerExtFunctionsDlsymWin.cpp FuzzerUtil.cpp FuzzerCrossOver.cpp FuzzerMerge.cpp
LOCAL_CFLAGS += -g -O2 -fno-omit-frame-pointer -std=c++11 LOCAL_MODULE := libFuzzerinclude $(BUILD_STATIC_LIBRARY)################################################################################include $(CLEAR_VARS)LOCAL_SRC_FILES := fuzz_me.cppLOCAL_MODULE := fuzz_me_newLOCAL_CFLAGS := -Wno-multichar -gLOCAL_SANITIZE := address LOCAL_CLANG := trueinclude $(BUILD_FUZZ_TEST)ERROR: no interesting inputs were found. Is the code instrumented for coverage? Exiting.
You received this message because you are subscribed to a topic in the Google Groups "libfuzzer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/libfuzzer/mkynjGyQiEU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to libfuzzer+...@googlegroups.com.
To post to this group, send email to libf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libfuzzer/96aa9da5-d63b-4050-a121-b4b03bd21ec7%40googlegroups.com.
LOCAL_PATH:= $(call my-dir)
################################################################################include $(CLEAR_VARS)LOCAL_SRC_FILES := FuzzerExtFunctionsWeakAlias.cpp FuzzerIOPosix.cpp FuzzerShmemWindows.cpp FuzzerTracePC.cpp FuzzerExtFunctionsWeak.cpp FuzzerMain.cpp FuzzerExtFunctionsDlsym.cpp FuzzerLoop.cpp FuzzerShmemPosix.cpp FuzzerUtilLinux.cpp FuzzerUtilWindows.cpp FuzzerIOWindows.cpp FuzzerIO.cpp FuzzerUtilDarwin.cpp FuzzerMutate.cpp FuzzerUtilPosix.cpp FuzzerDriver.cpp FuzzerTraceState.cpp FuzzerSHA1.cpp FuzzerExtFunctionsDlsymWin.cpp FuzzerUtil.cpp FuzzerCrossOver.cpp FuzzerMerge.cppLOCAL_CFLAGS += -g -O2 -fno-omit-frame-pointer -std=c++11 LOCAL_MODULE := libFuzzerinclude $(BUILD_HOST_STATIC_LIBRARY)################################################################################include $(CLEAR_VARS)LOCAL_SRC_FILES := fuzz_me.cppLOCAL_MODULE := fuzz_me_newLOCAL_SANITIZE := address LOCAL_STATIC_LIBRARIES :=libFuzzer LOCAL_CFLAGS := -fsanitize-coverage=trace-pc-guard -fsanitize=address LOCAL_C_INCLUDES := prebuilts/clang/host/linux-x86/clang-2963211/lib/clang/5.0.0/includeLOCAL_CXX := prebuilts/clang/host/linux-x86/clang-2963211/bin/clanginclude $(BUILD_HOST_EXECUTABLE)
hi~ long time no see, u still here ? :)I found you introduce libFuzzer to Android
To unsubscribe from this group and stop receiving emails from it, send an email to libfuzzer+unsubscribe@googlegroups.com.
To post to this group, send email to libf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libfuzzer/087fed92-23f0-4bf1-8b5d-c2ab7385a151%40googlegroups.com.
Ah, yes, libLLVMFuzzer was changed to libFuzzer in Android recently, forgot about that.