[all-commits] [llvm/llvm-project] 3300bc: [llvm-exegesis] Fix race condition in subprocess m...

Aiden Grossman via All-commits all-commits at lists.llvm.org
Mon Nov 20 01:10:56 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3300bc34f7bccf29c14221fa4b651f7bc82c46d5
      https://github.com/llvm/llvm-project/commit/3300bc34f7bccf29c14221fa4b651f7bc82c46d5
  Author: Aiden Grossman <agrossman154 at yahoo.com>
  Date:   2023-11-20 (Mon, 20 Nov 2023)

  Changed paths:
    M llvm/test/tools/llvm-exegesis/X86/latency/memory-annotations-livein.s
    M llvm/test/tools/llvm-exegesis/X86/latency/memory-annotations.s
    M llvm/test/tools/llvm-exegesis/X86/latency/subprocess-abnormal-exit-code.s
    M llvm/test/tools/llvm-exegesis/X86/latency/subprocess-preserved-registers.s
    M llvm/test/tools/llvm-exegesis/X86/latency/subprocess-segfault.s
    M llvm/test/tools/llvm-exegesis/X86/latency/subprocess.s
    M llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp

  Log Message:
  -----------
  [llvm-exegesis] Fix race condition in subprocess mode (#72778)

If there were some scheduler effects where something like the parent
process got interrupted while the child process continued to run, there
would be nothing blocking it from exiting before the parent process
issued a PTRACE_ATTACH call. This would cause transient failures as this
occurred pretty rarely. This patch removes the possibility of a
transient failure by ensuring that the parent process attaches to the
child process before sending the counter file descriptor through the
socket, ensuring that the child process has at most progressed to being
blocked in the read call for the counter file descriptor.




More information about the All-commits mailing list