[libFuzzer] Guard symbolization with try-lock.
authorMatt Morehouse <mascasa@google.com>
Tue, 8 May 2018 23:45:05 +0000 (23:45 +0000)
committerMatt Morehouse <mascasa@google.com>
Tue, 8 May 2018 23:45:05 +0000 (23:45 +0000)
commit14cf71a3a505eea44bcea188df510107d9655205
tree1343fd194379e1b5797a676ed78538c6717ef16c
parent48283ba3a18235aad90877ef3bfe616bd902eb1b
[libFuzzer] Guard symbolization with try-lock.

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.

Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D46605

llvm-svn: 331825
compiler-rt/lib/fuzzer/FuzzerLoop.cpp
compiler-rt/lib/fuzzer/FuzzerUtil.cpp
compiler-rt/lib/fuzzer/FuzzerUtil.h
compiler-rt/test/fuzzer/Bingo.h [new file with mode: 0644]
compiler-rt/test/fuzzer/SymbolizeDeadlock.cpp [new file with mode: 0644]
compiler-rt/test/fuzzer/symbolize-deadlock.test [new file with mode: 0644]