Skip to content

Fuzzing SwiftTerm

Miguel de Icaza edited this page Apr 25, 2020 · 2 revisions

Swift as provided by Apple does not come with support for Fuzzing, you need to install an open source toolchain from swift.org.

Download your package from Swift.org, and then rebuild the software like this:

bash$ SWIFT_EXEC=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swiftc  swift build -Xswiftc "-sanitize=fuzzer" -Xswiftc "-parse-as-library"

Then you can run the resulting executable, which has been instrumented with the fuzzer:

bash$ ./SwiftTerm/.build/debug/SwiftTermFuzz fuzzer-corpus -rss_limit_mb=40480mb -jobs 12

This relies on the entry point in the SwiftTermFuzzer target.

Clone this wiki locally