Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example 01: memory access violation on windows 10 #10

Open
Fahisto opened this issue Jul 31, 2019 · 5 comments
Open

example 01: memory access violation on windows 10 #10

Fahisto opened this issue Jul 31, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@Fahisto
Copy link

Fahisto commented Jul 31, 2019

Cannot implement Drop for VulkanApp in example01, because the usage of destroy_instance(None) crashes the program on closing the window and produces error: process didn't exit successfully: `target\debug\01.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)
Without the Drop implementation or the destroy_instance() usage everything is fine.
I read the actual docs for Vulakn API for this function, and I'm assuming there's a dangling reference somewhere inside the instance fields, but couldnt confirm (I'm not even sure if I'm right). Any suggestions?

@unknownue
Copy link
Owner

Is this issue reproduced on other examples?
I mainly work on macOS, and the code works well on macOS. So this may be a platform-specific problem. It may take me 2 or 3 days to have access to Windows machine to test this problem.

I recommend you to try running the example of ash. This help me to figure out if it's the problem of my code, a machine specific problem, or any bug issure in SDK.

@Fahisto
Copy link
Author

Fahisto commented Aug 1, 2019

I ran all the ash examples and they were fine: no crashes, no errors, nothing. Most of the other examples up to 17th from your tutorial were fine too, so that's strange. Ones that aren't workin are 17, 23. When I try to run the 17th example, it shows a whole bunch of errors and crashes without window even appearing on my screen:

[Debug][Error][Validation]"The Pipeline State Object (0x2a) expects that this Command
Buffer\'s vertex binding Index 0 should be set via vkCmdBindVertexBuffers. This is because VkVertexInputBindingDescription struct at index 0 of pVertexBindingDescriptions has a binding value of 0."
[Debug][Error][Validation]"The Pipeline State Object (0x2a) expects that this Command
Buffer\'s vertex binding Index 0 should be set via vkCmdBindVertexBuffers. This is because VkVertexInputBindingDescription struct at index 0 of pVertexBindingDescriptions has a binding value of 0."
thread 'main' panicked at 'Failed to wait for Fence!: Result(-4)', src\libcore\result.rs:999:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[Debug][Error][Validation]"Cannot call vkDestroySemaphore on Semaphore 0x2f that is currently in use by a command buffer. The Vulkan spec states: All submitted batches that refer to semaphore must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkDestroySemaphore-semaphore-01137)"
[Debug][Error][Validation]"Fence 0x30 is in use. The Vulkan spec states: All queue submission commands that refer to fence must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkDestroyFence-fence-01120)"
[Debug][Error][Validation]"Cannot call vkDestroySemaphore on Semaphore 0x32 that is currently in use by a command buffer. The Vulkan spec states: All submitted batches that refer to semaphore must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkDestroySemaphore-semaphore-01137)"
[Debug][Error][Validation]"Fence 0x33 is in use. The Vulkan spec states: All queue submission commands that refer to fence must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkDestroyFence-fence-01120)"
[Debug][Error][Validation]"Attempt to free command buffer (0x26f709b8790) which is in
use. The Vulkan spec states: All elements of pCommandBuffers must not be in the pending state (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)"
[Debug][Error][Validation]"Attempt to free command buffer (0x26f709b9320) which is in
use. The Vulkan spec states: All elements of pCommandBuffers must not be in the pending state (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)"
[Debug][Error][Validation]"Cannot call vkDestroyFramebuffer on Framebuffer 0x2b that is currently in use by a command buffer. The Vulkan spec states: All submitted commands that refer to framebuffer must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkDestroyFramebuffer-framebuffer-00892)"
[Debug][Error][Validation]"Cannot call vkDestroyFramebuffer on Framebuffer 0x2c that is currently in use by a command buffer. The Vulkan spec states: All submitted commands that refer to framebuffer must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkDestroyFramebuffer-framebuffer-00892)"
[Debug][Error][Validation]"Cannot call vkDestroyPipeline on Pipeline 0x2a that is currently in use by a command buffer. The Vulkan spec states: All submitted commands that
refer to pipeline must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkDestroyPipeline-pipeline-00765)"
[Debug][Error][Validation]"Cannot call vkDestroyRenderPass on RenderPass 0x26 that is
currently in use by a command buffer. The Vulkan spec states: All submitted commands that refer to renderPass must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkDestroyRenderPass-renderPass-00873)"
[Debug][Error][Validation]"Cannot call vkDestroyImageView on ImageView 0x24 that is currently in use by a command buffer. The Vulkan spec states: All submitted commands that refer to imageView must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkDestroyImageView-imageView-01026)"
[Debug][Error][Validation]"Cannot call vkDestroyImageView on ImageView 0x25 that is currently in use by a command buffer. The Vulkan spec states: All submitted commands that refer to imageView must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkDestroyImageView-imageView-01026)"

Example 23, however, does launch, but there's no texture in assets folder, and when I try to use my own jpg image as texture, it seems fine, but the textures itself does not appear on the screen, there's only the rotating square from previous example. No errors or anything for this one. However, following examples crash with thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: FormatError("first two bytes is not a SOI marker")' , so I'm assuming ther's something wrong with my image, what are the requirements then for it to display correctly (I did use .jpg image)?

@Fahisto
Copy link
Author

Fahisto commented Aug 1, 2019

Forgot to mention the other example that's not working.
Example 21 does launch, but displays nothing (only black window) and produces following errors:

[Debug][Error][Validation]"VkPipeline 0x2b uses set #0 but that set is not bound."
[Debug][Error][Validation]"VkPipeline 0x2b uses set #0 but that set is not bound."

@unknownue
Copy link
Owner

Here are some instructions may help you:

  1. example 01: The code in 01_instance_creation.rs does not hold ash::Entry after ash::Instance is built. Add ash::Entry as a member of VulkanApp may fix this like other examples.
  2. example 17: This is an incomplete example and the validation layer should output some error message. But this example should not crashes immediately without cleaning other vulkan resources. That why you see a bunch of errors output. I can't see which line of code cause the crash, so I have not idea what's the problem.
  3. example 23: The assets used in the tutorial do not include in this repo. See here. Like the C++ implementation, the code does not guarantee all image formats are support(since it introduces more operations). So it's not strange that the image you provided failed to display. Try the image in tutorial next time.
  4. example 21: Black window and some validation output. That's just what this example would show you. It's Ok.

I would test these problems as soon as I get access to Windows machine.

@Fahisto
Copy link
Author

Fahisto commented Aug 1, 2019

Example 01 works now, thank you.

@unknownue unknownue added the bug Something isn't working label Aug 1, 2019
unknownue added a commit that referenced this issue Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants