[llvm-dev] VModuleKey K not valid here
Lang Hames via llvm-dev
llvm-dev at lists.llvm.org
Tue Aug 13 14:14:55 PDT 2019
1) Can 0 ever be a valid VModuleKey? How can one reliably detect an invalid
I believe 0 was a valid VModuleKey in ORCv1. The assertion is checking the
the VModuleKey is present in the LogicalDylibs map. That means that you
have to have used that key in an addModule call, e.g.:
and not subsequently removed the key with a call to removeModule.
2) Secondly it seems to me that following the assertion there should be a
check so that the code dosn't continue? It is causing segmentation fault in
There should not be any check other than the assertion. Assertions aren't
for recoverable errors or logging, they're only for verifying that code is
being used according to contract. In this case the contract is that
removeModule is only called with valid keys. If the assertion is triggering
then either the key you're using is invalid, or my implementation of
CompileOnDemandLayer (or the assert itself) is invalid. We just need to fix
the offending code.
Out of interest: What are your plans for removeModule? It's currently
unimplemented in ORCv2. Understanding people's use cases will help with
design and prioritization.
On Tue, Aug 13, 2019 at 1:50 PM Dibyendu Majumdar via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> I am getting following assertion failure when attempting to remove a
> /llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h:311: llvm::Error
> llvm::orc::LegacyCompileOnDemandLayer<BaseLayerT, CompileCallbackMgrT,
> IndirectStubsMgrT>::removeModule(llvm::orc::VModuleKey) [with
> BaseLayerT =
> >; CompileCallbackMgrT = llvm::orc::JITCompileCallbackManager;
> IndirectStubsMgrT = llvm::orc::IndirectStubsManager;
> llvm::orc::VModuleKey = long unsigned int]: Assertion `I !=
> LogicalDylibs.end() && "VModuleKey K not valid here"' failed.
> 1) Can 0 ever be a valid VModuleKey? How can one reliably detect an
> invalid VModuleKey?
> 2) Secondly it seems to me that following the assertion there should
> be a check so that the code dosn't continue? It is causing
> segmentation fault in release builds.
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev