obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
60.58k stars 8.01k forks source link

OBS core dump when using integrated gpu on wayland #11012

Open 64-bitman opened 4 months ago

64-bitman commented 4 months ago

Operating System Info

Other

Other OS

Arch Linux

OBS Studio Version

Other

OBS Studio Version (Other)

Flatapak 30.2.0

OBS Studio Log URL

https://obsproject.com/logs/TTOMTHf2S5ROE03W

OBS Studio Crash Log URL

No response

Expected Behavior

For OBS to use the integrated GPU as default

Current Behavior

Window pops up then disappears (core dump)

Steps to Reproduce

  1. Boot system with initial GPU device as the dedicated card
  2. run DRI_PRIME=1 com.obsproject.Studio (set DRI_PRIME to non-default iGPU)
  3. A window should pop up then close immediately after

Anything else we should know?

Specs: AMD Ryzen 7600 Sapphire Nitro+ 8G RX580 Gigabyte Technology Co., Ltd. B650 EAGLE AX

Relevant systemd logs:

Jul 20 01:36:29 radon systemd[1389]: Started app-flatpak-com.obsproject.Studio-9525.scope.
Jul 20 01:36:29 radon gnome-shell[1679]: Couldn't retrieve the supported modifiers
Jul 20 01:36:29 radon gnome-shell[1679]: Couldn't retrieve the supported modifiers
Jul 20 01:36:29 radon kernel: libobs: graphic[9589]: segfault at 0 ip 0000000000000000 sp 000073b4e39feff8 error 14 in obs[599f74254000+7a000] likely on CPU 4 (core 4, socket 0)
Jul 20 01:36:29 radon kernel: Code: Unable to access opcode bytes at 0xffffffffffffffd6.
Jul 20 01:36:29 radon systemd-coredump[9713]: Process 9556 (obs) of user 1000 terminated abnormally with signal 11/SEGV, processing...
Jul 20 01:36:30 radon systemd[1]: Started Process Core Dump (PID 9713/UID 0).
Jul 20 01:36:30 radon systemd-coredump[9714]: [🡕] Process 9556 (obs) of user 1000 dumped core.

                                              Stack trace of thread 29:
                                              #0  0x0000000000000000 n/a (n/a + 0x0)
                                              #1  0x000073b526b8ae18 n/a (/usr/lib/x86_64-linux-gnu/GL/default/lib/libEGL_mesa.so.0.0.0 + 0x2ee18)
                                              #2  0x000073b526b8b523 n/a (/usr/lib/x86_64-linux-gnu/GL/default/lib/libEGL_mesa.so.0.0.0 + 0x2f523)
                                              #3  0x000073b50dcb81a5 n/a (/usr/lib/x86_64-linux-gnu/GL/default/lib/dri/libgallium_dri.so + 0xb81a5)
                                              #4  0x000073b50dcb8255 n/a (/usr/lib/x86_64-linux-gnu/GL/default/lib/dri/libgallium_dri.so + 0xb8255)
                                              #5  0x000073b50dcbb726 n/a (/usr/lib/x86_64-linux-gnu/GL/default/lib/dri/libgallium_dri.so + 0xbb726)
                                              #6  0x000073b50dd8d705 n/a (/usr/lib/x86_64-linux-gnu/GL/default/lib/dri/libgallium_dri.so + 0x18d705)
                                              #7  0x000073b50dd8e2b1 n/a (/usr/lib/x86_64-linux-gnu/GL/default/lib/dri/libgallium_dri.so + 0x18e2b1)
                                              #8  0x000073b50dcbb300 n/a (/usr/lib/x86_64-linux-gnu/GL/default/lib/dri/libgallium_dri.so + 0xbb300)
                                              #9  0x000073b50dcbee12 n/a (/usr/lib/x86_64-linux-gnu/GL/default/lib/dri/libgallium_dri.so + 0xbee12)
                                              #10 0x000073b526b8283d n/a (/usr/lib/x86_64-linux-gnu/GL/default/lib/libEGL_mesa.so.0.0.0 + 0x2683d)
                                              #11 0x000073b526b72f23 n/a (/usr/lib/x86_64-linux-gnu/GL/default/lib/libEGL_mesa.so.0.0.0 + 0x16f23)
                                              #12 0x000073b534530531 n/a (/usr/lib/x86_64-linux-gnu/libEGL.so.1.1.0 + 0x5531)
                                              #13 0x000073b526bcc285 n/a (/app/lib/libobs-opengl.so.30.2.0 + 0x16285)
                                              #14 0x000073b53987c866 n/a (/app/lib/libobs.so.30.2.0 + 0x3f866)
                                              #15 0x000073b5398c5da8 n/a (/app/lib/libobs.so.30.2.0 + 0x88da8)
                                              #16 0x000073b5398c67d8 n/a (/app/lib/libobs.so.30.2.0 + 0x897d8)
                                              #17 0x000073b5346a1e39 n/a (/usr/lib/x86_64-linux-gnu/libc.so.6 + 0x8ee39)
                                              #18 0x000073b5347299c4 n/a (/usr/lib/x86_64-linux-gnu/libc.so.6 + 0x1169c4)
                                              ELF object binary architecture: AMD x86-64
