Audit core ORC operations for JITDylib-closed safety.
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
`llvm/include/llvm/ExecutionEngine/Orc/Core.h` and `llvm/lib/ExecutionEngine/Orc/Core.cpp` both contain assertions of the form
```c++
assert(State == Open && "JD is defunct");
```
but treating this as a programmatic error is impractical: When the session is ended, `ExecutionSession::endSession()` closes all JITDylibs before shutting down the `TaskDispatcher` (via `ExecutorProcessControl::disconnect`), but this means that there may be in-flight materialisations targeting the now-closed JITDylibs. When these materialisations attempt to interact with the closed JITDylib they will trigger this assertion. (Similar issues may arise if a JITDylib is closed during the session).
We should audit these assertions, and I expect that most of them should be replaced with a recoverable error: either `ResourceTrackerDefunct`, or the upcoming `JITDylibDefunct` error.
Contributor guide
Assessment
This issue has not been assessed yet.