Skip to content

Commit dad86f5

Browse files
author
Lang Hames
committedMar 31, 2025·
[ORC] MapperJITLinkMemoryManager should deinitialize on abandon, not deallocate.
The JITLinkMemoryManager::InFlightAlloc::abandon method should only abandon memory for the current allocation, not any other allocations. In MapperJITLinkMemoryManager this corresponds to the deinitialize operation, not the deallocate operation (which releases whole slabs of memory that may be shared by many allocations). No testcase: This was spotted by inspection. The failing program was linking concurrently when one linker instance raised an error. Through the call to abandon an entire underlying slab was deallocated, resulting in segfaults in other concurrent links that were sharing that slab.
1 parent 65734de commit dad86f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎llvm/lib/ExecutionEngine/Orc/MapperJITLinkMemoryManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class MapperJITLinkMemoryManager::InFlightAlloc
4343
}
4444

4545
void abandon(OnAbandonedFunction OnFinalize) override {
46-
Parent.Mapper->release({AllocAddr}, std::move(OnFinalize));
46+
Parent.Mapper->deinitialize({AllocAddr}, std::move(OnFinalize));
4747
}
4848

4949
private:

0 commit comments

Comments
 (0)
Please sign in to comment.