[PATCH] D150184: [ORC] Fix race-condition in RTDyldObjectLinkingLayer::onObjEmit.
Moritz Kroll via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 9 02:06:20 PDT 2023
mkroll created this revision.
mkroll added a reviewer: lhames.
Herald added a subscriber: hiraditya.
Herald added a project: All.
mkroll requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
The blocking version of ExecutionSession::lookup() uses std::promise() to wait
for the result of a compilation.
In RTDyldObjectLinkingLayer::onObjEmit() another thread could have compiled
the object and notify the promise via R.notifyEmitted(), that the object was emitted, before
the memory manager of the object was registered with the resource tracker.
Thus the code could already be executed and the object removed from the
JIT, before the memory manager was registered, leading to a errors
about a defunct resource tracker.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D150184
Files:
llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150184.520625.patch
Type: text/x-patch
Size: 5641 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230509/57cfe73c/attachment.bin>
More information about the llvm-commits
mailing list