llvm-project/compiler-rt/lib/profile
Calixte Denizet bec223a9bc [profile] Don't crash when forking in several threads
Summary:
When forking in several threads, the counters were written out in using the same global static variables (see GCDAProfiling.c): that leads to crashes.
So when there is a fork, the counters are resetted in the child process and they will be dumped at exit using the interprocess file locking.
When there is an exec, the counters are written out and in case of failures they're resetted.

Reviewers: jfb, vsk, marco-c, serge-sans-paille

Reviewed By: marco-c, serge-sans-paille

Subscribers: llvm-commits, serge-sans-paille, dmajor, cfe-commits, hiraditya, dexonsmith, #sanitizers, marco-c, sylvestre.ledru

Tags: #sanitizers, #clang, #llvm

Differential Revision: https://reviews.llvm.org/D78477
2020-05-07 14:13:11 +02:00
..
CMakeLists.txt [profile] Move RuntimeCounterRelocation and ProfileDumped into a separate file 2020-03-24 20:27:14 -07:00
GCDAProfiling.c [profile] Don't crash when forking in several threads 2020-05-07 14:13:11 +02:00
InstrProfiling.c [profile] Move RuntimeCounterRelocation and ProfileDumped into a separate file 2020-03-24 20:27:14 -07:00
InstrProfiling.h [profile] Make atexit hook a no-op on Fuchsia 2020-03-24 18:47:38 -07:00
InstrProfilingBiasVar.c [profile] Support counter relocation at runtime 2020-01-17 15:02:23 -08:00
InstrProfilingBuffer.c [profile] Make atexit hook a no-op on Fuchsia 2020-03-24 18:47:38 -07:00
InstrProfilingFile.c [profile] Move RuntimeCounterRelocation and ProfileDumped into a separate file 2020-03-24 20:27:14 -07:00
InstrProfilingInternal.c [profile] Move RuntimeCounterRelocation and ProfileDumped into a separate file 2020-03-24 20:27:14 -07:00
InstrProfilingInternal.h [profile] Move RuntimeCounterRelocation and ProfileDumped into a separate file 2020-03-24 20:27:14 -07:00
InstrProfilingMerge.c Reland "[CMake] Support installation of InstrProfData.inc" 2019-11-22 14:09:46 -08:00
InstrProfilingMergeFile.c Reland "[CMake] Support installation of InstrProfData.inc" 2019-11-22 14:09:46 -08:00
InstrProfilingNameVar.c Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InstrProfilingPlatformDarwin.c Reland compiler-rt support for order file instrumentation. 2019-03-08 15:30:56 +00:00
InstrProfilingPlatformFuchsia.c [profile] Avoid duplicating or leaking VMO 2020-04-17 00:54:12 -07:00
InstrProfilingPlatformLinux.c Reland compiler-rt support for order file instrumentation. 2019-03-08 15:30:56 +00:00
InstrProfilingPlatformOther.c Reland compiler-rt support for order file instrumentation. 2019-03-08 15:30:56 +00:00
InstrProfilingPlatformWindows.c Reland compiler-rt support for order file instrumentation. 2019-03-08 15:30:56 +00:00
InstrProfilingPort.h [profile] Support online merging with continuous sync mode 2019-11-18 12:56:58 -08:00
InstrProfilingRuntime.cpp [profile] Make atexit hook a no-op on Fuchsia 2020-03-24 18:47:38 -07:00
InstrProfilingUtil.c [profile] Fix file contention causing dropped counts on Windows under -fprofile-generate 2019-11-27 15:55:13 +01:00
InstrProfilingUtil.h Add a shim for setenv on PS4 since it does not exist. 2019-11-12 15:05:45 -08:00
InstrProfilingValue.c Reland "[CMake] Support installation of InstrProfData.inc" 2019-11-22 14:09:46 -08:00
InstrProfilingWriter.c [profile] Avoid allocating a page on the stack, NFC 2019-12-11 10:04:00 -08:00
WindowsMMap.c [GCOV] Close file mapping handle on Windows, so flushed gcda files can be removed while the process is in execution 2018-11-07 09:38:26 +00:00
WindowsMMap.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00