forked from OSchip/llvm-project
[ORC] Shut down dispatcher in ExecutorProcessControl implementations.
f341161689
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
This commit is contained in:
parent
9939e562f7
commit
2815ed57e3
|
@ -130,7 +130,10 @@ void SelfExecutorProcessControl::callWrapperAsync(ExecutorAddr WrapperFnAddr,
|
||||||
SendResult(WrapperFn(ArgBuffer.data(), ArgBuffer.size()));
|
SendResult(WrapperFn(ArgBuffer.data(), ArgBuffer.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Error SelfExecutorProcessControl::disconnect() { return Error::success(); }
|
Error SelfExecutorProcessControl::disconnect() {
|
||||||
|
D->shutdown();
|
||||||
|
return Error::success();
|
||||||
|
}
|
||||||
|
|
||||||
void SelfExecutorProcessControl::writeUInt8sAsync(
|
void SelfExecutorProcessControl::writeUInt8sAsync(
|
||||||
ArrayRef<tpctypes::UInt8Write> Ws, WriteResultFn OnWriteComplete) {
|
ArrayRef<tpctypes::UInt8Write> Ws, WriteResultFn OnWriteComplete) {
|
||||||
|
|
|
@ -92,6 +92,7 @@ void SimpleRemoteEPC::callWrapperAsync(ExecutorAddr WrapperFnAddr,
|
||||||
|
|
||||||
Error SimpleRemoteEPC::disconnect() {
|
Error SimpleRemoteEPC::disconnect() {
|
||||||
T->disconnect();
|
T->disconnect();
|
||||||
|
D->shutdown();
|
||||||
std::unique_lock<std::mutex> Lock(SimpleRemoteEPCMutex);
|
std::unique_lock<std::mutex> Lock(SimpleRemoteEPCMutex);
|
||||||
DisconnectCV.wait(Lock, [this] { return Disconnected; });
|
DisconnectCV.wait(Lock, [this] { return Disconnected; });
|
||||||
return std::move(DisconnectErr);
|
return std::move(DisconnectErr);
|
||||||
|
|
Loading…
Reference in New Issue