You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 29, 2021. It is now read-only.
The user is creating a portability library and they try to use the LunarG Vulkan samples as a test case. Behind the scenes the portability library is calling my library.
We are setting the loader in the cmake, like this set (VULKAN_LOADER "/home/maik/src/portability/target/debug/libportability.so").
The bug is that the vk* functions are just calling themselves until they overflow the stack.
Behind the scenes in my Vulkan library I use vkGetInstanceProcAddr and vkGetDeviceProcAddr at run time. vkGetInstanceProcAddr is the only symbol that I load from the libvulkan.so.1 directly.
I printed the function pointers to the console like this
You can see here that 0x7f38eaa7b340 appears two times. My Vulkan library got the function pointer of the portability lib, where it should have gotten the function pointer of the actual Vulkan function. And I got this by calling vkGetInstanceProcAddr with "vkEnumerateInstanceExtensionProperties".
Could this be related to how the LunarG samples uses the VULKAN_LOADER?
When I load all the symbols from the libvulkan.so.1 directly, everything seems to work out.
Any idea why vkGetInstanceProcAddr would give me the wrong function pointer?
The text was updated successfully, but these errors were encountered:
I'm not clear on something, you point out that 0x7f38eaa7b340 appears twice, but both are for enumerate_instance_extension_properties. What is supposed to be the difference between these two? Is one supposed to be the call from you, and the second one supposed to be the portability library calling itself again?
And all of this (except the ICD of course) are statically linked?
And, the issue is occurring somewhere after the "Rust Vulkan Library" but before the "Vulkan ICD", right?
If that's the case, then it seems like it must be in the portability library that the GetInstanceProcAddr is returning the wrong value.
Do you happen to have an actual call-stack?
As far as setting the VULKAN_LOADER in CMake, I'm not sure if that works. I've never done it. Perhaps Lenny can give you more feedback on that.
Hi @MarkY-LunarG and thanks for getting back quickly! @MaikKlein is out of time zone now, so I'll try to answer a bit on their behalf:
you point out that 0x7f38eaa7b340 appears twice, but both are for enumerate_instance_extension_properties. What is supposed to be the difference between these two?
The first one is taken from "libvulkan.so.1" dynamic library by
calling vkGetInstanceProcAddr with "vkEnumerateInstanceExtensionProperties"
The second one is the function from the portability layer ("libportability.so") that is pointed to by VULKAN_LOADER.
Just for clarity, your call stack is this, correct?
I am the maintainer for a Vulkan library for Rust and recently I got an interesting bug report.
The user is creating a portability library and they try to use the LunarG Vulkan samples as a test case. Behind the scenes the portability library is calling my library.
We are setting the loader in the cmake, like this
set (VULKAN_LOADER "/home/maik/src/portability/target/debug/libportability.so")
.The bug is that the vk* functions are just calling themselves until they overflow the stack.
Behind the scenes in my Vulkan library I use
vkGetInstanceProcAddr
andvkGetDeviceProcAddr
at run time.vkGetInstanceProcAddr
is the only symbol that I load from thelibvulkan.so.1
directly.I printed the function pointers to the console like this
You can see here that
0x7f38eaa7b340
appears two times. My Vulkan library got the function pointer of the portability lib, where it should have gotten the function pointer of the actual Vulkan function. And I got this by callingvkGetInstanceProcAddr
with"vkEnumerateInstanceExtensionProperties"
.Could this be related to how the LunarG samples uses the
VULKAN_LOADER
?When I load all the symbols from the
libvulkan.so.1
directly, everything seems to work out.Any idea why
vkGetInstanceProcAddr
would give me the wrong function pointer?The text was updated successfully, but these errors were encountered: