test(relinker): add a libFuzzer target for the whole conversion #11366
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11366"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by guglia001 on 2026-10-26T08:49:57Z.
What
Adds
relinker_conversion_fuzzer, a libFuzzer target overRelinker::Conversion::Convert, the path the web converter takes with files users pick.ANYPS5_BUILD_FUZZERSbuilds it in relinker-only Clang builds on Linux with AddressSanitizer and UndefinedBehaviorSanitizer.--to-inteland theunused-filterlevel; the rest is the executable. Astd::exceptionis a rejected input; a sanitizer report, abort or timeout is a finding.tools/relinker_fuzz_seeds.pywrites the executables built by the relinker's Python tests as seeds, one per target system (196 seeds on currentmain).BUILD_TESTING=ON, CTest runs 20000 inputs from an empty corpus so the target keeps building and running.-fsanitize=functionis left out: it reads a signature before the target of every indirect call and faults on the generated codeandn_loweringcalls.ParamJsonParser.cppdoes not compile with Clang and libstdc++ 13 or 15 (std::pair<std::string, JsonValue>withJsonValueincomplete). That is a separate fix.docs/dev/BUILD.mdgets a Fuzzing section with the commands.Tested
Ubuntu 24.04, Clang 18.1.3,
libclang-rt-18-dev:-DANYPS5_RELINKER_ONLY=ON -DANYPS5_BUILD_FUZZERS=ON -DBUILD_TESTING=ON):ctest131/131 passed, includingrelinker_conversion_fuzzer.main(b27cc8416f), Kali Linux in WSL2, Clang 19.1.7 with libstdc++ 13 andlibclang-rt-19-dev, same configuration:ctest133/133 passed, includingrelinker_conversion_fuzzer.-fork=2 -timeout=20: 479,241 inputs, 15,487 coverage points, no crashes, timeouts or OOMs.BUILD_TESTING=ONis unchanged (ANYPS5_BUILD_FUZZERSis off by default); configuring withANYPS5_BUILD_FUZZERS=ONand GCC fails withANYPS5_BUILD_FUZZERS requires Clang on Linux.python3 tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T08:51:37Z.
Review: APPROVED
Reviewed exact head
12ab1d81f43b185c85a8872ef0c6e0547e934010against currentmaincbee224804625f2416993f94b2bc1f8c58b1d4bb.The fuzz target passes the executable bytes to the same
Relinker::Conversion::Convertpath used by conversion, and the target-byte selection covers the three target systems plus a--to-intelseed. Fuzzer builds are opt-in and restricted to relinker-only Clang builds; the smoke test is bounded by both a run count and timeout. I rantools/relinker_fuzz_seeds.pyon this exact head; it produced 196 seeds. I also ranpython3 -I tools/check_conventions.py --base cbee224804625f2416993f94b2bc1f8c58b1d4bb --head 12ab1d81f43b185c85a8872ef0c6e0547e934010(passes), and a current-main merge preview is clean.The author reports the Clang/ASan/UBSan build and 20,000-run CTest smoke test passing, plus a 20-minute campaign of 479,241 inputs without crashes, timeouts or OOMs. This host has no
clang++, so I could not independently build or run the fuzzer. Hosted conventions, intake and labels pass; the hosted product/build jobs are not present for this path set. I found no blocking issue in this test-only addition.AI-assisted review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T08:54:40Z.
Review: APPROVED
Follow-up review of exact current head
bcb880b8a3a3a77f28417d8ec1d7f62b19a33981against currentmaincbee224804625f2416993f94b2bc1f8c58b1d4bb.This replacement commit has the identical tree to the reviewed head
12ab1d81f43b185c85a8872ef0c6e0547e934010. I reran conventions against current main (passes) and reran the seed generator (196 seeds). Current hosted conventions, labels and intake checks pass. The host still lacksclang++, so the reported Clang/libFuzzer build and campaign remain author-run. No new finding; approval stands for this exact head.AI-assisted review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T09:44:43Z.
Review: DISMISSED
Follow-up review of exact head
bcb880b8a3a3a77f28417d8ec1d7f62b19a33981against currentmain4e43321bd6ceccdc1ae28568bbbc35d9a6446464. The tree matches the previously reviewed fuzz-target tree. Current-head conventions andgit diff --checkpass; I rerantools/relinker_fuzz_seeds.pyand it generated 196 seeds. The author reports the Clang/ASan/UBSan build, 20,000-input CTest smoke run and 20-minute campaign; this host has noclang++, so I could not independently run those.Two current open-PR integration conflicts need coordination before this branch is ready to merge:
docs/dev/BUILD.md; both add sections at the same location.CMakeLists.txt; both add sanitizer/build-option handling in the same block.Please coordinate the order with those authors and update the checklist
Depends online for any required merge order, then rebase/resolve and rerun the checks affected by the resolution. I confirmed both PRs remain open and the conflicts are present in three-way merge previews of their current heads.