You are not logged in.

#1 2024-12-13 18:24:51

Nyctfall
Member
Registered: 2023-04-03
Posts: 3

[Wayland] Crash On Screen Capture: obs-studio 31.0.0-1, pipewire 1.2.7

Hello Arch Linux community, thank you for your consideration and time! I tried to fix this myself, but I'm low on troubleshooting time.

The closest similar issues that were found: (GitHub obsproject/obs-studio "Crash when initializing PipeWire screen sharing since 31.0.0 (GNOME Wayland) #11617", GitHub obsproject/obs-studio "libobs/util: Crash on bmalloc(0) #11181"), which seems to confirm my suspicions that the crash's characteristics indicate this is intentionally done by the OBS Project's devs. After troubleshooting this since doing a pacman upgrade on 2024-12-09, it appears that others are getting the same crash as well. According to GitHub obsproject/obs-studio "Memory allocator cleanups #6721", OBS dev "notr1ch" said it shouldn't be a bug in OBS directly, but in a 3rd party plugin. However, I do not have any external 3rd party OBS plugins, just the dependencies and optional dependencies for the package (See foonotes * and **).

Question:

Should I make an Arch Linux GitLab bug report for "obs-studio 31.0.0-1" having intentional bugs by the upstream OBS devs?

Problem:

When trying to use OBS for screen capture with Wayland, the 'Screen Capture (PipeWire)' mode will cause the app to crash under Wayland or XWayland when a screen/app capture source is selected. Under an X.Org KDE desktop session, the "Open Selector" button for "Screen Capture (PipeWire)" will not open a "Screen Sharing" KDE dialog menu window, making selecting a capture source non-functional (as well as any previously configured capture sources for PipeWire screen capture also being non-functional).
This was noticed after upgrading "obs-studio (30.2.1-2 -> 31.0.0-1)".

Steps to reproduce:
  • Arch Linux (Installed according to Arch Wiki),

  • Linux kernel (linux 6.12.4.arch1-1),

  • Desktop Manager (gdm 47.0-2) and Wayland (wayland 1.23.1-1), with KDE Plasma 6 (plasma-desktop 6.2.4-1, plasma-meta 6.1-1) or GNOME 47 (gnome-desktop 1:44.1-1, gnome-session 47.0.1-1, gnome-shell 1:47.2-1)

  • Pipewire (libpipewire 1:1.2.7-1, pipewire 1:1.2.7-1) with WirePlummer (libwireplumber 0.5.7-1, wireplumber 0.5.7-1)

  • OBS Studio (obs-studio 31.0.0-1, ffmpeg 2:7.1-3, alsa-lib 1.2.13-1, glibc 2.40+r16+gaa533d58ff-2, gcc-libs 14.2.1+r134+gab884fffe3fc-1, systemd-libs 257-1, pam 1.7.0-1, pipewire-audio 1:1.2.7-1, mesa 1:24.3.1-3)

  • Start a Wayland desktop session,

  • Open OBS (through .desktop file, terminal, or with GDB)

  • Click the "+" ("Add Source") button in the "Sources" section, and select "Screen Capture (PipeWire)" option,

  • In the "Properties for 'Screen Capture (PipeWire)'" OBS pop-up window, click the "Open Selector" button. (This step will fail under an X.Org desktop session.)

  • In the "Screen Sharing" GNOME/KDE pop-up dialog menu window, select any of the options under either the "screens" tab or the "windows" tab (for attached/virtual monitors or open application windows respectively),

  • Immediate crash (SIGTRAP under GNU Debugger)

  • Get a SystemD coredump file added to /var/lib/systemd/coredump

  • hmm ...

  • Profit?

Details:

Starting OBS with "--verbose" (GDM, KDE, Wayland), and without selecting a capture source that will crash OBS, outputs: http://0x0.st/XFqo.txt (X.Org X11: http://0x0.st/XFBw.txt, doesn't crash, but instead will error "warning: [pipewire] Failed to create session, denied or cancelled by user")

$ obs --verbose
#...
debug: Found portal inhibitor
# ...
warning: ReadOne on org.freedesktop.portal.Settings returned an invalid reply
# ...
debug: Loading module: linux-pipewire.so
info: [pipewire] Available capture sources:
info: [pipewire]     - Monitor source
info: [pipewire]     - Window source
# ...
debug: source 'Scene' (scene) created
info: PipeWire initialized
debug: source 'Screen Capture (PipeWire)' (pipewire-screen-capture-source) created
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (PipeWire)' (pipewire-screen-capture-source)
info: ------------------------------------------------
info: [pipewire] Screencast session created
debug: Attempted path: /usr/bin/../share/obs/obs-studio/images/overflow.png
debug: [pipewire] Response to select source received
info: [pipewire] Asking for monitor and window
info: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Desktop Audio)

info: ==== Shutting down ==================================================
# ...
info: [portals] Request cancelled
#...

This seems to indicate some sort of permissions issue with Pipewire or WirePlumber and Wayland portals, as a "Monitor Source" option is not available under the "+ (Add Sources)" menu.

Checking a core dump from one of the OBS crashes shows: http://0x0.st/XFmb.txt

$  coredumpctl -1 gdb
# ...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `/usr/bin/obs'.
Program terminated with signal SIGTRAP, Trace/breakpoint trap.
#0  0x00007765210a53f4 in ?? () from /usr/lib/libc.so.6
[Current thread is 1 (Thread 0x77650e764180 (LWP 6858))]
(gdb) bt
#0  0x00007765210a53f4 in ?? () from /usr/lib/libc.so.6
#1  0x000077652104c120 in raise () from /usr/lib/libc.so.6
#2  0x0000776523b87eec in bmalloc () from /usr/lib/libobs.so.30
# ...

Which appears to indicate the call to 'bmalloc' is the cause of the crash.

GDB appears to confirm this when running 'obs --verbose': http://0x0.st/XFme.txt (XWayland: http://0x0.st/XFB4.txt)

$ gdb obs
# ...
debug: source 'Scene' (scene) created
info: PipeWire initialized
debug: source 'Screen Capture (PipeWire)' (pipewire-screen-capture-source) created
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (PipeWire)' (pipewire-screen-capture-source)
info: ------------------------------------------------
[Thread 0x7fff93fff6c0 (LWP 8250) exited]
info: [pipewire] Screencast session created
debug: Attempted path: /usr/bin/../share/obs/obs-studio/images/overflow.png
debug: [pipewire] Response to select source received
info: [pipewire] Asking for monitor and window
info: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Desktop Audio)

info: [pipewire] source selected, setting up screencast
[New Thread 0x7fff922bc6c0 (LWP 8292)]
info: [pipewire] Server version: 1.2.7
info: [pipewire] Library version: 1.2.7
info: [pipewire] Header version: 1.2.7

Thread 1 "obs" received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff2aa53f4 in ?? () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff2aa53f4 in ?? () from /usr/lib/libc.so.6
#1  0x00007ffff2a4c120 in raise () from /usr/lib/libc.so.6
#2  0x00007ffff5587eec in bmalloc () from /usr/lib/libobs.so.30
# ...
(gdb) c
Continuing.
bmalloc: Allocating 0 bytes is broken behavior, please fix your code!
# ...

*Currently installed obs-studio deps: http://0x0.st/XFmO.txt
**ALPM log of the pacman update that broke obs-studio: http://0x0.st/XFmJ.txt

Last edited by Nyctfall (2024-12-13 20:46:25)

Offline

#2 2024-12-14 15:51:47

zukas97
Member
Registered: 2024-12-14
Posts: 1

Re: [Wayland] Crash On Screen Capture: obs-studio 31.0.0-1, pipewire 1.2.7

Having the same problem! Pleas tell me if you find a solution.

Offline

#3 Today 05:59:05

Nyctfall
Member
Registered: 2023-04-03
Posts: 3

Re: [Wayland] Crash On Screen Capture: obs-studio 31.0.0-1, pipewire 1.2.7

zukas97 wrote:

Having the same problem! Pleas tell me if you find a solution.

See: https://wiki.archlinux.org/title/Downgr … cman_cache or https://aur.archlinux.org/packages/downgrade
I have to downgrade to a working version... haven't done so yet.

Last edited by Nyctfall (Today 06:00:10)

Offline

#4 Today 17:21:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,380

Re: [Wayland] Crash On Screen Capture: obs-studio 31.0.0-1, pipewire 1.2.7

Worksforme™ obs, ffmpeg and KDE from the repos, are you using a custom ffmpeg version? Are the corresponding xdg-desktop-portal installed, do you maybe have a conflict in started xdg portals if you have gnome and KDE installed at the same time? What GPU?

Offline

#5 Today 20:11:33

Nyctfall
Member
Registered: 2023-04-03
Posts: 3

Re: [Wayland] Crash On Screen Capture: obs-studio 31.0.0-1, pipewire 1.2.7

Hi @V1del,
I'm honored to be in the presence of a legendary Archer, hope your day is going well!

According to GitHub user "AngryPenguinPL" on the GitHub obsproject/obs-studio "Crash when initializing PipeWire screen sharing since 31.0.0 (GNOME Wayland) #11617" thread, unfortunately this is an upstream issue.

It's confirmed to be fixed with the upstream patch: GitHub obsproject/obs-studio "libobs-opengl: Avoid trying to allocate 0 byte on Linux #11618", but GitHub obsproject/obs-studio "libobs-opengl: Fix for formats with zero modifiers #11638" looks like a more concise (untested) solution.

Since the only solution is a complete package rebuild and recompilation, I suppose that means this problem should either: 1) be on the GitLab Bug Tracker, or 2) be the reason why (foreshadowing) a potentially borked update in OBS Studio shouldn't be the go to decision made by upstream when they notice more rigorous testing methodologies are needed (see: GitHub obsproject/obs-studio "Memory allocator cleanups #6721" and GitHub obsproject/obs-studio "libobs/util: Crash on bmalloc(0) #11181").

V1del wrote:

are you using a custom ffmpeg version?

Answer: No.
See:

.-(~)---------------------------------------------------------------------------------------------------------------------------(nyctdev@NfArch)-
`--> paclist extra | grep -E "^ffmpeg" 
ffmpeg 2:7.1-3
ffmpeg4.4 4.4.5-1
ffmpegthumbs 24.08.3-2

and

.-(~)---------------------------------------------------------------------------------------------------------------------------(nyctdev@NfArch)-
`--> expac -Qs '%n | %v | %r | %w | Built: %b | Installed: %l | %p | %V' '^ffmpeg\S*$' 
ffmpeg | 2:7.1-3 | local | dependency | Built: Wed Nov 27 12:22:54 2024 | Installed: Mon Dec  9 12:02:41 2024 | Robin Candau <antiz@archlinux.org> | Signature
ffmpeg4.4 | 4.4.5-1 | local | dependency | Built: Thu Oct  3 10:17:59 2024 | Installed: Fri Nov  8 19:06:06 2024 | Maxime Gauduin <alucryd@archlinux.org> | Signature
ffmpegthumbs | 24.08.3-2 | local | dependency | Built: Thu Nov  7 07:38:46 2024 | Installed: Fri Nov  8 19:07:01 2024 | Antonio Rojas <arojas@archlinux.org> | Signature
V1del wrote:

Are the corresponding xdg-desktop-portal installed, do you maybe have a conflict in started xdg portals if you have gnome and KDE installed at the same time?

Answer: Yes. And I am not experienced in identifying conflicts with GNOME and KDE Wayland Portals... but I do not believe that to be the case.
See:

.-(~)---------------------------------------------------------------------------------------------------------------------------(nyctdev@NfArch)-
`--> expac -Qs '%n | %v | %r | %w | Built: %b | Installed: %l | %p | %V | "%M" files modified.' 'portal'
libportal | 0.8.1-1 | local | dependency | Built: Thu Sep  5 07:03:47 2024 | Installed: Fri Oct  4 18:12:38 2024 | Jan Alexander Steffens (heftig) <heftig@archlinux.org> | Signature | "" files modified.
libportal-gtk3 | 0.8.1-1 | local | dependency | Built: Thu Sep  5 07:03:47 2024 | Installed: Fri Oct  4 18:13:29 2024 | Jan Alexander Steffens (heftig) <heftig@archlinux.org> | Signature | "" files modified.
libportal-gtk4 | 0.8.1-1 | local | dependency | Built: Thu Sep  5 07:03:47 2024 | Installed: Fri Oct  4 18:12:38 2024 | Jan Alexander Steffens (heftig) <heftig@archlinux.org> | Signature | "" files modified.
xdg-desktop-portal | 1.18.4-2 | local | dependency | Built: Sat Nov 23 09:35:50 2024 | Installed: Mon Dec  9 21:18:08 2024 | Jan Alexander Steffens (heftig) <heftig@archlinux.org> | Signature | "" files modified.
xdg-desktop-portal-gnome | 47.1-2 | local | dependency | Built: Wed Oct 30 02:36:42 2024 | Installed: Mon Dec  9 21:18:08 2024 | Jan Alexander Steffens (heftig) <heftig@archlinux.org> | Signature | "" files modified.
xdg-desktop-portal-gtk | 1.15.1-2 | local | dependency | Built: Sun Apr 21 17:54:25 2024 | Installed: Mon Dec  9 21:18:08 2024 | Jan Alexander Steffens (heftig) <heftig@archlinux.org> | Signature | "" files modified.
xdg-desktop-portal-kde | 6.2.4-1 | local | dependency | Built: Wed Nov 27 05:53:40 2024 | Installed: Mon Dec  9 21:18:08 2024 | Tomaz Canabrava <tcanabrava@archlinux.org> | Signature | "" files modified.
xdg-desktop-portal-wlr | 0.7.1-1 | local | dependency | Built: Fri Aug  9 02:15:56 2024 | Installed: Mon Dec  9 21:18:08 2024 | Carl Smedstad <carsme@archlinux.org> | Signature | "" files modified.

and

.-(~)---------------------------------------------------------------------------------------------------------------------------(nyctdev@NfArch)-
`--> pacman -Qii libportal xdg-desktop-portal xdg-desktop-portal-kde xdg-desktop-portal-gnome xdg-desktop-portal-gtk xdg-desktop-portal-wlr 
Name            : libportal
Version         : 0.8.1-1
Description     : GIO-style async APIs for most Flatpak portals
Architecture    : x86_64
URL             : https://github.com/flatpak/libportal
Licenses        : LGPL-3.0-only
Groups          : None
Provides        : libportal.so=1-64
Depends On      : gcc-libs  glib2  glibc  libglib-2.0.so=0-64  libgobject-2.0.so=0-64  libgio-2.0.so=0-64
Optional Deps   : libportal-docs: API documentation
                  libportal-gtk3: GTK 3 backend [installed]
                  libportal-gtk4: GTK 4 backend [installed]
                  libportal-qt5: Qt 5 backend
                  libportal-qt6: Qt 6 backend
                  xdg-desktop-portal: Portal service [installed]
Required By     : epiphany  gnome-boxes  gnome-builder  gnome-contacts  gnome-maps  libportal-gtk3  libportal-gtk4  nautilus  totem
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 570.76 KiB
Packager        : Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Build Date      : Thu 05 Sep 2024 07:03:47 AM CDT
Install Date    : Fri 04 Oct 2024 06:12:38 PM CDT
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
Backup Files    : None
Extended Data   : pkgtype=split

Name            : xdg-desktop-portal
Version         : 1.18.4-2
Description     : Desktop integration portals for sandboxed apps
Architecture    : x86_64
URL             : https://flatpak.github.io/xdg-desktop-portal/
Licenses        : LGPL-2.1-or-later
Groups          : None
Provides        : None
Depends On      : fuse3  gcc-libs  gdk-pixbuf2  glib2  glibc  json-glib  libpipewire  pipewire  rtkit  systemd  systemd-libs
Optional Deps   : geoclue: Geolocation portal [installed]
                  xdg-desktop-portal-impl: Portal backends [installed]
Required By     : flatpak  krfb  xdg-desktop-portal-gnome  xdg-desktop-portal-gtk  xdg-desktop-portal-kde  xdg-desktop-portal-wlr
Optional For    : firefox  firefox-developer-edition  libportal  telegram-desktop
Conflicts With  : None
Replaces        : None
Installed Size  : 2.18 MiB
Packager        : Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Build Date      : Sat 23 Nov 2024 09:35:50 AM CST
Install Date    : Mon 09 Dec 2024 09:18:08 PM CST
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
Backup Files    : None
Extended Data   : pkgtype=pkg

Name            : xdg-desktop-portal-kde
Version         : 6.2.4-1
Description     : A backend implementation for xdg-desktop-portal using Qt/KF5
Architecture    : x86_64
URL             : https://kde.org/plasma-desktop/
Licenses        : LGPL-2.0-or-later
Groups          : plasma
Provides        : xdg-desktop-portal-impl
Depends On      : gcc-libs  glibc  kconfig  kcoreaddons  kcrash  kglobalaccel  kiconthemes  ki18n  kio  kio-fuse  kirigami  kitemviews
                  knotifications  kpipewire  kservice  kstatusnotifieritem  kwayland  kwindowsystem  libxkbcommon  plasma-workspace  qt6-base
                  qt6-declarative  qt6-wayland  wayland  xdg-desktop-portal
Optional Deps   : None
Required By     : lutris  plasma-integration  plasma-meta
Optional For    : gnome-calendar  xdg-desktop-portal
Conflicts With  : None
Replaces        : None
Installed Size  : 1535.44 KiB
Packager        : Tomaz Canabrava <tcanabrava@archlinux.org>
Build Date      : Wed 27 Nov 2024 05:53:40 AM CST
Install Date    : Mon 09 Dec 2024 09:18:08 PM CST
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
Backup Files    : None
Extended Data   : pkgtype=pkg

