Page MenuHomePhabricator

[libFuzzer] Fix Alarm callback in fuchsia.
ClosedPublic

Authored by charco on Wed, Oct 9, 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.Wed, Oct 9, 1:15 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptWed, Oct 9, 1:15 PM
Herald added subscribers: llvm-commits, Restricted Project, kristof.beyls, krytarowski. · View Herald Transcript
jakehehrlich accepted this revision.Wed, Oct 9, 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.Wed, Oct 9, 1:17 PM
charco updated this revision to Diff 224142.Wed, Oct 9, 1:29 PM

Update comments to keep in sync with code.

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

Thanks for the review!

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