[all-commits] [llvm/llvm-project] 4fed39: [ThinLTO] Fix nondeterministic exit on error.

Mircea Trofin via All-commits all-commits at lists.llvm.org
Mon Dec 13 10:09:11 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4fed39ddee4dbc23df7317a3fe311a56a9e423b5
      https://github.com/llvm/llvm-project/commit/4fed39ddee4dbc23df7317a3fe311a56a9e423b5
  Author: Mircea Trofin <mtrofin at google.com>
  Date:   2021-12-13 (Mon, 13 Dec 2021)

  Changed paths:
    M llvm/tools/llvm-lto2/llvm-lto2.cpp

  Log Message:
  -----------
  [ThinLTO] Fix nondeterministic exit on error.

In the multi-threaded case, if a thread hits an error, we mimick
LLVMContext's behavior of reporting the error and exit-ing. However,
this doesn't cleanly join the other threads, so depending on how fast
the process exits, other threads may report 'terminate called without an
active exception'.

To avoid this non-determinsim, and without introducing a more complicated
design, we just report the error, but not exit early. We do track whether
we hit errors and exit(1) after joining.

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




More information about the All-commits mailing list