This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] Fix Alarm callback in fuchsia.
ClosedPublic

Authored by charco on Oct 9 2019, 1:15 PM.

Details

Summary

This patch adds an #if macro to skip the InFuzzingThread() comparison
for fuchsia, similar to what it is done for Windows and NetBSD.

In fuchsia, the alarm callback runs in a separate thread[0], making it fail
the comparison InFuzzingThread(), breaking the -timeout flag.

[0]:
https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp#L323

Event Timeline

charco created this revision.Oct 9 2019, 1:15 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 9 2019, 1:15 PM
Herald added subscribers: llvm-commits, Restricted Project, kristof.beyls, krytarowski. · View Herald Transcript
jakehehrlich accepted this revision.Oct 9 2019, 1:17 PM

LGTM except a nit

compiler-rt/lib/fuzzer/FuzzerLoop.cpp
276–277

Can you mention that Fuchsia does the same thing as windows here?

This revision is now accepted and ready to land.Oct 9 2019, 1:17 PM
charco updated this revision to Diff 224142.Oct 9 2019, 1:29 PM

Update comments to keep in sync with code.

charco marked an inline comment as done.Oct 9 2019, 1:30 PM

Thanks for the review!

jakehehrlich closed this revision.Oct 9 2019, 2:02 PM