aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Orc/ExecutorProcessControl.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2021-10-12 13:24:54 -0700
committerLang Hames <lhames@gmail.com>2021-10-12 13:40:15 -0700
commit2815ed57e3c99ab6c42399c3d0cf57cc118eb5df (patch)
tree78e5279855acbb5106a111dbe73e9ad38dc14a9c /llvm/lib/ExecutionEngine/Orc/ExecutorProcessControl.cpp
parent9939e562f73ca58369c4f15a95f06ba7ae8215c6 (diff)
downloadllvm-2815ed57e3c99ab6c42399c3d0cf57cc118eb5df.zip
llvm-2815ed57e3c99ab6c42399c3d0cf57cc118eb5df.tar.gz
llvm-2815ed57e3c99ab6c42399c3d0cf57cc118eb5df.tar.bz2
[ORC] Shut down dispatcher in ExecutorProcessControl implementations.
f3411616896 added a task dispatcher for async handlers, but didn't add a TaskDispatcher::shutdown call to SelfExecutorProcessControl or SimpleRemoteEPC. This patch adds the missing call, which ensures that we don't destroy the dispatcher while tasks are still running. This should fix the use-after-free crash seen in https://lab.llvm.org/buildbot/#/builders/5/builds/13063
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/ExecutorProcessControl.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Orc/ExecutorProcessControl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/ExecutorProcessControl.cpp b/llvm/lib/ExecutionEngine/Orc/ExecutorProcessControl.cpp
index 0145387..1c3d728 100644
--- a/llvm/lib/ExecutionEngine/Orc/ExecutorProcessControl.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/ExecutorProcessControl.cpp
@@ -130,7 +130,10 @@ void SelfExecutorProcessControl::callWrapperAsync(ExecutorAddr WrapperFnAddr,
SendResult(WrapperFn(ArgBuffer.data(), ArgBuffer.size()));
}
-Error SelfExecutorProcessControl::disconnect() { return Error::success(); }
+Error SelfExecutorProcessControl::disconnect() {
+ D->shutdown();
+ return Error::success();
+}
void SelfExecutorProcessControl::writeUInt8sAsync(
ArrayRef<tpctypes::UInt8Write> Ws, WriteResultFn OnWriteComplete) {