08-08-2023 09:19 AM
Hi,
I've integrated OpenXR in my custom game engine. It works fine when I use my Oculus headset using SteamVR as the OpenXR runtime.
However, when using Oculus as the OpenXR runtime, I get a null pointer crash deep inside LibOVRRT64_1.dll, which is being called by OpenXR SDK at xrCreateSession(), which was called by my program.
Here's the relevant part of the callstack:
call stack
Who can I contact at Oculus to help solve this driver crash? Do you want a coredump of the crash?
Thanks!
08-08-2023 01:40 PM
Thanks for reporting @stenyak.
I don't know if a core dump would help very much unless you can supply symbols for your binary too?
Otherwise, maybe you let me know the data supplied in the XrSessionCreateInfo parameter?
08-08-2023 02:49 PM
Ok, just in case, here's the api dump of both xrCreateInstance, and the (crashing) xrCreateSession:
XrResult xrCreateInstance
const XrInstanceCreateInfo* info = 0x00000002250fe208
XrStructureType info->type = 3
const void * info->next = 0x0000000000000000
XrInstanceCreateFlags info->createFlags = 0
XrApplicationInfo info->applicationInfo = 0x00000002250fe220
char* info->applicationInfo->applicationName = redacted
uint32_t info->applicationInfo->applicationVersion = 0x493e0
char* info->applicationInfo->engineName = redacted
uint32_t info->applicationInfo->engineVersion = 0x493e0
XrVersion info->applicationInfo->apiVersion = 0x1000000000017
uint32_t info->enabledApiLayerCount = 0x2
const char* const* info->enabledApiLayerNames = 0x00000002250FE778
const char* const* info->enabledApiLayerNames[0] = XR_APILAYER_LUNARG_core_validation
const char* const* info->enabledApiLayerNames[1] = XR_APILAYER_LUNARG_api_dump
uint32_t info->enabledExtensionCount = 0x1
const char* const* info->enabledExtensionNames = 0x0000017490BA9080
const char* const* info->enabledExtensionNames[0] = XR_KHR_vulkan_enable
XrInstance* instance = 0x00000002250fdab8
XrResult xrCreateSession
XrInstance instance = 00007B4400000001
const XrSessionCreateInfo* createInfo = 0x00000002250feac8
XrStructureType createInfo->type = XR_TYPE_SESSION_CREATE_INFO
const void * createInfo->next = 0x00000002250fec90
const XrGraphicsBindingVulkanKHR* createInfo->next = 0x00000002250fec90
XrStructureType createInfo->next->type = XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR
const void * createInfo->next->next = 0x0000000000000000
VkInstance createInfo->next->instance = 000001743FEE10D0
VkPhysicalDevice createInfo->next->physicalDevice = 0000017443EECA20
VkDevice createInfo->next->device = 000001744400E1A0
uint32_t createInfo->next->queueFamilyIndex = 0x0
uint32_t createInfo->next->queueIndex = 0x0
XrSessionCreateFlags createInfo->createFlags = 0
XrSystemId createInfo->systemId = 14
XrSession* session = 0000017444036EC8
08-08-2023 03:05 PM
It's a bit surprising that `queueFamilyIndex` and `queueIndex` are 0 but that shouldn't cause a NULL pointer dereference. I don't think there is much that I can do without a crash dump (with pdb).
08-09-2023 01:42 AM
I'll check if I can provide symbols for my binary, although I assumed my dump together with your DLL's symbols (that I presume you have) would be enough to debug the nullptr.
08-10-2023 08:58 AM
For anybody who comes to this issue in future - @stenyak and I investigated this issue and found it to be a problem in the application code. The crash happened in the Vulkan Loader because the data from `xrGetVulkanDeviceExtensionsKHR` was not being used when creating the VkDevice.
Thanks,
John
08-10-2023 09:35 AM
Thanks John, was about to come here to post the solution myself!
So I was indeed not loading all the required Vulkan extensions, which made the runtime unable to work as intended, leading to that crash.