I was following the vkguide.dev code when I realized that compiling with -fsanitize=leak -fsanitize=address -fno-omit-frame-pointer (g++). I figured this was some sort of issue with using vkbootstrap improperly, but even making a new project, and then having only the instance create stuff from vulkan-tutorial and making sure vkDestroyInstance is being called results in the sanitizers complaining of leaked bytes. Is this just an error in my code or some quirk of vulkan that the sanitizers aren't accurate on?
#Possible memory leak with VK_INSTANCE
18 messages · Page 1 of 1 (latest)
Let me guess, you are getting a TON of 'cannot locate source' messages
I would very much hazzard a 'these are issues with the sanitizer not being able to peer inside the driver and make logical sense of things
No, it's all direct/indirect leaks at the end of the program
Plus, the reason you get errors in the sanitizer is that the leak check happens after the various driver dll's have been unloaded, leading to the sanitizer memory leaks being unable to resolve the source
can you copy paste the logs here?
yep #1 0x7f1721d78945 (<unknown module>) is what I meant by cannot locate source
I saw these in 2017 when I first did vulkan so these are either complete false positives or just driver issues in general
Ok, that makes sense. I figured it was something to do with the sanitizers being unable to understand something, I just wanted to check
Thank you
(I have always wanted to try to figure out what is causing them, but its just not a huge priority)
What happens if you compile the driver with debug info?
If i crash in the driver i get a stacktrace into the driver, so I maybe the sanitizer can also reach it?
You need to also make the loader not unload .so's at shutdown time (aka during vkDestroyInstance)
THIS is what causes the stacktraces to dissapear