KhronosGroup / KhronosGroup/Vulkan-ValidationLayers

Segfault when creating a device

Open
#10,205 4 comments 0 reactions 1 assignee View on GitHub

@spencer-lunarg is already working on this.

Since Jun 8, 2025.

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

Description

Environment:

  • OS: ArchLinuxARM
  • GPU and driver version: Mali G610, running Mesa 2b320880bcd
  • SDK or header version if building from repo: vulkan-headers-git 1.4.316.r0 commit b11eecd
  • Options enabled (synchronization, best practices, etc.): not sure, I don’t think I have enabled anything so far.

Describe the Issue

I’m trying to run ffmpeg with Vulkan video, and when I enable the validation layer (with ,debug=1) it segfaults right in there (see the stack trace at the end of this issue):

ffmpeg -loglevel verbose -threads 1 -init_hw_device vulkan=vk:0,debug=1 -hwaccel vulkan -hwaccel_output_format vulkan -i ~/videos/test.mp4 -an -f null - -benchmark

Expected behavior

The validation layer wouldn’t try to dereference 0x180 as this, and would tell me if I’m doing something wrong here.

Valid Usage ID

N/A

Additional context

gdb backtrace
(gdb) bt
#0  0x0000fffff64ebedc in pthread_rwlock_wrlock () from /usr/lib/libc.so.6
#1  0x0000fffff035b894 in std::__glibcxx_rwlock_wrlock (__rwlock=0x180) at /usr/include/c++/14.2.1/shared_mutex:85
#2  std::__shared_mutex_pthread::lock (this=0x180) at /usr/include/c++/14.2.1/shared_mutex:198
#3  std::shared_mutex::lock (this=0x180) at /usr/include/c++/14.2.1/shared_mutex:425
#4  std::unique_lock<std::shared_mutex>::lock (this=<synthetic pointer>) at /usr/include/c++/14.2.1/bits/unique_lock.h:147
#5  std::unique_lock<std::shared_mutex>::unique_lock (this=<synthetic pointer>, __m=...) at /usr/include/c++/14.2.1/bits/unique_lock.h:73
#6  vvl::PhysicalDevice::SetCallState (this=0x0, func=vvl::Func::vkGetPhysicalDeviceFeatures2, new_state=new_state@entry=vvl::CallState::QueryDetails)
    at /usr/src/debug/vulkan-validation-layers-git/Vulkan-ValidationLayers/layers/state_tracker/device_state.cpp:24
#7  0x0000fffff035ba84 in vvl::PhysicalDevice::SetCallState (this=<optimized out>, func=<optimized out>, has_ptr=has_ptr@entry=true)
    at /usr/src/debug/vulkan-validation-layers-git/Vulkan-ValidationLayers/layers/state_tracker/device_state.cpp:35
#8  0x0000fffff03bd578 in vvl::InstanceState::PostCallRecordGetPhysicalDeviceFeatures (this=<optimized out>, physicalDevice=<optimized out>, pFeatures=<optimized out>, record_obj=...)
    at /usr/include/c++/14.2.1/bits/shared_ptr_base.h:1666
#9  0x0000ffffeff75e20 in vulkan_layer_chassis::GetPhysicalDeviceFeatures2 (physicalDevice=0xaaaaaab51ea0, pFeatures=0xffffffffeb40)
    at /usr/src/debug/vulkan-validation-layers-git/Vulkan-ValidationLayers/layers/vulkan/generated/chassis.cpp:6179
#10 0x0000fffff6742838 in vulkan_device_create_internal (ctx=ctx@entry=0xaaaaaab61620, dev_select=dev_select@entry=0xffffffffefc0, opts=opts@entry=0xaaaaaab5a4f0, flags=<optimized out>, 
    disable_multiplane=0) at src/libavutil/hwcontext_vulkan.c:1659
#11 0x0000fffff6743d14 in vulkan_device_create (ctx=0xaaaaaab61620, device=<optimized out>, opts=0xaaaaaab5a4f0, flags=<optimized out>) at src/libavutil/hwcontext_vulkan.c:1978
#12 0x0000fffff673c680 in av_hwdevice_ctx_create (pdevice_ref=pdevice_ref@entry=0xfffffffff090, type=type@entry=AV_HWDEVICE_TYPE_VULKAN, device=device@entry=0xaaaaaab478d0 "0", 
    opts=0xaaaaaab5a4f0, flags=flags@entry=0) at src/libavutil/hwcontext.c:630
#13 0x0000aaaaaaabbc50 in hw_device_init_from_string (arg=0xfffffffffa96 "vulkan=vk:0,debug=1", dev_out=0x0) at src/fftools/ffmpeg_hw.c:174
#14 0x0000aaaaaaadff84 in write_option (optctx=optctx@entry=0xfffffffff240, po=0xaaaaaab1e3e8 <options+9024>, opt=0xfffffffffa87 "init_hw_device", arg=0xfffffffffa96 "vulkan=vk:0,debug=1", 
    defs=defs@entry=0xaaaaaab1c0a8 <options>) at src/fftools/cmdutils.c:353
#15 0x0000aaaaaaae0994 in parse_optgroup (optctx=optctx@entry=0xfffffffff240, g=g@entry=0xfffffffff258, defs=defs@entry=0xaaaaaab1c0a8 <options>) at src/fftools/cmdutils.c:478
#16 0x0000aaaaaaaca750 in ffmpeg_parse_options (argc=argc@entry=18, argv=argv@entry=0xfffffffff6c8, sch=0xaaaaaab614c0) at src/fftools/ffmpeg_opt.c:1397
#17 0x0000aaaaaaaa85f8 in main (argc=18, argv=0xfffffffff6c8) at src/fftools/ffmpeg.c:988

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.