Skip to content
This repository has been archived by the owner on Jul 19, 2018. It is now read-only.

May have found something that isn't validated. #2097

Closed
Berserker66 opened this issue Oct 1, 2017 · 6 comments · Fixed by #2205
Closed

May have found something that isn't validated. #2097

Berserker66 opened this issue Oct 1, 2017 · 6 comments · Fixed by #2205
Assignees
Milestone

Comments

@Berserker66
Copy link

Berserker66 commented Oct 1, 2017

So, in my project I just messed with the way all my command pools and command buffers are handled.

At the end of the restructure, I now have a vulkan crash on exit. No validation warning of anything being wrong.
https://i.imgur.com/KgqKb2h.png

I use vulkan through a python wrapper, so I don't know much about what seems to have gone wrong on the C level, I also almost never use Visual Studio, so I don't know if I can dump the exception info somehow.

My vulkan info, should it matter:
https://pastebin.com/W0cUTtzd

Edit:
I have fixed the crash - Destroy commands fired in the wrong order, the device and instance were long gone and then two command pools and ~2 command buffers were tried to be cleaned up afterwards, which is wrong. Still, that should have a validation layer message, I think.

@krOoze
Copy link
Contributor

krOoze commented Oct 1, 2017

AFAIK unfortunately the current architecture does not allow validating dispatchable handles (such as device and instance). It simply crashes in the loader trying to use the no-longer-valid instance pointer before it can even get to the validation layer checking function.

It is a bit obvious really. Validation layers are instance layers. No/destroyed instance -> no layer.

PS: yer SDK is old.

@Berserker66
Copy link
Author

Berserker66 commented Oct 1, 2017

Mh. Sounds reasonable. But is there a way to hook into the instance destruction and validate things before the instance gets destroyed? Basically as soon as the destroy instance is run, you then check if everything was cleaned up, before the instance gets actually torn apart?

@krOoze
Copy link
Contributor

krOoze commented Oct 1, 2017

@Berserker66 Oh yeah, actually that should happen. AFAIK all the leaked child objects should be reported on object destruction time.

Though testing it I get only a complaint about debug callback object (but no other object) while destroying instance prematurely.

PS: maybe rename this Issue to something along these lines.

@tobine
Copy link
Contributor

tobine commented Oct 2, 2017

@Berserker66 yes, object_tracker will report undestroyed objects at DestroyInstance() and DestroyDevice() time.

@krOoze
Copy link
Contributor

krOoze commented Oct 2, 2017

@tobine I have stitched together (not-so-)minimal example testing it:
https://gist.github.com/krOoze/4741b5202e8c07e31bb786b9cb365db1#file-temporarydebugonly-cpp

I leak VkDevice child of instance (using temporary debug callback through pNext).
I get no validation error.

Also I tried with a debug callback object. I get (for some reason) four errors about the leaked callback object, but still nothing about device.

In a larger program I get errors about none of the leaked objects except again the four about callback object.

@mark-lunarg
Copy link
Collaborator

@krOoze, yup, DestroyInstance calls ReportUndestroyedObjects for each device, and though it will report any objects owned by THAT device as 'leaked' it won't say anything specific about the device itself. We can certainly make this more clear.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants