[all-commits] [llvm/llvm-project] 175665: [libc] Resolve race condition in sub-process test ...

Paula Toth via All-commits all-commits at lists.llvm.org
Tue Mar 17 13:00:13 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 17566573b2997e468cb4190c6853b1ebea125962
      https://github.com/llvm/llvm-project/commit/17566573b2997e468cb4190c6853b1ebea125962
  Author: Paula Toth <paulatoth at google.com>
  Date:   2020-03-17 (Tue, 17 Mar 2020)

  Changed paths:
    M libc/utils/testutils/ExecuteFunctionUnix.cpp

  Log Message:
  -----------
  [libc] Resolve race condition in sub-process test runner.

Summary:
There seems to be a race condition between the pipe closing and the child process death. Likely these two events are not atomic on some versions of linux.

With the removal of `WNOHANG` we eliminate the race condition, however if the child closes the pipe intentionally then it could result in the test runner hanging. I find this situation less likely, where as I experience failures locally with this race condition rather consistently.

Reviewers: sivachandra, abrachet

Reviewed By: sivachandra, abrachet

Subscribers: MaskRay, jfb, tschuett, libc-commits

Tags: #libc-project

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




More information about the All-commits mailing list