This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] Guard symbolization with try-lock.
ClosedPublic

Authored by morehouse on May 8 2018, 3:05 PM.

Details

Summary

When out-of-memory or timeout occurs, threads can be stopped during
symbolization, thereby causing a deadlock when the OOM/TO handlers
attempt symbolization. We avoid this deadlock by skipping symbolization
if another thread is symbolizing.

Diff Detail

Repository
rL LLVM

Event Timeline

morehouse created this revision.May 8 2018, 3:05 PM
kcc added a comment.May 8 2018, 3:11 PM

code LGTM.
Any chance to get a test (something that hangs not, and doesn't with this change)?
I understand it's not trivial...

morehouse updated this revision to Diff 145812.May 8 2018, 4:36 PM
  • Add (probabilistic) deadlock test.

At least on my machine this test deadlocks ~75% of the time. But of course it is tough to say what will happen on other machines.

kcc accepted this revision.May 8 2018, 4:43 PM

LGTM, thanks!

This revision is now accepted and ready to land.May 8 2018, 4:43 PM
This revision was automatically updated to reflect the committed changes.