llvm-capstone/compiler-rt/test
KAWASHIMA Takahiro 7d4167430c [gcov] Fix simultaneous .gcda creation/lock
Fixes PR45673

The commit 9180c14fe4 (D76206) resolved only a part of the problem
of concurrent .gcda file creation. It ensured that only one process
creates the file but did not ensure that the process locks the
file first. If not, the process which created the file may clobber
the contents written by a process which locked the file first.
This is the cause of PR45673.

This commit prevents the clobbering by revising the assumption
that a process which creates the file locks the file first.
Regardless of file creation, a process which locked the file first
uses fwrite (new_file==1) and other processes use mmap (new_file==0).

I also tried to keep the creation/first-lock process same by using
mkstemp/link/unlink but the code gets long. This commit is more
simple.

Note: You may be confused with other changes which try to resolve
concurrent file access. My understanding is (may not be correct):

D76206:   Resolve race of .gcda file creation (but not lock)
This one: Resolve race of .gcda file creation and lock
D54599:   Same as D76206 but abandoned?
D70910:   Resolve race of multi-threaded counter flushing
D74953:   Resolve counter sharing between parent/children processes
D78477:   Revision of D74953

Differential Revision: https://reviews.llvm.org/D79556
2020-05-13 13:03:03 +09:00
..
asan Try to make duplicate_os_log_reports.cpp more reliable. 2020-05-04 13:49:55 -07:00
BlocksRuntime
builtins [builtins] Support architectures with 16-bit int 2020-04-26 01:22:10 +02:00
cfi
crt
dfsan [dfsan] Fix a bug in strcasecmp() and strncasecmp(): Compare the lowercase versions of the characters when choosing a return value. 2020-04-20 17:13:40 -07:00
fuzzer [libFuzzer] Fix denominator in the "inputs have DFT" log line. 2020-02-19 11:05:14 -08:00
gwp_asan [GWP-ASan] Crash Handler API. 2020-02-05 15:39:17 -08:00
hwasan [hwasan] Fix allocator alignment. 2020-05-11 15:45:42 -07:00
interception
lsan [lsan] Fix warnings lit config 2020-05-05 22:42:14 -07:00
msan Fix MSan test use-after-dtor.cpp under new pass manager 2020-05-08 09:12:41 -07:00
profile [gcov] Fix simultaneous .gcda creation/lock 2020-05-13 13:03:03 +09:00
safestack
sanitizer_common [sanitizer] Enable whitelist/blacklist in new PM 2020-05-10 02:34:29 +00:00
scudo
shadowcallstack
tsan [Darwin] Fix symbolization for recent simulator runtimes. 2020-04-17 15:08:14 -07:00
ubsan [UBSan] Fix vptr checks on arm64e 2020-04-16 16:09:05 -07:00
ubsan_minimal
xray
.clang-format
CMakeLists.txt
lit.common.cfg.py [compiler-rt][test] Add feature host-byteorder-big-endian 2020-05-10 11:02:25 -07:00
lit.common.configured.in build: use Python3 for compiler-rt 2020-04-28 17:29:04 +00:00