[all-commits] [llvm/llvm-project] f87ceb: [AMDGPU] Adding mutex to guard lld::elf::link inte...

Zhuoran Yin via All-commits all-commits at lists.llvm.org
Mon Sep 21 11:46:10 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f87ceb63eb011e5cd653218af619097b58bf568f
      https://github.com/llvm/llvm-project/commit/f87ceb63eb011e5cd653218af619097b58bf568f
  Author: jerryyin <zhuoryin at amd.com>
  Date:   2020-09-21 (Mon, 21 Sep 2020)

  Changed paths:
    M mlir/tools/mlir-rocm-runner/mlir-rocm-runner.cpp

  Log Message:
  -----------
  [AMDGPU] Adding mutex to guard lld::elf::link interface use

check-mlir target run tests simultaneously with multiple threads. This caused multiple threads to invoke the `lld::elf::link()` interface at the same time. Since the interface does not have a thread-safe implementation, add a metex to prevent multi-threaded access.

I discovered this by looking the the failure stack trace. lld/ELF/symbolTable.cpp, SymbolTable::insert() hit into an assert with related to Epoch Trackers. The root cause is to due to there is no protection around the symMap (update) which is implemented in non-thread safe data structure: denseMap.

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




More information about the All-commits mailing list