KhronosGroup / KhronosGroup/Vulkan-ValidationLayers

Occasional crash in `GetLayerDataPtr<ValidationObject>`

Open
#4,391 1 comment 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
C++
Stars
1k
Forks
505
Avg merge
11h 25m
Merged PRs (30d)
229

Description

In about one run in fifty, I get a crash running the wgpu crate's wgpu-tests test suite (for details, see gfx-rs/wgpu#2949) where vulkan_layer_chassis::BindImageMemory calls GetLayerDataPtr and things go awry.

Environment:

  • OS: Linux
  • GPU: AMD RADV POLARIS12
  • SDK or header version if building from repo: Fedora package vulkan-validation-layers-1.3.204.0-1.fc36.x86_64
  • Options enabled (synchronization, best practices, etc.): whatever Fedora chooses

Backtrace:

Thread 5 "clear_texture::" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff6ded640 (LWP 556616)]
std::_Hashtable<void*, std::pair<void* const, ValidationObject*>, std::allocator<std::pair<void* const, ValidationObject*> >, std::__detail::_Select1st, std::equal_to<void*>, std::hash<void*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_find_before_node () at /usr/include/c++/12/bits/hashtable.h:1935
warning: Source file is more recent than executable.
1935		  if (this->_M_equals(__k, __code, *__p))
(gdb) where
#0  std::_Hashtable<void*, std::pair<void* const, ValidationObject*>, std::allocator<std::pair<void* const, ValidationObject*> >, std::__detail::_Select1st, std::equal_to<void*>, std::hash<void*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_find_before_node () at /usr/include/c++/12/bits/hashtable.h:1935
#1  0x00007fffd87e6823 in std::_Hashtable<void*, std::pair<void* const, ValidationObject*>, std::allocator<std::pair<void* const, ValidationObject*> >, std::__detail::_Select1st, std::equal_to<void*>, std::hash<void*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_find_node () at /usr/include/c++/12/bits/hashtable.h:814
#2  std::_Hashtable<void*, std::pair<void* const, ValidationObject*>, std::allocator<std::pair<void* const, ValidationObject*> >, std::__detail::_Select1st, std::equal_to<void*>, std::hash<void*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::find ()
    at /usr/include/c++/12/bits/hashtable.h:1653
#3  0x00007fffd87e6ea6 in std::unordered_map<void*, ValidationObject*, std::hash<void*>, std::equal_to<void*>, std::allocator<std::pair<void* const, ValidationObject*> > >::find ()
    at /usr/include/c++/12/bits/unordered_map.h:869
#4  small_unordered_map<void*, ValidationObject*, 2>::operator[] () at /usr/src/debug/vulkan-validation-layers-1.3.204.0-1.fc36.x86_64/layers/vk_layer_data.h:659
#5  GetLayerDataPtr<ValidationObject> () at /usr/src/debug/vulkan-validation-layers-1.3.204.0-1.fc36.x86_64/layers/vk_layer_data.h:683
#6  0x00007fffd8775f8f in vulkan_layer_chassis::BindImageMemory () at /usr/src/debug/vulkan-validation-layers-1.3.204.0-1.fc36.x86_64/layers/generated/chassis.cpp:1394
#7  0x0000555555f1eb26 in ash::device::Device::bind_image_memory (self=0x7fffe038a3a0, image=..., device_memory=..., offset=524288)
    at /home/jimb/.cargo/registry/src/github.com-1ecc6299db9ec823/ash-0.37.0+1.3.209/src/device.rs:2472
#8  0x0000555555d40338 in wgpu_hal::vulkan::device::{impl#4}::create_texture (self=0x7fffe0729cf8, desc=0x7ffff6de8948) at wgpu-hal/src/vulkan/device.rs:896
#9  0x000055555598ffc5 in wgpu_core::device::Device<wgpu_hal::vulkan::Api>::create_texture<wgpu_hal::vulkan::Api> (self=0x7fffe0729cf8, self_id=..., adapter=0x7fffe028d458, 
    desc=0x7ffff6dea958) at /home/jimb/rust/wgpu/wgpu-core/src/device/mod.rs:847
#10 0x0000555555aa2284 in wgpu_core::hub::Global<wgpu_core::hub::IdentityManagerFactory>::device_create_texture<wgpu_core::hub::IdentityManagerFactory, wgpu_hal::vulkan::Api> (
    self=0x7fffe0007f30, device_id=..., desc=0x7ffff6dea958, id_in=...) at /home/jimb/rust/wgpu/wgpu-core/src/device/mod.rs:3675
#11 0x0000555555a4d361 in wgpu::backend::direct::{impl#3}::device_create_texture (self=0x7fffe0007f30, device=0x7ffff6deaf70, desc=0x7ffff6deac58) at wgpu/src/backend/direct.rs:1493
#12 0x0000555555b01566 in wgpu::Device::create_texture (self=0x7ffff6deaf68, desc=0x7ffff6deac58) at wgpu/src/lib.rs:2144
#13 0x00005555556a7126 in wgpu_tests::clear_texture::single_texture_clear_test (ctx=0x7ffff6deaf28, format=..., size=..., dimension=wgpu_types::TextureDimension::D1)
    at wgpu/tests/clear_texture.rs:209
#14 0x00005555556a74cb in wgpu_tests::clear_texture::clear_texture_tests (ctx=0x7ffff6deaf28, formats=..., supports_1d=true, supports_3d=true) at wgpu/tests/clear_texture.rs:256
#15 0x00005555556b42a5 in wgpu_tests::clear_texture::clear_texture_2d_uncompressed::{closure#0} (ctx=...) at wgpu/tests/clear_texture.rs:310
#16 0x00005555556fec6d in wgpu_tests::common::initialize_test::{closure#1}<wgpu_tests::clear_texture::clear_texture_2d_uncompressed::{closure_env#0}> () at wgpu/tests/common/mod.rs:280

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.