The issue is in llvm/compiler-rt: - to have good counters value there's a called to ```gcov_flush``` before each ```fork``` call: https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp#L659 - since in a process we can have several threads which are forking (it's what's happening here) then we've several call to ```gcov_flush``` which is not synchronized. So the fix is probably easy: just add a locked section in ```gcov_flush```.
Bug 1599436 Comment 1 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
The issue is in llvm/compiler-rt: - to have good counters value there's a call to ```gcov_flush``` before each ```fork``` call: https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp#L659 - since in a process we can have several threads which are forking (it's what's happening here) then we've several call to ```gcov_flush``` which is not synchronized. So the fix is probably easy: just add a locked section in ```gcov_flush```.