libvulkan_radeon.so crash with `free(): double free detected in tcache 2`
A call to vkAllocateMemory
while trying to import memory from host pointer seems to crash the driver. One can define the info structs as follows:
VkMemoryDedicatedAllocateInfo memoryDedicatedAllocateInfo = {};
memoryDedicatedAllocateInfo.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO;
memoryDedicatedAllocateInfo.image = transferImage;
VkImportMemoryHostPointerInfoEXT importMemoryHostPointerInfo = {};
importMemoryHostPointerInfo.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT;
importMemoryHostPointerInfo.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT;
importMemoryHostPointerInfo.pHostPointer = pchpixels;
importMemoryHostPointerInfo.pNext = &memoryDedicatedAllocateInfo;
Here pchpixels
should be correctly aligned according to VkPhysicalDeviceExternalMemoryHostPropertiesEXT::minImportedHostPointerAlignment
. The call works on Intel integrated graphics, while AMD also reports that host pointer memory import is supported. If the import is not supported, the driver should at least report it correctly (which I assume is reported by VkExternalBufferProperties
with VkPhysicalDeviceExternalBufferInfo::handleType
set to VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT
)
0 0x00007f7dcb4adf25 in raise () from /usr/lib/libc.so.6
#1 0x00007f7dcb497897 in abort () from /usr/lib/libc.so.6
#2 0x00007f7dcb4f1258 in __libc_message () from /usr/lib/libc.so.6
#3 0x00007f7dcb4f877a in malloc_printerr () from /usr/lib/libc.so.6
#4 0x00007f7dcb4fa59d in _int_free () from /usr/lib/libc.so.6
#5 0x00007f7dc88c690d in ?? () from /usr/lib/libvulkan_radeon.so
#6 0x00007f7dc0c364a5 in ?? () from /usr/lib/libVkLayer_khronos_validation.so
#7 0x00007f7dc0b8a182 in ?? () from /usr/lib/libVkLayer_khronos_validation.so