Jul 20 01:36:30 radon systemd[1]: systemd-coredump@6-9713-0.service: Deactivated successfully.
kkartaltepe commented 4 months ago

For using gdb in the Flatpak (src):

$ flatpak install org.freedesktop.Sdk.Debug com.obsproject.Studio.Debug # Optional: Install OBS Studio debug symbols
$ flatpak run --command=sh --devel com.obsproject.Studio
$ gdb /app/bin/obs

Once gdb ready, run by entering the command r and reproduce the crash. Once done, you should be able to enter the command bt. Message the output of this command. You can quit by entering the command q.

64-bitman commented 4 months ago

env DRI_PRIME=1 gdb --args /app/bin/obs --safe-mode:

#0  0x0000000000000000 in ??? ()
#1  0x00007fffd04b679e in dri2_create_image_common () at /usr/lib/x86_64-linux-gnu/GL/default/lib/dri/radeonsi_dri.so
#2  0x00007fffe58f4e18 in update_buffers () at /usr/lib/x86_64-linux-gnu/GL/default/lib/libEGL_mesa.so.0
#3  0x00007fffe58f5523 in image_get_buffers () at /usr/lib/x86_64-linux-gnu/GL/default/lib/libEGL_mesa.so.0
#4  0x00007fffd04b81a5 in dri_image_drawable_get_buffers () at /usr/lib/x86_64-linux-gnu/GL/default/lib/dri/radeonsi_dri.so
#5  0x00007fffd04b8255 in dri2_allocate_textures () at /usr/lib/x86_64-linux-gnu/GL/default/lib/dri/radeonsi_dri.so
#6  0x00007fffd04bb726 in dri_st_framebuffer_validate () at /usr/lib/x86_64-linux-gnu/GL/default/lib/dri/radeonsi_dri.so
#7  0x00007fffd058d705 in st_framebuffer_validate () at /usr/lib/x86_64-linux-gnu/GL/default/lib/dri/radeonsi_dri.so
#8  0x00007fffd058e2b1 in st_api_make_current () at /usr/lib/x86_64-linux-gnu/GL/default/lib/dri/radeonsi_dri.so
#9  0x00007fffd04bb300 in dri_make_current () at /usr/lib/x86_64-linux-gnu/GL/default/lib/dri/radeonsi_dri.so
#10 0x00007fffd04bee12 in driBindContext () at /usr/lib/x86_64-linux-gnu/GL/default/lib/dri/radeonsi_dri.so
#11 0x00007fffe58ec83d in dri2_make_current () at /usr/lib/x86_64-linux-gnu/GL/default/lib/libEGL_mesa.so.0
#12 0x00007fffe58dcf23 in eglMakeCurrent () at /usr/lib/x86_64-linux-gnu/GL/default/lib/libEGL_mesa.so.0
#13 0x00007ffff2b3f531 in InternalMakeCurrentVendor (dpy=0x55555660ee70, draw=draw@entry=0x555557c8f820, read=read@entry=0x555557c8f820, context=context@entry=0x5555569ebdd0, apiState=0x7fff44005520, vendor=<optimized out>) at ../src/EGL/libegl.c:587
        ret = <optimized out>
        __PRETTY_FUNCTION__ = "InternalMakeCurrentVendor"
