google / atheris

Apache License 2.0
1.38k stars 111 forks source link

Link `*san_with_fuzzer.so` with `-ldl` #18

Closed fmeum closed 3 years ago

fmeum commented 3 years ago

The *san_with_fuzzer.so dynamic libraries include libFuzzer, which requires libdl.so. However, in merge_libfuzzer_sanitizer.sh, the libraries are not linked with -ldl, which means that they can only be preloaded into a binary that itself links in libdl.so. While python itself does this, shells might not, which can lead to errors when the preload is applied to e.g. a wrapper script that unpacks a packaged Python application and only then invokes python itself.

This is fixed by linking *san_with_fuzzer.so with -ldl.

fmeum commented 3 years ago

@IanPudney Could this change be included in a PyPI release? I'm currently working on adding Atheris to Bazel's rules_fuzzing and this would help implementing the OSS-Fuzz support.

TheShiftedBit commented 3 years ago

That's in progress :)

TheShiftedBit commented 3 years ago

The reason for the delay: the Mac build is built manually, and I recently got a new machine, which means rebuilding Clang and its dependencies. Yay.

TheShiftedBit commented 3 years ago

Linux and source-code builds are pushed. Mac incoming soon.

TheShiftedBit commented 3 years ago

Mac is done.