[all-commits] [llvm/llvm-project] 55e8f7: [ORC] Allow FailedToMaterialize errors to outlive ...

lhames via All-commits all-commits at lists.llvm.org
Sat May 21 13:51:17 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 55e8f721d4d0996cbe5dc802a2c5fbe48dac0d44
      https://github.com/llvm/llvm-project/commit/55e8f721d4d0996cbe5dc802a2c5fbe48dac0d44
  Author: Lang Hames <lhames at gmail.com>
  Date:   2022-05-21 (Sat, 21 May 2022)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/Orc/Core.h
    M llvm/lib/ExecutionEngine/Orc/Core.cpp
    M llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp

  Log Message:
  -----------
  [ORC] Allow FailedToMaterialize errors to outlive ExecutionSessions.

Idiomatic llvm::Error usage can result in a FailedToMaterialize error tearing
down an ExecutionSession instance. Since the FailedToMaterialize error holds
SymbolStringPtrs and JITDylib references this leads to crashes when accessing
or logging the error.

This patch modifies FailedToMaterialize to retain the SymbolStringPool and
JITDylibs involved in the failure so that we can safely report an error message
to the client, even if the error tears down the session.

The contract for JITDylibs allows the getName method to be used even after the
session has been torn down, but no other JITDylib fields should be accessed via
the FailedToMaterialize error if the ssesion has been torn down. Logging the
error is guaranteed to be safe in all cases.




More information about the All-commits mailing list