[all-commits] [llvm/llvm-project] 5f479e: [ORC] Capture JD by value in MachOPlatform::pushIn...

lhames via All-commits all-commits at lists.llvm.org
Fri Nov 11 16:01:40 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5f479ee7fc7a3a311cd62642de655c08321af981
      https://github.com/llvm/llvm-project/commit/5f479ee7fc7a3a311cd62642de655c08321af981
  Author: Lang Hames <lhames at gmail.com>
  Date:   2022-11-11 (Fri, 11 Nov 2022)

  Changed paths:
    M llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp

  Log Message:
  -----------
  [ORC] Capture JD by value in MachOPlatform::pushInitializersLoop.

The lambda may run after pushInitializersLoop returns.


  Commit: e7707464a3f7bf0c6011809d80d0a6e525be184b
      https://github.com/llvm/llvm-project/commit/e7707464a3f7bf0c6011809d80d0a6e525be184b
  Author: Lang Hames <lhames at gmail.com>
  Date:   2022-11-11 (Fri, 11 Nov 2022)

  Changed paths:
    M compiler-rt/lib/orc/macho_platform.cpp

  Log Message:
  -----------
  [ORC-RT][MachO] Unlock JDStatesMutex during push-initializers to avoid deadlock.

During __orc_rt_macho_jit_dlopen the ORC runtime will make a request to the JIT
to push any new initializers. Since this call may add new JD-state to the
runtime (and is expected to in general) we need to unlock the JDStatesMutex
during this operation (and similarly when running initializers and atexits, as
these may call trigger push-initializers recursively).

No testcase yet: I haven't been able to reproduce the deadlock when running
llvm-jitlink in in-process mode, and we don't support out-of-process mode in
regression tests yet.


Compare: https://github.com/llvm/llvm-project/compare/b473734efd90...e7707464a3f7


More information about the All-commits mailing list