Skip to content

Segmentation fault with AMD GPU on start #79

@bscubed

Description

@bscubed

Describe the Bug

This was previously mentioned on loki's repo here, but since it hasn't been addressed, and this is the currently maintained repo, I figured I'd mention it here as well.

The debug logs output no errors, however the program segfaults and exits without any additional context. It seems to only occur on AMD GPUs since all other reported instances of this error happened on AMD GPUs, however I could be mistaken.

In the previous issue, it was narrowed down to the free_ctx method in sunshine/video.cpp.

void free_ctx(AVCodecContext *ctx) {
  //avcodec_free_context(&ctx);
}

Commenting out this line allows Sunshine to run, although I'm sure that's not the proper solution.

Expected Behavior

The program is expected to open and start normally, but instead a segmentation fault occurs.

Additional Context

Debug logs:
[audio_sink] -- [alsa_output.pci-0000_55_00.1.hdmi-stereo-extra4.monitor]
[fps] -- [[10,30,60,90,120,"170"]]
[amd_rc] -- [auto]
[encoder] -- [vaapi]
[hevc_mode] -- [0]
[nv_rc] -- [auto]
[min_threads] -- [1]
[gamepad] -- [x360]
[nv_preset] -- [default]
[upnp] -- [disabled]
[file_apps] -- [/home/user/.config/sunshine/apps_linux.json]
[nv_coder] -- [auto]
[sunshine_name] -- [User's Desktop]
[amd_quality] -- [default]
[origin_web_ui_allowed] -- [lan]
[min_log_level] -- [1]
[output_name] -- [1]
[key_rightalt_to_key_win] -- [disabled]
[resolutions] -- [[
    352x240,
    480x360,
    858x480,
    1280x720,
    1920x1080,
    2560x1080,
    3440x1440,
    1920x1200,
    3860x2160,
    3840x1600,
    2560x1440
]]
[origin_pin_allowed] -- [pc]
[2022:02:28:19:51:36]: Info: Found display [wayland-0]
[2022:02:28:19:51:36]: Debug: Available interface: wl_compositor(1) version 4
[2022:02:28:19:51:36]: Debug: Available interface: wl_drm(2) version 2
[2022:02:28:19:51:36]: Debug: Available interface: wl_shm(3) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zxdg_output_manager_v1(6) version 3
[2022:02:28:19:51:36]: Info: Found interface: zxdg_output_manager_v1(6) version 3
[2022:02:28:19:51:36]: Debug: Available interface: wl_data_device_manager(7) version 3
[2022:02:28:19:51:36]: Debug: Available interface: zwp_primary_selection_device_manager_v1(8) version 1
[2022:02:28:19:51:36]: Debug: Available interface: gtk_primary_selection_device_manager(9) version 1
[2022:02:28:19:51:36]: Debug: Available interface: wl_subcompositor(10) version 1
[2022:02:28:19:51:36]: Debug: Available interface: xdg_wm_base(11) version 3
[2022:02:28:19:51:36]: Debug: Available interface: zxdg_shell_v6(12) version 1
[2022:02:28:19:51:36]: Debug: Available interface: wl_shell(13) version 1
[2022:02:28:19:51:36]: Debug: Available interface: gtk_shell1(14) version 5
[2022:02:28:19:51:36]: Debug: Available interface: wp_viewporter(15) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zwp_pointer_gestures_v1(16) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zwp_tablet_manager_v2(17) version 1
[2022:02:28:19:51:36]: Debug: Available interface: wl_seat(18) version 5
[2022:02:28:19:51:36]: Debug: Available interface: zwp_relative_pointer_manager_v1(19) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zwp_pointer_constraints_v1(20) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zxdg_exporter_v1(21) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zxdg_importer_v1(22) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zwp_linux_dmabuf_v1(23) version 3
[2022:02:28:19:51:36]: Debug: Available interface: zwp_keyboard_shortcuts_inhibit_manager_v1(24) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zwp_text_input_manager_v3(25) version 1
[2022:02:28:19:51:36]: Debug: Available interface: gtk_text_input_manager(26) version 1
[2022:02:28:19:51:36]: Debug: Available interface: wp_presentation(27) version 1
[2022:02:28:19:51:36]: Debug: Available interface: xdg_activation_v1(28) version 1
[2022:02:28:19:51:36]: Debug: Available interface: wl_output(36) version 2
[2022:02:28:19:51:36]: Info: Found interface: wl_output(36) version 2
[2022:02:28:19:51:36]: Debug: Available interface: wl_output(38) version 2
[2022:02:28:19:51:36]: Info: Found interface: wl_output(38) version 2
[2022:02:28:19:51:36]: Warning: Missing Wayland wire for wlr-export-dmabuf
[2022:02:28:19:51:36]: Debug: crtc(0, 0)
[2022:02:28:19:51:36]: Debug: crtc(1920, 1080)
[2022:02:28:19:51:36]: Debug: plane->possible_crtcs == 2
[2022:02:28:19:51:36]: Debug: x(0) y(0) crtc_x(0) crtc_y(0) crtc_id(75)
[2022:02:28:19:51:36]: Debug: Resolution: 1920x1080: Pitch: 7680: Offset: 0
[2022:02:28:19:51:36]: Debug: Format [XR24, AR24, RA24, XR30, XB30, AR30, AB30, XR48, XB48, AR48, AB48, XB24, AB24, RG16, NV12, XR4H, AR4H, XB4H, AB4H]
[2022:02:28:19:51:36]: Debug: crtc(0, 0)
[2022:02:28:19:51:36]: Debug: crtc(2560, 1440)
[2022:02:28:19:51:36]: Debug: plane->possible_crtcs == 1
[2022:02:28:19:51:36]: Debug: x(0) y(0) crtc_x(0) crtc_y(0) crtc_id(72)
[2022:02:28:19:51:36]: Debug: Resolution: 2560x1440: Pitch: 10240: Offset: 0
[2022:02:28:19:51:36]: Debug: Format [XR24, AR24, RA24, XR30, XB30, AR30, AB30, XR48, XB48, AR48, AB48, XB24, AB24, RG16, NV12, XR4H, AR4H, XB4H, AB4H]
[2022:02:28:19:51:36]: Info: Found display [wayland-0]
[2022:02:28:19:51:36]: Info: Found display [wayland-0]
[2022:02:28:19:51:36]: Debug: Available interface: wl_compositor(1) version 4
[2022:02:28:19:51:36]: Debug: Available interface: wl_drm(2) version 2
[2022:02:28:19:51:36]: Debug: Available interface: wl_shm(3) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zxdg_output_manager_v1(6) version 3
[2022:02:28:19:51:36]: Info: Found interface: zxdg_output_manager_v1(6) version 3
[2022:02:28:19:51:36]: Debug: Available interface: wl_data_device_manager(7) version 3
[2022:02:28:19:51:36]: Debug: Available interface: zwp_primary_selection_device_manager_v1(8) version 1
[2022:02:28:19:51:36]: Debug: Available interface: gtk_primary_selection_device_manager(9) version 1
[2022:02:28:19:51:36]: Debug: Available interface: wl_subcompositor(10) version 1
[2022:02:28:19:51:36]: Debug: Available interface: xdg_wm_base(11) version 3
[2022:02:28:19:51:36]: Debug: Available interface: zxdg_shell_v6(12) version 1
[2022:02:28:19:51:36]: Debug: Available interface: wl_shell(13) version 1
[2022:02:28:19:51:36]: Debug: Available interface: gtk_shell1(14) version 5
[2022:02:28:19:51:36]: Debug: Available interface: wp_viewporter(15) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zwp_pointer_gestures_v1(16) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zwp_tablet_manager_v2(17) version 1
[2022:02:28:19:51:36]: Debug: Available interface: wl_seat(18) version 5
[2022:02:28:19:51:36]: Debug: Available interface: zwp_relative_pointer_manager_v1(19) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zwp_pointer_constraints_v1(20) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zxdg_exporter_v1(21) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zxdg_importer_v1(22) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zwp_linux_dmabuf_v1(23) version 3
[2022:02:28:19:51:36]: Debug: Available interface: zwp_keyboard_shortcuts_inhibit_manager_v1(24) version 1
[2022:02:28:19:51:36]: Debug: Available interface: zwp_text_input_manager_v3(25) version 1
[2022:02:28:19:51:36]: Debug: Available interface: gtk_text_input_manager(26) version 1
[2022:02:28:19:51:36]: Debug: Available interface: wp_presentation(27) version 1
[2022:02:28:19:51:36]: Debug: Available interface: xdg_activation_v1(28) version 1
[2022:02:28:19:51:36]: Debug: Available interface: wl_output(36) version 2
[2022:02:28:19:51:36]: Info: Found interface: wl_output(36) version 2
[2022:02:28:19:51:36]: Debug: Available interface: wl_output(38) version 2
[2022:02:28:19:51:36]: Info: Found interface: wl_output(38) version 2
[2022:02:28:19:51:36]: Info: Offset: 0x0
[2022:02:28:19:51:36]: Info: Resolution: 2560x1440
[2022:02:28:19:51:36]: Info: Name: DP-1
[2022:02:28:19:51:36]: Info: Found monitor: GIGA-BYTE TECHNOLOGY CO., LTD. 32"
[2022:02:28:19:51:36]: Info: Offset: 2560x360
[2022:02:28:19:51:36]: Info: Resolution: 1920x1080
[2022:02:28:19:51:36]: Info: Name: HDMI-2
[2022:02:28:19:51:36]: Info: Found monitor: Dell Inc. 24"
[2022:02:28:19:51:36]: Info: DP-1: GIGA-BYTE TECHNOLOGY CO., LTD. 32"
[2022:02:28:19:51:36]: Info: HDMI-2: Dell Inc. 24"
[2022:02:28:19:51:36]: Debug: Monitor description
[2022:02:28:19:51:36]: Debug: Resolution: 0x0
[2022:02:28:19:51:36]: Debug: Offset: 0x0
[2022:02:28:19:51:36]: Debug: Monitor description
[2022:02:28:19:51:36]: Debug: Resolution: 2560x1440
[2022:02:28:19:51:36]: Debug: Offset: 0x0
[2022:02:28:19:51:36]: Debug: Monitor description
[2022:02:28:19:51:36]: Debug: Resolution: 1920x1080
[2022:02:28:19:51:36]: Debug: Offset: 2560x360
[2022:02:28:19:51:36]: Debug: Desktop resolution: 4480x1440
[2022:02:28:19:51:36]: Info: //////////////////////////////////////////////////////////////////
[2022:02:28:19:51:36]: Info: //                                                              //
[2022:02:28:19:51:36]: Info: //   Testing for available encoders, this may generate errors.  //
[2022:02:28:19:51:36]: Info: //   You can safely ignore those errors.                        //
[2022:02:28:19:51:36]: Info: //                                                              //
[2022:02:28:19:51:36]: Info: //////////////////////////////////////////////////////////////////
[2022:02:28:19:51:36]: Info: Trying encoder [vaapi]
[2022:02:28:19:51:36]: Info: Screencasting with KMS
[2022:02:28:19:51:36]: Info: Found monitor for DRM screencasting
[2022:02:28:19:51:36]: Debug: crtc(0, 0)
[2022:02:28:19:51:36]: Debug: crtc(2560, 1440)
[2022:02:28:19:51:36]: Debug: plane->possible_crtcs == 1
[2022:02:28:19:51:36]: Debug: x(0) y(0) crtc_x(0) crtc_y(0) crtc_id(72)
[2022:02:28:19:51:36]: Debug: Resolution: 2560x1440: Pitch: 10240: Offset: 0
[2022:02:28:19:51:36]: Debug: Format [XR24, AR24, RA24, XR30, XB30, AR30, AB30, XR48, XB48, AR48, AB48, XB24, AB24, RG16, NV12, XR4H, AR4H, XB4H, AB4H]
[2022:02:28:19:51:36]: Debug: EGL: [Mesa Project]: version [1.5]
[2022:02:28:19:51:36]: Debug: API's supported: [OpenGL OpenGL_ES ]
[2022:02:28:19:51:36]: Debug: GL: vendor: AMD
[2022:02:28:19:51:36]: Debug: GL: renderer: AMD DIMGREY_CAVEFISH (DRM 3.44.0, 5.16.10-zen1-1-zen, LLVM 13.0.1)
[2022:02:28:19:51:36]: Debug: GL: version: 4.6 (Compatibility Profile) Mesa 21.3.7
[2022:02:28:19:51:36]: Debug: GL: shader: 4.60
[2022:02:28:19:51:36]: Info: Color coding [Rec. 601]
[2022:02:28:19:51:36]: Info: Color range: [JPEG]
[2022:02:28:19:51:36]: Debug: vaapi vendor: Mesa Gallium driver 21.3.7 for AMD DIMGREY_CAVEFISH (DRM 3.44.0, 5.16.10-zen1-1-zen, LLVM 13.0.1)
[1]    381224 segmentation fault (core dumped)  sunshine '/home/user/.config/sunshine/sunshine.conf'

Sunshine Host Operating System and Version

Arch Linux (kernel 5.16.10-zen)

Architecture

64 bit

Sunshine Version

0.13.0

GPU Type

AMD

GPU Model

Radeon RX 6600

GPU Driver/Mesa Version

Mesa 21.3.7

Capture Method (Linux Only)

PipeWire/VAAPI/Wayland

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions