snapcrafters / obs-studio

This is a community-supported modified build of OBS Studio.
https://snapcraft.io/obs-studio
111 stars 37 forks source link

Segfault in obs-studio v27.0.0 2021-06-01 in successive starts #124

Closed q-wertz closed 2 years ago

q-wertz commented 3 years ago

Description

Opening a new issue for the last comments of https://github.com/snapcrafters/obs-studio/issues/117 starting with https://github.com/snapcrafters/obs-studio/issues/117#issuecomment-867657925 by @ilarrain

First start of obs-studio is fine, later ones crash with a Segmentation fault. See last lines of the following log. Difference to a working start is (the qt.qpa.wayland: Wayland does not support QWindow::requestActivate() part does not seem to be the problem)

info: [pipewire] available cursor modes:
info: [pipewire]     - Metadata
info: [pipewire]     - Always visible
info: [pipewire]     - Hidden
info: [pipewire] screencast session created
info: [pipewire] asking for desktop…
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  20 (X_GetProperty)
  Resource id in failed request:  0x0
  Serial number of failed request:  13
  Current serial number in output stream:  13
QObject::killTimer: Timers cannot be stopped from another thread
QObject::~QObject: Timers cannot be stopped from another thread
QObject::~QObject: Timers cannot be stopped from another thread
Segmentation fault

Version

OS: Ubuntu 21.04 (Wayland) obs-studio: latest/stable: 27.0.0 2021-06-01 (1251)

Workaround

My current workaround is to reinstall obs-studio after every usage… Might try hint by @ilarrain https://github.com/snapcrafters/obs-studio/issues/117#issuecomment-867657925

Maybe the issue is also fixed in the new obs-studio version 27.0.1

Log

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
QSocketNotifier: Can only be used with threads started with QThread

(process:240038): Gtk-WARNING **: 09:18:18.245: Locale not supported by C library.
    Using the fallback 'C' locale.

