{"id":17921542,"url":"https://github.com/theopolis/simple-libfuzzer","last_synced_at":"2025-10-05T04:07:05.580Z","repository":{"id":145262937,"uuid":"153823550","full_name":"theopolis/simple-libfuzzer","owner":"theopolis","description":"Create a simple libFuzzer test harness","archived":false,"fork":false,"pushed_at":"2018-12-17T02:33:40.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T08:43:00.851Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theopolis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-19T18:11:11.000Z","updated_at":"2021-10-19T13:01:23.000Z","dependencies_parsed_at":"2023-04-19T20:20:04.520Z","dependency_job_id":null,"html_url":"https://github.com/theopolis/simple-libfuzzer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theopolis/simple-libfuzzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theopolis%2Fsimple-libfuzzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theopolis%2Fsimple-libfuzzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theopolis%2Fsimple-libfuzzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theopolis%2Fsimple-libfuzzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theopolis","download_url":"https://codeload.github.com/theopolis/simple-libfuzzer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theopolis%2Fsimple-libfuzzer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268229216,"owners_count":24217007,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-28T20:34:40.084Z","updated_at":"2025-10-05T04:07:00.518Z","avatar_url":"https://github.com/theopolis.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-fuzzer\n\nThis is used as a test or example.\n\n## MacOS\n\nYou will need to install Homebrew, then install LLVM and cmake\n\n```\nbrew install llvm cmake\n```\n\nThen to build, use the installed LLVM's clang\n\n```\nmkdir macos_build; cd macos_build\ncmake -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm/7.0.0/bin/clang++ ..\nmake\n```\n\n## Ubuntu 18.04\n\nYou will need to install clang and cmake\n\n```\nsudo apt-get install clang cmake\n```\n\nThen to build use\n\n```\nmkdir linux_build; cd linux_build\ncmake -DCMAKE_CXX_COMPILER=clang++ ..\nmake\n```\n\nIf you have `vagrant` installed you can `vagrant up ubuntu18.04`.\n\n## Make sure you're compiling correctly\n\nIn the make/compiler output you should see `-fsanitize=fuzzer,address`:\n\n```\n[ 25%] Building CXX object CMakeFiles/simple.dir/simple/simple.cpp.o\n/usr/local/Cellar/llvm/7.0.0/bin/clang++    -fsanitize-coverage=trace-pc-guard -fsanitize-coverage=trace-cmp -fsanitize=fuzzer,address -std=c++14 -o CMakeFiles/simple.dir/simple/simple.cpp.o -c /Users/reed/git/github/simple-libfuzzer/simple/simple.cpp\n```\n\nAnd it should be linked with the same flag:\n\n```\n[100%] Linking CXX executable simple_test\n/usr/local/Cellar/cmake/3.11.4/bin/cmake -E cmake_link_script CMakeFiles/simple_test.dir/link.txt --verbose=1\n/usr/local/Cellar/llvm/7.0.0/bin/clang++   -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/simple_test.dir/main.cpp.o  -o simple_test -fsanitize=address libsimple.a -fsanitize=fuzzer -fsanitize=address\n```\n\n## Run the harness\n\n```\n./simple_harness\n```\n\nSteps to demonstrate fuzzing\n- Look at `simple/simple.cpp` for `TODO[1]` and comment out the location where the exception does not pass through. Uncomment the section that drops the exception. The same applies to `TODO[2]`/\n- The `TODO[3]` will prevent the harness from hitting default RSS limits. This is a common problem with basic harnesses but the example here is contrived.\n- Look at `CMakeList.txt` and comment out the coverage lines. Do the same in `simple/simple.cpp` to challenge the harness to work harder to find a crash. Rebuild with `cmake` and `make` then `time ./simple_harness` and see the difference.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheopolis%2Fsimple-libfuzzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheopolis%2Fsimple-libfuzzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheopolis%2Fsimple-libfuzzer/lists"}