#14 0x00007ffff2b41ce8 in eglMakeCurrent (dpy=dpy@entry=0x55555660e3c0, draw=draw@entry=0x555557c8f820, read=read@entry=0x555557c8f820, context=context@entry=0x5555569ebdd0) at ../src/EGL/libegl.c:729
        glas = <optimized out>
        apiState = <optimized out>
        oldVendor = <optimized out>
        newVendor = <optimized out>
        oldDpy = <optimized out>
        newDpy = <optimized out>
        oldDraw = <optimized out>
        oldRead = <optimized out>
        oldContext = <optimized out>
        ret = <optimized out>
        __PRETTY_FUNCTION__ = "eglMakeCurrent"
#15 0x00007fffe5936285 in egl_make_current (display=0x55555660e3c0, surface=0x555557c8f820, context=0x5555569ebdd0) at /run/build/obs/libobs-opengl/gl-wayland-egl.c:123
#16 0x00007ffff5730866 in render_display_begin (update_color_space=false, cy=<optimized out>, cx=<optimized out>, display=0x555555ba6a60) at /run/build/obs/libobs/obs-display.c:186
        clear_color = {{{x = -3.03532933e-18, y = 4.59163468e-41, z = -1.02920973e+34, w = 4.59163468e-41}, ptr = {-3.03532933e-18, 4.59163468e-41, -1.02920973e+34, 4.59163468e-41}, m = {-3.03532933e-18, 4.59163468e-41, -1.02920973e+34, 4.59163468e-41}}}
        success = <optimized out>
        clear_color = {{{x = <optimized out>, y = <optimized out>, z = <optimized out>, w = <optimized out>}, ptr = {<optimized out>, <optimized out>, <optimized out>, <optimized out>}, m = {<optimized out>, <optimized out>, <optimized out>, <optimized out>}}}
        success = <optimized out>
        use_clear_workaround = <optimized out>
        clear_flags = <optimized out>
        solid_effect = <optimized out>
#17 render_display (display=display@entry=0x555555ba6a60) at /run/build/obs/libobs/obs-display.c:262
        cx = <optimized out>
        cy = <optimized out>
        update_color_space = false
#18 0x00007ffff5779da8 in render_displays () at /run/build/obs/libobs/obs-video.c:104
        display = 0x555555ba6a60
        display = <optimized out>
#19 obs_graphics_thread_loop (context=context@entry=0x7fffa25ffa30) at /run/build/obs/libobs/obs-video.c:1238
        frame_start = 11782390070710
        frame_time_ns = <optimized out>
#20 0x00007ffff577a7d8 in obs_graphics_thread (param=<optimized out>) at /run/build/obs/libobs/obs-video.c:1304
        interval = <optimized out>
        video_thread_name = 0x7fff44000bc0 "obs_graphics_thread(33.3333 ms)"
        context = {last_time = 11782390014590, interval = 33333333, frame_time_total_ns = 6023763, fps_total_ns = 666666660, fps_total_frames = 20, video_thread_name = 0x7fff44000bc0 "obs_graphics_thread(33.3333 ms)"}
#21 0x00007ffff2ca1e39 in start_thread (arg=<optimized out>) at pthread_create.c:444
        ret = <optimized out>
        pd = <optimized out>
        out = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737266719536, -8633077164338152015, 140735917590208, -392, 2, 140737488339312, -8633077164317180495, -8632970418456068687}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#22 0x00007ffff2d299c4 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100
kkartaltepe commented 4 months ago

This looks like a bug in mesa to me.