Name            : xdg-desktop-portal-gnome
Version         : 47.1-2
Description     : Backend implementation for xdg-desktop-portal for the GNOME desktop environment
Architecture    : x86_64
URL             : https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome
Licenses        : LGPL-2.1-or-later
Groups          : gnome
Provides        : xdg-desktop-portal-impl
Depends On      : cairo  dconf  fontconfig  gcc-libs  gdk-pixbuf2  glib2  glibc  gnome-desktop-4  graphene  gtk4  libadwaita  libx11  nautilus
                  wayland  xdg-desktop-portal  xdg-desktop-portal-gtk>=1.10.0-2
Optional Deps   : evince: Print previews [installed]
Required By     : gnome-session  lutris
Optional For    : gnome-calendar  xdg-desktop-portal
Conflicts With  : xdg-desktop-portal-gtk<1.10.0-2
Replaces        : xdg-desktop-portal-gtk<1.10.0-2
Installed Size  : 801.69 KiB
Packager        : Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Build Date      : Wed 30 Oct 2024 02:36:42 AM CDT
Install Date    : Mon 09 Dec 2024 09:18:08 PM CST
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
Backup Files    : None
Extended Data   : pkgtype=pkg

Name            : xdg-desktop-portal-gtk
Version         : 1.15.1-2
Description     : A backend implementation for xdg-desktop-portal using GTK
Architecture    : x86_64
URL             : https://github.com/flatpak/xdg-desktop-portal-gtk
Licenses        : LGPL-2.0-or-later
Groups          : None
Provides        : xdg-desktop-portal-impl
Depends On      : fontconfig  gcc-libs  gdk-pixbuf2  glib2  glibc  gsettings-desktop-schemas  gtk3  xdg-desktop-portal
Optional Deps   : evince: Print preview [installed]
Required By     : lutris  xdg-desktop-portal-gnome
Optional For    : gnome-calendar  plasma-workspace  xdg-desktop-portal
Conflicts With  : None
Replaces        : None
Installed Size  : 433.31 KiB
Packager        : Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Build Date      : Sun 21 Apr 2024 05:54:25 PM CDT
Install Date    : Mon 09 Dec 2024 09:18:08 PM CST
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
Backup Files    : None
Extended Data   : pkgtype=pkg

Name            : xdg-desktop-portal-wlr
Version         : 0.7.1-1
Description     : xdg-desktop-portal backend for wlroots
Architecture    : x86_64
URL             : https://github.com/emersion/xdg-desktop-portal-wlr
Licenses        : MIT
Groups          : None
Provides        : xdg-desktop-portal-impl
Depends On      : glibc  libdrm  libinih  libpipewire  mesa  pipewire  pipewire-session-manager  systemd-libs  wayland  xdg-desktop-portal
Optional Deps   : bemenu: to choose which output to screencast using bemenu
                  slurp: to choose which output to screencast using slurp [installed]
                  wofi: to choose which output to screencast using wofi
Required By     : lutris
Optional For    : gnome-calendar  xdg-desktop-portal
Conflicts With  : None
Replaces        : None
Installed Size  : 101.79 KiB
Packager        : Carl Smedstad <carsme@archlinux.org>
Build Date      : Fri 09 Aug 2024 02:15:56 AM CDT
Install Date    : Mon 09 Dec 2024 09:18:08 PM CST
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
Backup Files    : None
Extended Data   : pkgtype=pkg
V1del wrote:

What GPU?

Answer: AMD Radeon RX 580 8GB.
See:

.-(~)---------------------------------------------------------------------------------------------------------------------------(nyctdev@NfArch)-
`--> lspci -kPPd '::03xx'
00:03.1/26:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] (rev e7)
        Subsystem: XFX Pine Group Inc. Radeon RX 580
        Kernel driver in use: amdgpu
        Kernel modules: amdgpu

and

.-(~)---------------------------------------------------------------------------------------------------------------------------(nyctdev@NfArch)-
`--> vainfo              
Trying display: wayland
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Mesa Gallium driver 24.3.1-arch1.3 for AMD Radeon RX 580 Series (radeonsi, polaris10, LLVM 18.1.8, DRM 3.59, 6.12.4-arch1-1)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

Offline

Board footer

Powered by FluxBB