KhronosGroup / KhronosGroup/Vulkan-ValidationLayers
Image views, when used-after-free in a framebuffer, does not raise validation error; segfaults under renderdoc.
@spencer-lunarg is already working on this.
Since Jul 25, 2025.
- Dominant language
- C++
- Stars
- 1k
- Forks
- 505
- Avg merge
- 11h 25m
- Merged PRs (30d)
- 229
Description
Describe the situation in which you encountered the missing validation
Get setup up:
git clone https://github.com/gfx-rs/wgpu.git
git checkout v26.0.1
cargo build -p wgpu-examples
This will build a binary in target/debug/wgpu-examples.exe. (remove exe for *nix). Run this binary with the argument cube. If you are running on an AMD gpu, you will notice that the rendering may flicker. This is because of the code using a framebuffer which points to a deleted image view. The program automatically enables the validation layers, if they are available. There are no validation warnings, however. You can validate this by setting the env var RUST_LOG=wgpu_hal=info to see info level logs.
On any gpu, run the program under renderdoc. The program will crash. If you run under renderdoc and a debugger, you will notice it crashes inside the validation layers, while trying to validate the image views.
This was a bit convoluted to find, so let me know if anything else is needed.
Valid Usage IDs requested
I'm honestly unsure where to find the rules against use-after-free.
Additional Context
Windows 11
Replicated on Nvidia, AMD.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.