Bug in 3.9.0 RTDyldMemoryManager.cpp

Hi folks,

I’m still using MCJIT (I know, I know), and I spotted a crash in exception handling when I moved from llvm 3.8 to llvm 3.9. I traced it back to EH frames not being deregistered due to a (typo?) mistake in RTDyldMemoryManager.cpp:

void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) override {
registerEHFramesInProcess(Addr, Size);
}

…I overrode the function to call deregister instead of register in my own MemMgr and all’s now well.

The crash manifests itself as a seg fault when a process causes an exception after JITted code has been removed.

Cheers,

Matt

Hi Matt,

Thanks very much for catching this. I’ve fixed it in r283123.

Cheers,
Lang.

Sweet! Took me a few hours of head-scratching: I’m glad we can save someone else the debugging :slight_smile: