gfxreconstruct: vkGetInstanceProcAddr with unknown name crashes on linux

When capturing on linux, and if my app calls vkGetInstanceProcAddr with an unknown name, I get

/home/olv/projects/Vulkan-Loader/loader/unknown_function_handling.c:315: loader_phys_dev_ext_gpa_term_no_check: Assertion `NULL != inst' failed.

gdb says

(gdb) bt
#4  0x00007ffff7eeebd9 in loader_phys_dev_ext_gpa_term_no_check (inst=0x0, 
    funcName=0x5555555607d8 "vkFoo")
    at /home/olv/projects/Vulkan-Loader/loader/unknown_function_handling.c:315
#5  0x00007ffff7edc0c2 in loader_gpdpa_instance_terminator (inst=0x55555568faf0, 
    pName=0x5555555607d8 "vkFoo") at /home/olv/projects/Vulkan-Loader/loader/loader.c:3953
#6  0x00007ffff7eee63f in loader_check_layer_list_for_phys_dev_ext_address (inst=0x5555555712b0, 
    funcName=0x5555555607d8 "vkFoo")
    at /home/olv/projects/Vulkan-Loader/loader/unknown_function_handling.c:187
#7  0x00007ffff7eee73e in loader_phys_dev_ext_gpa_impl (inst=0x5555555712b0, 
    funcName=0x5555555607d8 "vkFoo", is_tramp=true)
    at /home/olv/projects/Vulkan-Loader/loader/unknown_function_handling.c:222
#8  0x00007ffff7eeeb6e in loader_phys_dev_ext_gpa_tramp (inst=0x5555555712b0, 
    funcName=0x5555555607d8 "vkFoo")
    at /home/olv/projects/Vulkan-Loader/loader/unknown_function_handling.c:307
#9  0x00007ffff7ebb5e6 in trampoline_get_proc_addr (inst=0x5555555712b0, funcName=0x5555555607d8 "vkFoo")
    at /home/olv/projects/Vulkan-Loader/loader/gpa_helper.c:262
#10 0x00007ffff7ee6527 in vkGetInstanceProcAddr (instance=0x5555555712b0, pName=0x5555555607d8 "vkFoo")
    at /home/olv/projects/Vulkan-Loader/loader/trampoline.c:106

I noticed this because volk can call vkGetInstanceProcAddr with unknown names.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 31 (25 by maintainers)

Commits related to this issue

Most upvoted comments

I appreciate you both putting in so much thought on this issue, which I’ve stumbled into due to hitting it myself while starting what should have been my getting to know the code, first task, from a position of vague familiarity with the loader as an application developer. So thanks for the great input, I’m learning from you! 😃