(obs:240038): dbind-WARNING **: 09:18:18.269: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-6nw9vr2A7e: No such file or directory
Attempted path: share/obs/obs-studio/locale/en-US.ini
Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
Attempted path: share/obs/obs-studio/themes/Dark.qss
Attempted path: /usr/share/obs/obs-studio/themes/Dark.qss
info: User enabled --multi flag and is now running multiple instances of OBS.
info: Command Line Arguments: --multi
info: Platform: Wayland
info: CPU Name: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
info: CPU Speed: 2000.000MHz
info: Physical Cores: 4, Logical Cores: 8
info: Physical Memory: 15771MB Total, 5881MB Free
info: Kernel Version: Linux 5.11.0-22-generic
info: Distribution: "Ubuntu Core" "20"
info: Session Type: wayland
info: Portable mode: false
Attempted path: share/obs/obs-studio/themes/Dark/no_sources.svg
Attempted path: /usr/share/obs/obs-studio/themes/Dark/no_sources.svg
QMetaObject::connectSlotsByName: No matching signal for on_tbar_position_valueChanged(int)
QMetaObject::connectSlotsByName: No matching signal for on_actionShowTransitionProperties_triggered()
QMetaObject::connectSlotsByName: No matching signal for on_actionHideTransitionProperties_triggered()
info: OBS 27.0.0-modified (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
    samples per sec: 48000
    speakers:        2
info: ---------------------------------
info: Initializing OpenGL...
info: Using EGL/Wayland
info: Initialized EGL 1.5
info: Loading up OpenGL on adapter Intel Mesa Intel(R) UHD Graphics 620 (KBL GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 20.2.6, shading language 4.60
info: ---------------------------------
info: video settings reset:
    base resolution:   1440x1080
    output resolution: 1440x1080
    downscale filter:  Bicubic
    fps:               30/1
    format:            NV12
    YUV mode:          709/Partial
info: NV12 texture support not available
info: Audio monitoring device:
    name: Default
    id: default
info: ---------------------------------
info: [StreamFX] Loading Version 0.10.0.0-g5888c7d2
info: [StreamFX] Loaded Version 0.10.0.0-g5888c7d2
info: [adv-ss] version: 2ce0b35921be892c987c7dbb5fc90db38f15f0a6
info: [adv-ss] trying '/home/username'
info: [adv-ss] trying '/usr/lib'
info: [adv-ss] trying '/usr/local/lib'
info: [adv-ss] trying '/usr/lib/x86_64-linux-gnu'
info: [adv-ss] trying '/usr/local/opt/curl/lib'
warning: [adv-ss] can't find the curl library
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
info: [Freeze Filter] loaded version 0.3.2
info: [Gradient Source] loaded version 0.1.0
info: [pango]: Loaded system fontconfig
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
info: No blackmagic support
warning: v4l2loopback not installed, virtual camera disabled
info: [linux-vkcapture] plugin loaded successfully (version 0.5)
info: [Move Transition] loaded version 2.4.1
error: Unable to load NvFCB library
warning: Failed to initialize module 'nvfbc.so'
warning: Failed to load 'en-US' text for module: 'obs-audio-pan-filter.so'
info: [obs-audio-pan-filter] plugin loaded successfully (version 0.1.0)
info: [obs-browser]: Version 2.14.3
info: [obs-browser]: CEF Version 87.1.14+ga29e9a3+chromium-87.0.4280.141
error: os_dlopen(libnvidia-encode.so.1->libnvidia-encode.so.1): libnvidia-encode.so.1: cannot open shared object file: No such file or directory

info: FFMPEG VAAPI supported
warning: Failed to load 'en-US' text for module: 'obs-gphoto.so'
info: obs-gstreamer build: 2b6aa8d
info: [obs-ndi] hello ! (version 4.9.1)
info: [obs-ndi] Trying ''
info: [obs-ndi] Trying '/usr/lib'
info: [obs-ndi] Trying '/usr/local/lib'
info: [obs-ndi] Found NDI library at '/usr/local/lib/libndi.so.4'
info: [obs-ndi] NDI runtime loaded successfully
info: [obs-ndi] NDI library initialized successfully (NDI SDK LINUX 18:32:11 Jun 30 2020 4.5.3)
warning: Failed to load 'en-US' text for module: 'obs-vnc.so'
info: [obs-vnc] plugin loaded successfully (version 0.3.1)
info: [obs-websocket] you can haz websockets (version 4.9.0)
info: [obs-websocket] qt version (compile-time): 5.15.2 ; qt version (run-time): 5.15.2
info: [obs-websocket] module loaded!
info: [Replay Source] loaded version 1.6.8
info: [Source Copy] loaded version 0.1.1
info: [Source Record] loaded version 0.1.4
info: [Source Switcher] loaded version 0.3.0
info: [spectralizer] Loading v1.3.2 build time 2021.06.01 21:48
info: [TimeWarpScan] loaded version 0.1.6
info: [Transition Table] loaded version 0.2.0
info: VLC found, VLC video source enabled
info: ---------------------------------
info:   Loaded Modules:
info:     vlc-video.so
info:     transition-table.so
info:     time-warp-scan.so
info:     text-freetype2.so
info:     spectralizer.so
info:     source-switcher.so
info:     source-record.so
info:     source-copy.so
info:     sndio.so
info:     rtmp-services.so
info:     replay-source.so
info:     recursion-effect.so
info:     obs-x264.so
info:     obs-websocket.so
info:     obs-vst.so
info:     obs-vnc.so
info:     obs-transitions.so
info:     obs-rtspserver.so
info:     obs-rgb-levels-filter.so
info:     obs-outputs.so
info:     obs-ndi.so
info:     obs-libfdk.so
info:     obs-gstreamer.so
info:     obs-gphoto.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     obs-browser.so
info:     obs-audio-pan-filter.so
info:     nvfbc.so
info:     move-transition.so
info:     linux-vkcapture.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-jack.so
info:     linux-decklink.so
info:     linux-capture.so
info:     linux-alsa.so
info:     libtext-pango.so
info:     image-source.so
info:     gradient-source.so
info:     frontend-tools.so
info:     freeze-filter.so
info:     dynamic-delay.so
info:     dvd-screensaver.so
info:     downstream-keyer.so
info:     dir-watch-media.so
info:     decklink-ouput-ui.so
info:     decklink-captions.so
info:     advanced-scene-switcher.so
info:     StreamFX.so
info: ---------------------------------
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'pulseaudio 14.2'
info: pulse-input: Audio format: s16le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.usb-DisplayLink_ThinkPad_Hybrid_USB-C_with_USB-A_Dock_10014157-02.analog-stereo.monitor'
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'pulseaudio 14.2'
info: pulse-input: Audio format: s16le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.usb-DisplayLink_ThinkPad_Hybrid_USB-C_with_USB-A_Dock_10014157-02.iec958-stereo'
info: [Loaded global audio device]: 'Mic/Aux'
info: PipeWire initialized (sender name: 1_3240)
info: pulse-input: Server name: 'pulseaudio 14.2'
error: pulse-input: An error occurred while getting the source info!
info: Switched to scene 'Scene'
info: [adv-ss] trying to reconnect to  in 10 seconds.
info: ------------------------------------------------
info: [adv-ss] started
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Audio Input Capture (PulseAudio)' (pulse_input_capture)
info:     - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source)
info: ------------------------------------------------
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Attempted path: share/obs/obs-studio/images/overflow.png
Attempted path: /usr/share/obs/obs-studio/images/overflow.png
info: [pipewire] available cursor modes:
info: [pipewire]     - Metadata
info: [pipewire]     - Always visible
info: [pipewire]     - Hidden
info: [pipewire] screencast session created
info: [pipewire] asking for desktop…
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  20 (X_GetProperty)
  Resource id in failed request:  0x0
  Serial number of failed request:  13
  Current serial number in output stream:  13
QObject::killTimer: Timers cannot be stopped from another thread
QObject::~QObject: Timers cannot be stopped from another thread
QObject::~QObject: Timers cannot be stopped from another thread
Segmentation fault
WarmUpTill commented 2 years ago

This issue is probably related to the advanced scene switcher or the built-in scene switcher of obs-studio. Both attempt to get the current foreground window, but fail to do so on wayland systems. For the advanced scene switcher I have fixed the crash with https://github.com/WarmUpTill/SceneSwitcher/commit/a467dffd052a4aa8a907dfed4db7d28c1612e129.

flexiondotorg commented 2 years ago

OBS Studio 27.0.1 is released to the stable channel (revision 1258) which fixes this issue.