Nalloc sanitizer: to test allocations failures#10701
Nalloc sanitizer: to test allocations failures#10701catenacyber wants to merge 1 commit intogoogle:masterfrom
Conversation
|
catenacyber is a new contributor to projects/fluent-bit. The PR must be approved by known contributors before it can be merged. The past contributors are: jonathanmetzman, DavidKorczynski, leonardo-albertovich, patrick-stephens, oliverchang, devtty1er, edsiper |
|
|
||
| ENV SANITIZER_FLAGS_introspector "-O0 -flto -fno-inline-functions -fuse-ld=gold -Wno-unused-command-line-argument" | ||
|
|
||
| ENV SANITIZER_FLAGS_nalloc "-DLLVMFuzzerTestOneInput=NaloFuzzerTestOneInput -DLLVMFuzzerInitialize=NaloFuzzerInitialize $SANITIZER_FLAGS_address" |
There was a problem hiding this comment.
This is the magic trick
Renaming LLVMFuzzerTestOneInput by macro in order to hook before it
| export RUN_FUZZER_MODE="interactive" | ||
| export FUZZING_ENGINE="libfuzzer" | ||
| export SKIP_SEED_CORPUS="1" | ||
| export FUZZ_REPRODUCE_VERBOSE="1" |
There was a problem hiding this comment.
This is used by nalloc to be verbose about allocation failures when reproducing (it stays quiet during batch fuzzing)
|
@catenacyber , sorry for the silly question, but I am not able to test it locally (with nDPI). I have done:
It seems that nalloc stuff is never compiled... |
|
@IvanNardi you have to run |
|
And you also to run |
|
Now it works! Thank you very much! Astonishing work... |
|
Friendly ping @oliverchang Could we get this new "sanitizer" to test when allocations fail ? In addition to the projects listed here (see previous PR), there is also icu cf unicode-org/icu#2567 where a double free was found by nallocfuzz and is now fixed (and also curl cf curl/curl@22eb989 ) |
|
Friendly ping @oliverchang Could we get this new "sanitizer" to test when memory allocations fail ? |
|
I guess this PR can be closed Libwebp and such have had nalloc single-file integration. |
#9902 but as a sanitizer instead of a fuzzing engine
cc @oliverchang @alan32liu
Is this less costly than a fuzzing engine ?