Segfault using validation layer
- Version of vulkano: 0.11
- OS: Manjaro (arch based)
- GPU (the selected PhysicalDevice): Intel HD4000 (integrated i7 3630qm)
- GPU Driver: video-hybrid-intel-nvidia-bumblebee 2018.08.09
- Upload of a reasonably minimal complete
main.rsfile that demonstrates the issue: https://github.com/vulkano-rs/vulkano/blob/master/examples/src/bin/debug.rs
Issue
When trying to use the validation layer, the example ends by a segfault.
Compiling vulkan_debug v0.1.0 (/home/foxy/Desktop/rust/vulkan_debug)
Finished dev [unoptimized + debuginfo] target(s) in 33.87s
Running target/debug/vulkan_debug
List of Vulkan debugging layers available to use:
VK_LAYER_VALVE_steam_overlay_32
VK_LAYER_VALVE_steam_overlay_64
VK_LAYER_LUNARG_monitor
VK_LAYER_LUNARG_api_dump
VK_LAYER_LUNARG_device_simulation
VK_LAYER_LUNARG_screenshot
VK_LAYER_GOOGLE_threading
VK_LAYER_GOOGLE_unique_objects
VK_LAYER_LUNARG_parameter_validation
VK_LAYER_LUNARG_core_validation
VK_LAYER_LUNARG_standard_validation
VK_LAYER_LUNARG_object_tracker
Xlib: extension "NV-GLX" missing on display ":0.0".
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
DebugReport debug: [ VUID_Undefined ] Object: 0x1 (Type = 28) | Added callback
DebugReport debug: [ VUID_Undefined ] Object: 0x1 (Type = 28) | Added callback
DebugReport debug: [ VUID_Undefined ] Object: 0x1 (Type = 28) | Added callback
DebugReport debug: [ VUID_Undefined ] Object: 0x1 (Type = 28) | Added callback
DebugReport debug: [ VUID_Undefined ] Object: 0x1 (Type = 28) | Added callback
Loader Message information: Device Extension: VK_KHR_bind_memory2 (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_create_renderpass2 (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_dedicated_allocation (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_descriptor_update_template (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_device_group (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_driver_properties (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_fence (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_fence_fd (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_memory (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_memory_fd (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_semaphore (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_semaphore_fd (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_get_memory_requirements2 (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_image_format_list (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_incremental_present (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_maintenance1 (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_maintenance2 (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_maintenance3 (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_push_descriptor (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_relaxed_block_layout (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_sampler_mirror_clamp_to_edge (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_sampler_ycbcr_conversion (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_shader_draw_parameters (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_storage_buffer_storage_class (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_swapchain (/usr/lib/libvulkan_intel.so) version 0.0.68
Loader Message information: Device Extension: VK_KHR_variable_pointers (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_multiview (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_EXT_display_control (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_EXT_external_memory_dma_buf (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_EXT_shader_viewport_index_layer (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_EXT_vertex_attribute_divisor (/usr/lib/libvulkan_intel.so) version 0.0.3
Loader Message information: Device Extension: VK_EXT_calibrated_timestamps (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_GOOGLE_decorate_string (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_GOOGLE_hlsl_functionality1 (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_bind_memory2 (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_create_renderpass2 (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_dedicated_allocation (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_descriptor_update_template (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_device_group (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_driver_properties (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_fence (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_fence_fd (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_memory (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_memory_fd (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_semaphore (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_semaphore_fd (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_get_memory_requirements2 (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_image_format_list (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_incremental_present (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_maintenance1 (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_maintenance2 (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_maintenance3 (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_push_descriptor (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_relaxed_block_layout (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_sampler_mirror_clamp_to_edge (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_sampler_ycbcr_conversion (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_shader_draw_parameters (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_storage_buffer_storage_class (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_swapchain (Unknown) version 0.0.68
Loader Message information: Device Extension: VK_KHR_variable_pointers (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_KHR_multiview (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_EXT_display_control (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_EXT_external_memory_dma_buf (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_EXT_shader_viewport_index_layer (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_EXT_vertex_attribute_divisor (Unknown) version 0.0.3
Loader Message information: Device Extension: VK_EXT_calibrated_timestamps (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_GOOGLE_decorate_string (Unknown) version 0.0.1
Loader Message information: Device Extension: VK_GOOGLE_hlsl_functionality1 (Unknown) version 0.0.1
Loader Message information: Loading layer library libVkLayer_unique_objects.so
Loader Message information: Inserted device layer VK_LAYER_GOOGLE_unique_objects (libVkLayer_unique_objects.so)
Loader Message information: Loading layer library libVkLayer_core_validation.so
Loader Message information: Inserted device layer VK_LAYER_LUNARG_core_validation (libVkLayer_core_validation.so)
Loader Message information: Loading layer library libVkLayer_object_lifetimes.so
Loader Message information: Inserted device layer VK_LAYER_LUNARG_object_tracker (libVkLayer_object_lifetimes.so)
Loader Message information: Loading layer library libVkLayer_parameter_validation.so
Loader Message information: Inserted device layer VK_LAYER_LUNARG_parameter_validation (libVkLayer_parameter_validation.so)
Loader Message information: Loading layer library libVkLayer_thread_safety.so
Loader Message information: Inserted device layer VK_LAYER_GOOGLE_threading (libVkLayer_thread_safety.so)
Loader Message information: Device Extension: VK_KHR_bind_memory2 (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_create_renderpass2 (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_dedicated_allocation (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_descriptor_update_template (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_device_group (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_driver_properties (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_fence (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_fence_fd (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_memory (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_memory_fd (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_semaphore (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_external_semaphore_fd (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_get_memory_requirements2 (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_image_format_list (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_incremental_present (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_maintenance1 (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_maintenance2 (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_maintenance3 (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_push_descriptor (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_relaxed_block_layout (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_sampler_mirror_clamp_to_edge (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_sampler_ycbcr_conversion (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_shader_draw_parameters (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_storage_buffer_storage_class (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_swapchain (/usr/lib/libvulkan_intel.so) version 0.0.68
Loader Message information: Device Extension: VK_KHR_variable_pointers (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_KHR_multiview (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_EXT_display_control (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_EXT_external_memory_dma_buf (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_EXT_shader_viewport_index_layer (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_EXT_vertex_attribute_divisor (/usr/lib/libvulkan_intel.so) version 0.0.3
Loader Message information: Device Extension: VK_EXT_calibrated_timestamps (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_GOOGLE_decorate_string (/usr/lib/libvulkan_intel.so) version 0.0.1
Loader Message information: Device Extension: VK_GOOGLE_hlsl_functionality1 (/usr/lib/libvulkan_intel.so) version 0.0.1
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x55fb82e3eb48 (Type = 4) | OBJ[0x4] : CREATE VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT object 0x55fb82e3eb48
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x2 (Type = 9) | OBJ[0x5] : CREATE Buffer object 0x2
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x3 (Type = 8) | OBJ[0x6] : CREATE DeviceMemory object 0x3
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x4 (Type = 10) | OBJ[0x7] : CREATE Image object 0x4
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x5 (Type = 8) | OBJ[0x8] : CREATE DeviceMemory object 0x5
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x6 (Type = 14) | OBJ[0x9] : CREATE ImageView object 0x6
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x7 (Type = 25) | OBJ[0xa] : CREATE CommandPool object 0x7
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x55fb82e46060 (Type = 6) | OBJ[0xb] : CREATE VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT object 0x55fb82e46060
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x55fb82e46060 (Type = 6) | OBJ_STAT Destroy CommandBuffer obj 0x55fb82e46060 (7 total objs remain & 0 CommandBuffer objs).
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x7 (Type = 25) | OBJ_STAT Destroy CommandPool obj 0x7 (7 total objs remain & 0 CommandPool objs).
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x2 (Type = 9) | OBJ_STAT Destroy Buffer obj 0x2 (5 total objs remain & 0 Buffer objs).
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x4 (Type = 10) | OBJ_STAT Destroy Image obj 0x4 (4 total objs remain & 0 Image objs).
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x6 (Type = 14) | OBJ_STAT Destroy ImageView obj 0x6 (3 total objs remain & 0 ImageView objs).
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x5 (Type = 8) | OBJ_STAT Destroy DeviceMemory obj 0x5 (2 total objs remain & 1 DeviceMemory objs).
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x3 (Type = 8) | OBJ_STAT Destroy DeviceMemory obj 0x3 (1 total objs remain & 0 DeviceMemory objs).
Validation information: [ UNASSIGNED-ObjectTracker-Info ] Object: 0x55fb82e3eb48 (Type = 4) | OBJ_STAT Destroy Queue obj 0x55fb82e3eb48 (0 total objs remain & 0 Queue objs).
Loader Message information: Unloading layer library libVkLayer_thread_safety.so
Loader Message information: Unloading layer library libVkLayer_parameter_validation.so
Loader Message information: Unloading layer library libVkLayer_object_lifetimes.so
Loader Message information: Unloading layer library libVkLayer_core_validation.so
Loader Message information: Unloading layer library libVkLayer_unique_objects.so
Segmentation fault (core dumped)
If I change 63-69
let all = MessageTypes {
error: true,
warning: true,
performance_warning: true,
information: true,
debug: true,
};
by (disable info level)
information: false,
The program run without segfault...
Compiling vulkan_debug v0.1.0 (/home/foxy/Desktop/rust/vulkan_debug)
Finished dev [unoptimized + debuginfo] target(s) in 18.93s
Running target/debug/vulkan_debug
List of Vulkan debugging layers available to use:
VK_LAYER_VALVE_steam_overlay_32
VK_LAYER_VALVE_steam_overlay_64
VK_LAYER_LUNARG_monitor
VK_LAYER_LUNARG_api_dump
VK_LAYER_LUNARG_device_simulation
VK_LAYER_LUNARG_screenshot
VK_LAYER_GOOGLE_threading
VK_LAYER_GOOGLE_unique_objects
VK_LAYER_LUNARG_parameter_validation
VK_LAYER_LUNARG_core_validation
VK_LAYER_LUNARG_standard_validation
VK_LAYER_LUNARG_object_tracker
Xlib: extension "NV-GLX" missing on display ":0.0".
INTEL-MESA: warning: Ivy Bridge Vulkan support is incomplete
DebugReport debug: [ VUID_Undefined ] Object: 0x1 (Type = 28) | Added callback
DebugReport debug: [ VUID_Undefined ] Object: 0x1 (Type = 28) | Added callback
DebugReport debug: [ VUID_Undefined ] Object: 0x1 (Type = 28) | Added callback
DebugReport debug: [ VUID_Undefined ] Object: 0x1 (Type = 28) | Added callback
DebugReport debug: [ VUID_Undefined ] Object: 0x1 (Type = 28) | Added callback
I had no issue with https://vulkan-tutorial.com/ (C++ with Vulkan validation layer) and the Vulkano guide, so it does not seem driver related.
Am I missing something ?
"Am I missing something ?" - nah it'll be vulkano's fault
Potentially similar/same issue as the segfault encountered when testing https://github.com/vulkano-rs/vulkano/pull/1066
Can confirm this issue still affects Vulkano 0.16.
Disabling VK_LAYER_GOOGLE_unique_objects or the 'information' MessageSeverity when creating the DebugCallback at the application level fixes this.
The segfault only occurs when the application is shutting down. Segfault occurs in both debug and release mode.
Furthermore, the segfault only happens if any other vulkan-related objects are dropped after the DebugCallback is dropped. Moving the application-lifetime, vulkan-related objects into a struct to handle their lifetimes and putting the DebugCallback at the bottom of that struct so it is dropped last fixes the issue.
I hope this information is helpful.
Is this still an issue?