Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Code LG, wait for Matt with cmake.
tools/llvm-demangle-fuzzer/llvm-demangle-fuzzer.cpp | ||
---|---|---|
19 ↗ | (On Diff #118811) | style nit: llvm prefers this style: free(demangle); |
Comment Actions
This is pretty straightforward, but if you'd like to add a test for it you can do so by implementing a main function that doesn't link to libfuzzer. It would probably just be something like this:
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size); int main(int argc, char *argv[]) { return llvm::runFuzzerOnInputs(argc, argv, LLVMFuzzerTestOneInput); }
Then you'd add the file you added as a DUMMY_MAIN argument to add_llvm_fuzzer. See llvm-isel-fuzzer for details.
Comment Actions
Actually, I'm working on a change to AddLLVM.cmake that should do this automatically. So don't worry about it.
Comment Actions
- Fuzzer updates with dummy main.
- Added main() for dummy target.
- Remove LIB_FUZZING_ENGINE target (morehouse@)
- Added to fuzzer doc.
Comment Actions
Note, I've already found some bugs running this locally, but would love to get it up and running in oss-fuzz.
SUMMARY: AddressSanitizer: stack-overflow /usr/local/google/home/mitchp/llvm-src/git/lib/Demangle/ItaniumDemangle.cpp:1654 in _ZL10parse_typeIN12_GLOBAL__N_12DbEEPKcS3_S3_RT_ ==151934==ABORTING MS: 0 ; base unit: 0000000000000000000000000000000000000000 artifact_prefix='./'; Test unit written to ./crash-c935b5dded9a3c7373cdf899be10c03897c7c2c7
Test: