Skip to content

segfault on arm64/freedreno in vk_malloc_import: vk->GetMemoryHostPointerPropertiesEXT is NULL #352

@Infinoid

Description

@Infinoid

[Note: I've applied for an account at code.videolan.org, it's waiting for approval. Posting here in the meantime.]

I'm running mpv on arm64, and it segfaults whenever I try to take a screenshot.

Backtrace:

(lldb) bt
* thread #1, name = 'mpv', stop reason = signal SIGSEGV: address not mapped to object
    frame #0: 0x0000000000000000
  * frame #1: 0x0000e51fbfc92c20 libplacebo.so.351`vk_malloc_import(ma=0x0000e51f7c075a10, out=0x0000e51f7c38b868, params=0x0000e51faa1ed3e0) at malloc.c:870:9
    frame #2: 0x0000e51fbfc8b5e8 libplacebo.so.351`vk_buf_create at gpu_buf.c:224:10
    frame #3: 0x0000e51fbfc5e990 libplacebo.so.351`pl_buf_create at gpu.c:607:18
    frame #4: 0x0000e51fbfc61700 libplacebo.so.351`pl_tex_download_pbo at utils.c:629:15
    frame #5: 0x0000e51fbfc8d77c libplacebo.so.351`vk_tex_download at gpu_tex.c:1002:16
    frame #6: 0x0000e51fbfc5e7ac libplacebo.so.351`pl_tex_download at gpu.c:527:12
    frame #7: 0x0000c206fd7df950 mpv`tex_download_pl at ra_pl.c:238:12
    frame #8: 0x0000c206fd7cef68 mpv`gl_video_screenshot at video.c:3624:10
    frame #9: 0x0000c206fd7d5e30 mpv`control at vo_gpu.c:199:13
    frame #10: 0x0000c206fd7d2d24 mpv`run_control at vo.c:658:15
    frame #11: 0x0000c206fd751458 mpv`mp_dispatch_queue_process at dispatch.c:300:13
    frame #12: 0x0000c206fd7d4b18 mpv`vo_thread at vo.c:1141:9
    frame #13: 0x0000e51fbe535f78 libc.so.6`___lldb_unnamed_symbol3490 + 920
    frame #14: 0x0000e51fbe59de8c libc.so.6`___lldb_unnamed_symbol3864 + 12

Direct cause: this code tries to call through a null pointer.

(lldb) p vk->GetMemoryHostPointerPropertiesEXT
(PFN_vkGetMemoryHostPointerPropertiesEXT) 0x0000000000000000

I've posted the other fields of the vk structure to this gist.

Software versions:

  • debian forky (testing)
  • mpv 0.40.0-5+b1
  • libplacebo 7.351.0-2
  • mesa-vulkan-drivers v25.2.6-1
  • libvulkan1 1.4.328.1-1
  • libdrm-freedreno1 2.4.127-1

Hardware:

I'm not sure this is a libplacebo bug, or if libplacebo just happens to be the site of the crash. It looks (from vulkaninfo) like the vulkan provider (mesa/freedreno) advertises the VK_EXT_external_memory_host extension, but (from printing the vk struct contents) doesn't implement GetMemoryHostPointerPropertiesEXT. Is this a situation where libplacebo should look before it leaps, is this a mesa/freedreno bug, or both?

[Update] No, it's llvmpipe that advertises that extension, not freedreno. (I'm learning how to read vulkaninfo output.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions