RADV: segfault on musl with mpv
System information
- OS: Gentoo with musl libc
- GPU: Advanced Micro Devices, Inc. [AMD/ATI] Navi 14 [Radeon RX 5500/5500M / Pro 5500M]
- Kernel version: 5.16.16-gentoo-dist-hardened
- Mesa version: 22.1.0-devel
- Desktop manager and compositor: sway
Describe the issue
Compiled with clang:
mpv will segfault when the gpu-next
or the gpu
video output is in use with any video file.
Compiled with gcc:
mpv will segfault when the gpu-next
video output is in use with any video file.
All of these issues are fixed when checking out a56bb2d5, the commit before e6672f6f
Regression
Regressed with !12773 (merged), specifically commit e6672f6f
Backtrace
Compiled with clang:
* thread #1, name = 'mpv', stop reason = signal SIGSEGV
* frame #0: 0x00007fdf3828c891 ld-musl-x86_64.so.1`printf_core(f=0x0000000000000000, fmt="", ap=0x00007fdf2fc95a60, nl_arg=0x00007fdf2fc95980, nl_type=0x00007fdf2fc95a20) at vfprintf.c:431
frame #1: 0x00007fdf3828c742 ld-musl-x86_64.so.1`vfprintf(f=0x00007fdf2fc95ae0, fmt="", ap=<unavailable>) at vfprintf.c:668:6
frame #2: 0x00007fdf3829253f ld-musl-x86_64.so.1`vsnprintf(s=<unavailable>, n=<unavailable>, fmt=<unavailable>, ap=<unavailable>) at vsnprintf.c:54:9
frame #3: 0x00007fdf3828c5a5 ld-musl-x86_64.so.1`vasprintf(s=0x00007fdf2fc95d58, fmt="", ap=0x00007fdf2fc95d20) at vasprintf.c:10:10
frame #4: 0x00007fdf38288104 ld-musl-x86_64.so.1`asprintf(s=0x00007fdf2fc95d58, fmt=<unavailable>) at asprintf.c:10:8
frame #5: 0x00007fdf2f91378b libvulkan_radeon.so`disk_cache_get_cache_filename(cache=0x00007fdf2fe464f0, key="\xc1k\xd7\U00000016k2\x9a\\;^S\x87 \xe0vݚx/\U0000007f\xdf\U0000007f") at disk_cache_os.c:588:8
frame #6: 0x00007fdf2f912ea7 libvulkan_radeon.so`disk_cache_get(cache=0x00007fdf2fe464f0, key="\xc1k\xd7\U00000016k2\x9a\\;^S\x87 \xe0vݚx/\U0000007f\xdf\U0000007f", size=0x0000000000000000) at disk_cache.c:449:24
frame #7: 0x00007fdf2f8937c4 libvulkan_radeon.so`radv_create_shaders_from_pipeline_cache(device=0x00007fdf2f092230, cache=0x00007fdf2f093008, sha1="\xbb\xe0\xd7j\xa8\U000000034J\xab\xc4\xdcX\x84zuD-ּ>", pipeline=0x00007fdf2bc09590, stack_sizes=0x0000000000000000, num_stack_sizes=0x0000000000000000, found_in_application_cache=0x00007fdf2fc95eef) at radv_pipeline_cache.c:328:32
frame #8: 0x00007fdf2f884dea libvulkan_radeon.so`radv_create_shaders(pipeline=<unavailable>, pipeline_layout=<unavailable>, device=0x0000000000000000, cache=0x0000000000000000, pipeline_key=<unavailable>, pStages=0x00007fdf2fcaeb80, flags=<unavailable>, custom_hash=<unavailable>, pipeline_feedback=<unavailable>, stage_feedbacks=<unavailable>) at radv_pipeline.c:3943:8
frame #9: 0x00007fdf2f88d0f7 libvulkan_radeon.so`radv_pipeline_init(pipeline=<unavailable>, device=0x000000000000000f, cache=0x00007fdf00000000, pCreateInfo=<unavailable>, extra=<unavailable>) at radv_pipeline.c:6217:13
frame #10: 0x00007fdf2f889664 libvulkan_radeon.so`radv_graphics_pipeline_create [inlined] radv_graphics_pipeline_create_nonlegacy(_device=0x00007fdf2f092230, _cache=0x00007fdf2f093008, pCreateInfo=0x00007fdf2fcaefd8, extra=0x00007fdf2fcaf180, pAllocator=0x00007fdf2f092fd8, pPipeline=0x00007fdf2f094e88) at radv_pipeline.c:6323:13
frame #11: 0x00007fdf2f8895f4 libvulkan_radeon.so`radv_graphics_pipeline_create(_device=0x00007fdf2f092230, _cache=0x00007fdf2f093008, pCreateInfo=0x00007fdf2fcaf2b0, extra=0x00007fdf2fcaf180, pAllocator=0x00007fdf2f092fd8, pPipeline=0x00007fdf2f094e88) at radv_pipeline.c:6394:11
frame #12: 0x00007fdf2f83f5ee libvulkan_radeon.so`blit2d_init_color_pipeline(device=0x00007fdf2f092230, src_type=<unavailable>, format=VK_FORMAT_R8G8B8A8_UINT, log2_samples=0) at radv_meta_blit2d.c:854:13
frame #13: 0x00007fdf2f83e05f libvulkan_radeon.so`radv_meta_blit2d_normal_dst(cmd_buffer=0x00007fdf2abd2f30, src_img=0x0000000000000000, src_buf=0x00007fdf2fcafb68, dst=0x00007fdf2fcafbd8, num_rects=1, rects=0x00007fdf2fcafb80, src_type=BLIT2D_SRC_TYPE_BUFFER, log2_samples=0) at radv_meta_blit2d.c:269:31
frame #14: 0x00007fdf2f83d5ed libvulkan_radeon.so`radv_meta_blit2d(cmd_buffer=0x00007fdf2abd2f30, src_img=0x0000000000000000, src_buf=0x00007fdf2fcafb68, dst=0x00007fdf2fcafbd8, num_rects=1, rects=0x00007fdf2fcafb80) at radv_meta_blit2d.c:419:4
frame #15: 0x00007fdf2f855d05 libvulkan_radeon.so`radv_CmdCopyBufferToImage2KHR [inlined] copy_buffer_to_image(cmd_buffer=0x00007fdf2abd2f30, buffer=0x00007fdf301951b0, image=0x00007fdf2bbfbf90, layout=VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, region=<unavailable>) at radv_meta_copy.c:224:10
frame #16: 0x00007fdf2f855823 libvulkan_radeon.so`radv_CmdCopyBufferToImage2KHR(commandBuffer=0x00007fdf2abd2f30, pCopyBufferToImageInfo=0x00007fdf2fcb0300) at radv_meta_copy.c:255:7
frame #17: 0x00007fdf2f8df13e libvulkan_radeon.so`vk_common_CmdCopyBufferToImage(commandBuffer=0x00007fdf2abd2f30, srcBuffer=<unavailable>, dstImage=0x00007fdf2bbfbf90, dstImageLayout=VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, regionCount=1, pRegions=<unavailable>) at vk_cmd_copy.c:142:4
frame #18: 0x00007fdf360a24c8 libplacebo.so.201`vk_tex_upload(gpu=0x00007fdf301df990, params=0x00007fdf2fcb0730) at gpu_tex.c:824:9
frame #19: 0x00007fdf360675f8 libplacebo.so.201`pl_tex_upload(gpu=0x00007fdf301df990, params=0x00007fdf2fcb07c0) at gpu.c:930:12
frame #20: 0x00007fdf3606a2c3 libplacebo.so.201`pl_tex_upload_pbo(gpu=0x00007fdf301df990, params=0x00007fdf2fcb0a90) at gpu.c:1724:15
frame #21: 0x00007fdf360a2099 libplacebo.so.201`vk_tex_upload(gpu=0x00007fdf301df990, params=0x00007fdf2fcb0a90) at gpu_tex.c:722:16
frame #22: 0x00007fdf360675f8 libplacebo.so.201`pl_tex_upload(gpu=0x00007fdf301df990, params=<unavailable>) at gpu.c:930:12
frame #23: 0x00007fdf360a14c8 libplacebo.so.201`vk_tex_create(gpu=<unavailable>, params=0x00007fdf2fcb10b8) at gpu_tex.c:529:14
frame #24: 0x00007fdf3606680c libplacebo.so.201`pl_tex_create(gpu=0x00007fdf301df990, params=0x00007fdf2fcb10b8) at gpu.c:665:12
frame #25: 0x00007fdf3607c927 libplacebo.so.201`sh_lut(sh=0x00007fdf2c2b3cd0, params=<unavailable>) at shaders.c:1023:28
frame #26: 0x00007fdf3608eff8 libplacebo.so.201`pl_shader_sample_polar(sh=0x00007fdf2c2b3cd0, src=<unavailable>, params=<unavailable>) at sampling.c:587:19
frame #27: 0x00007fdf360785e0 libplacebo.so.201`dispatch_sampler(pass=0x00007fdf2fcb1f38, sh=<unavailable>, sampler=<unavailable>, target_tex=0x0000000000000000, src=0x00007fdf2fcb18d8) at renderer.c:664:14
frame #28: 0x00007fdf3607131f libplacebo.so.201`pass_read_image(pass=0x00007fdf2fcb1f38) at renderer.c:1661:13
frame #29: 0x00007fdf3606e60e libplacebo.so.201`pl_render_image(rr=0x00007fdf2fe0bbd0, pimage=0x00007fdf2cfbd338, ptarget=0x00007fdf2fcb3f20, params=0x00007fdf2fcb5730) at renderer.c:2554:10
frame #30: 0x00007fdf360741cc libplacebo.so.201`pl_render_image_mix(rr=<unavailable>, images=<unavailable>, ptarget=<unavailable>, params=<unavailable>) at renderer.c:3049:12
frame #31: 0x00005588a5a5a68f mpv`draw_frame(vo=<unavailable>, frame=0x00007fdf2ca6bf00) at vo_gpu_next.c:939:10
frame #32: 0x00005588a5a3e36f mpv`vo_thread at vo.c:961:13
frame #33: 0x00005588a5a3e2c2 mpv`vo_thread(ptr=<unavailable>) at vo.c:1099:24
frame #34: 0x00007fdf3829b4dc ld-musl-x86_64.so.1`start(p=0x00007fdf2fcb43c0) at pthread_create.c:203:17
frame #35: 0x00007fdf3829de1b ld-musl-x86_64.so.1`__clone + 47
Compiled with gcc:
* thread #1, name = 'mpv', stop reason = signal SIGSEGV
* frame #0: 0x00007f27c54cd23a libvulkan_radeon.so`nir_unsigned_upper_bound(shader=0x00007f27b583f0b0, range_ht=0x00007f27be3b3310, scalar=<unavailable>, config=0x00007f27c5b05ce0) at nir_range_analysis.c:1280:1
frame #1: 0x00007f27c54cd3c1 libvulkan_radeon.so`nir_unsigned_upper_bound(shader=0x00007f27b583f0b0, range_ht=0x00007f27be3b3310, scalar=<unavailable>, config=0x00007f27c5b05ce0) at nir_range_analysis.c:1495:23
frame #2: 0x00007f27c54cd3c1 libvulkan_radeon.so`nir_unsigned_upper_bound(shader=0x00007f27b583f0b0, range_ht=0x00007f27be3b3310, scalar=<unavailable>, config=0x00007f27c5b05ce0) at nir_range_analysis.c:1495:23
frame #3: 0x00007f27c54cd3c1 libvulkan_radeon.so`nir_unsigned_upper_bound(shader=0x00007f27b583f0b0, range_ht=0x00007f27be3b3310, scalar=<unavailable>, config=0x00007f27c5b05ce0) at nir_range_analysis.c:1495:23
frame #4: 0x00007f27c56cb354 libvulkan_radeon.so`aco::(anonymous namespace)::visit_alu_instr(aco::isel_context *, nir_alu_instr *) at aco_instruction_selection.cpp:811:35
frame #5: 0x00007f27c56cb34f libvulkan_radeon.so`aco::(anonymous namespace)::visit_alu_instr(ctx=0x00007f27c5b05c30, instr=0x00007f27b72fafd0) at aco_instruction_selection.cpp:2002:43
frame #6: 0x00007f27c57000db libvulkan_radeon.so`aco::(anonymous namespace)::(anonymous)(aco::isel_context *, exec_list *, exec_list *) at aco_instruction_selection.cpp:9848:47
frame #7: 0x00007f27c57000d0 libvulkan_radeon.so`aco::(anonymous namespace)::(ctx=0x00007f27c5b05c30, list=<unavailable>, list=<unavailable>)(aco::isel_context *, exec_list *, exec_list *) at aco_instruction_selection.cpp:10307:42
frame #8: 0x00007f27c5700f49 libvulkan_radeon.so`aco::select_program(aco::Program*, unsigned int, nir_shader* const*, ac_shader_config*, radv_nir_compiler_options const*, radv_shader_info const*, radv_shader_args const*) at aco_instruction_selection.cpp:11359:20
frame #9: 0x00007f27c55fd7d1 libvulkan_radeon.so`::aco_compile_shader(options=0x00007f27c5b06eb0, info=0x00007f27c5b0a500, shader_count=1, shaders=0x00007f27c5b074a0, args=0x00007f27c5b12db0, binary=0x00007f27c5b06e80) at aco_interface.cpp:131:26
frame #10: 0x00007f27c53af9dc libvulkan_radeon.so`radv_shader_compile at radv_shader.c:1905:7
frame #11: 0x00007f27c53af881 libvulkan_radeon.so`radv_shader_compile(device=0x00007f27be5670a0, module=0x00007f27b50fc0a0, shaders=0x00007f27c5b074a0, shader_count=1, layout=<unavailable>, key=<unavailable>, info=0x00007f27c5b0a500, args=0x00007f27c5b12db0, keep_shader_info=<unavailable>, keep_statistic_info=false, binary_out=0x00007f27c5b07510) at radv_shader.c:1964:11
frame #12: 0x00007f27c53898dc libvulkan_radeon.so`radv_create_shaders at radv_pipeline.c:4198:52
frame #13: 0x00007f27c538bc3c libvulkan_radeon.so`radv_graphics_pipeline_create at radv_pipeline.c:6217:13
frame #14: 0x00007f27c538eca8 libvulkan_radeon.so`radv_CreateGraphicsPipelines(_device=0x00007f27be5670a0, pipelineCache=0x00007f27b730b010, count=1, pCreateInfos=<unavailable>, pAllocator=<unavailable>, pPipelines=0x00007f27b518e3e0) at radv_pipeline.c:6408:11
frame #15: 0x00007f27cbef439c libplacebo.so.201`vk_recreate_pipelines(vk=0x00007f27c5a6d0c0, pass=0x00007f27b518e290, derivable=<unavailable>, base=0x0000000000000000, out_pipe=0x00007f27b518e3e0) at gpu_pass.c:308:16
frame #16: 0x00007f27cbef36fa libplacebo.so.201`vk_pass_create(gpu=<unavailable>, params=0x0000000000053710) at gpu_pass.c:623:5
frame #17: 0x00007f27cbeb8256 libplacebo.so.201`pl_pass_create(gpu=<unavailable>, params=0x00007f27c5b212e0) at gpu.c:1481:20
frame #18: 0x00007f27cbeadd97 libplacebo.so.201`finalize_pass(dp=<unavailable>, sh=<unavailable>, target=<unavailable>, vert_pos="_position_12_3", blend=<unavailable>, load=<unavailable>, vparams=0x0000000000000000, proj=0x0000000000000000) at dispatch.c:895:18
frame #19: 0x00007f27cbeab8be libplacebo.so.201`pl_dispatch_finish(dp=0x00007f27be5573f0, params=0x00007f27c5b21600) at dispatch.c:1249:25
frame #20: 0x00007f27cbec6b95 libplacebo.so.201`_img_tex(pass=0x00007f27c5b21f38, img=0x00007f27c5b21ce0, tag=<unavailable>) at renderer.c:493:15
frame #21: 0x00007f27cbec0711 libplacebo.so.201`pass_read_image [inlined] deband_src(pass=0x00007f27c5b21f38, psh=<unavailable>, psrc=0x00007f27c5b218d8) at renderer.c:1157:18
frame #22: 0x00007f27cbec04c0 libplacebo.so.201`pass_read_image(pass=0x00007f27c5b21f38) at renderer.c:1660:13
frame #23: 0x00007f27cbebd60e libplacebo.so.201`pl_render_image(rr=0x00007f27c5af1580, pimage=0x00007f27b6500338, ptarget=0x00007f27c5b23f20, params=0x00007f27c5b25710) at renderer.c:2554:10
frame #24: 0x00007f27cbec31cc libplacebo.so.201`pl_render_image_mix(rr=<unavailable>, images=<unavailable>, ptarget=<unavailable>, params=<unavailable>) at renderer.c:3049:12
frame #25: 0x00005560ecdd068f mpv`draw_frame(vo=<unavailable>, frame=0x00007f27b730a930) at vo_gpu_next.c:939:10
frame #26: 0x00005560ecdb436f mpv`vo_thread at vo.c:961:13
frame #27: 0x00005560ecdb42c2 mpv`vo_thread(ptr=<unavailable>) at vo.c:1099:24
frame #28: 0x00007f27ce0ea4dc ld-musl-x86_64.so.1`start(p=0x00007f27c5b243c0) at pthread_create.c:203:17
frame #29: 0x00007f27ce0ece1b ld-musl-x86_64.so.1`__clone + 47
Edited by Ghost User