-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Using the latest Android Studio (Build #AI-251.26094.121.2512.13930704), I get a crash when I call vkSetDebugUtilsObjectNameEXT.
Virtual device: API 36, Android 16, x86_64 ABI.
As far as I know, the emulator uses gfxstream under the hood.
Source code of vkSetDebugUtilsObjectNameEXT:
VKAPI_ATTR VkResult VKAPI_CALL
vk_common_SetDebugUtilsObjectNameEXT(
VkDevice _device,
const VkDebugUtilsObjectNameInfoEXT *pNameInfo)
{
VK_FROM_HANDLE(vk_device, device, _device);
#ifdef VK_USE_PLATFORM_ANDROID_KHR
if (pNameInfo->objectType == VK_OBJECT_TYPE_SWAPCHAIN_KHR ||
pNameInfo->objectType == VK_OBJECT_TYPE_SURFACE_KHR) {
#else
if (pNameInfo->objectType == VK_OBJECT_TYPE_SURFACE_KHR) {
#endif
mtx_lock(&device->swapchain_name_mtx);
VkResult res = vk_common_set_object_name_locked(device, pNameInfo);
mtx_unlock(&device->swapchain_name_mtx);
return res;
}
struct vk_object_base *object =
vk_object_base_from_u64_handle(pNameInfo->objectHandle,
pNameInfo->objectType);
assert(object->device != NULL || object->instance != NULL);
VkAllocationCallbacks *alloc = object->device != NULL ?
&object->device->alloc : &object->instance->alloc;
if (object->object_name) {
vk_free(alloc, object->object_name);
object->object_name = NULL;
}
if (pNameInfo->pObjectName != NULL) {
object->object_name = vk_strdup(alloc, pNameInfo->pObjectName,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!object->object_name)
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
return VK_SUCCESS;
}The crash occurs at vk_strdup, because of a nullpointer dereference.
There are no special steps needed to reproduce, it should be enough to enable VK_LAYER_KHRONOS_validation and VK_EXT_debug_utils, then call vkSetDebugUtilsObjectNameEXT.
Metadata
Metadata
Assignees
Labels
No labels