Issue 174568
Summary Crash when JITDylib is closed while an archive member is being linked.
Labels orcjit
Assignees
Reporter lhames
    ### Description:

If a JITDylib is closed while an archive member is in the process of being linked it may cause a crash.

### Root cause:

Closing the JITDylib destroys attached DefinitionGenerators. StaticLibraryDefinitionGenerator destruction destroys the `MemoryBuffer` for the archive. The in-flight link then accesses the freed memory, triggering a crash.

### Fix:

The `MemoryBuffer` for the archive member being linked needs to keep the archive buffer alive. We'll need to introduce a new `MemoryBuffer` derivative for this.

### Reproduction:

Difficult, as this depends on scheduling: the archive member must be in the process of being linked when some other thread causes the JITDylib to be closed (e.g. due to an error that will tear down the JIT).
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to