occ-ai/obs-backgroundremoval

Core dump on OBS startup with v1.1.6

Drizzt321 opened this issue · 25 comments

Describe the bug

OBS-Studio core dumps during startup

To Reproduce
Debian 12.1, all up to date, KDE Plasma.

I did have it work a few weeks ago when I first installed v1.1.5, don't think any major libraries have been updated/installed, but I could be wrong.

Steps to reproduce the behavior:

Startup OBS from the command line. I had 1.1.5 installed, uninstalled that and installed the latest .deb, still same thing.

$ obs --verbose
QSocketNotifier: Can only be used with threads started with QThread
debug: Found portal inhibitor
debug: Attempted path: share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: share/obs/obs-studio/locale.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale.ini
debug: Attempted path: share/obs/obs-studio/themes/Yami.qss
debug: Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Command Line Arguments: --verbose
info: Platform: Wayland
info: CPU Name: AMD Ryzen 7 5800X3D 8-Core Processor
info: CPU Speed: 3549.195MHz
info: Physical Cores: 8, Logical Cores: 16
info: Physical Memory: 96497MB Total, 4553MB Free
info: Kernel Version: Linux 6.1.0-12-amd64
info: Distribution: "Debian GNU/Linux" "12"
info: Session Type: wayland
info: Qt Version: 5.15.8 (runtime), 5.15.8 (compiled)
info: Portable mode: false
debug: Attempted path: share/obs/obs-studio/themes/Dark/no_sources.svg
debug: Attempted path: /usr/share/obs/obs-studio/themes/Dark/no_sources.svg
QMetaObject::connectSlotsByName: No matching signal for on_tbar_position_valueChanged(int)
info: OBS 29.0.2.1-1+b1 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
        samples per sec: 48000
        speakers:        2
        max buffering:   960 milliseconds
        buffering type:  dynamically increasing
info: ---------------------------------
info: Initializing OpenGL...
info: Using EGL/Wayland
info: Initialized EGL 1.5
debug: Supported EGL Extensions: EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_EXT_buffer_age EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_EXT_present_opaque EGL_EXT_swap_buffers_with_damage EGL_IMG_context_priority EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_context_flush_control EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image_base EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_KHR_swap_buffers_with_damage EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_MESA_query_driver EGL_WL_bind_wayland_display EGL_WL_create_wayland_buffer_from_image 
info: Loading up OpenGL on adapter AMD AMD Radeon Graphics (gfx1100, LLVM 15.0.6, DRM 3.49, 6.1.0-12-amd64)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 22.3.6, shading language 4.60
info: ---------------------------------
info: video settings reset:
        base resolution:   1920x1080
        output resolution: 1920x1080
        downscale filter:  Bicubic
        fps:               60/1
        format:            NV12
        YUV mode:          Rec. 709/Partial
info: NV12 texture support not available
info: P010 texture support not available
info: Audio monitoring device:
        name: Default
        id: default
info: ---------------------------------
debug: ---------------------------------
debug: Loading module: decklink-captions.so
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
debug: ---------------------------------
debug: Loading module: decklink-output-ui.so
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
debug: ---------------------------------
debug: Loading module: decklink.so
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
warning: Failed to initialize module 'decklink.so'
debug: ---------------------------------
debug: Loading module: frontend-tools.so
debug: ---------------------------------
debug: Loading module: image-source.so
debug: ---------------------------------
debug: Loading module: linux-alsa.so
debug: ---------------------------------
debug: Loading module: linux-capture.so
debug: ---------------------------------
debug: Loading module: linux-jack.so
debug: ---------------------------------
debug: Loading module: linux-pipewire.so
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
info: [pipewire]     - Window capture
debug: ---------------------------------
debug: Loading module: linux-pulseaudio.so
debug: ---------------------------------
debug: Loading module: linux-v4l2.so
debug: ---------------------------------
debug: Loading module: obs-backgroundremoval.so
info: [obs-backgroundremoval] Plugin loaded successfully (version 1.1.6)
info: [obs-backgroundremoval] Latest release is 
QWidget: Must construct a QApplication before a QWidget
Aborted (core dumped)

OBS 29.0.2 is not supported. Please update your OBS installation to the latest one.

debug: Found portal inhibitor
debug: Attempted path: share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: share/obs/obs-studio/locale.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale.ini
debug: Attempted path: share/obs/obs-studio/locale/zh-CN.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/zh-CN.ini
info: Using preferred locale 'zh-CN'
debug: Attempted path: share/obs/obs-studio/themes/Yami.qss
debug: Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Command Line Arguments: --verbose
info: Using EGL/X11
info: CPU Name: Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
info: CPU Speed: 3299.859MHz
info: Physical Cores: 4, Logical Cores: 8
info: Physical Memory: 15648MB Total, 8260MB Free
info: Kernel Version: Linux 6.5.0-kali1-amd64
info: Distribution: "Kali GNU/Linux" "2023.3"
info: Desktop Environment: dwm
info: Session Type: x11
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.21.1
debug: found alternate keycode 62 for OBS_KEY_SHIFT which already has keycode 50
debug: found alternate keycode 94 for OBS_KEY_BACKSLASH which already has keycode 51
debug: found alternate keycode 129 for OBS_KEY_NUMPERIOD which already has keycode 91
debug: found alternate keycode 190 for OBS_KEY_REDO which already has keycode 137
debug: found alternate keycode 208 for OBS_KEY_VK_MEDIA_PLAY_PAUSE which already has keycode 172
debug: found alternate keycode 215 for OBS_KEY_VK_MEDIA_PLAY_PAUSE which already has keycode 172
debug: found alternate keycode 218 for OBS_KEY_PRINT which already has keycode 107
debug: found alternate keycode 231 for OBS_KEY_CANCEL which already has keycode 136
info: Qt Version: 5.15.10 (runtime), 5.15.10 (compiled)
info: Portable mode: false
debug: Attempted path: share/obs/obs-studio/themes/Dark/no_sources.svg
debug: Attempted path: /usr/share/obs/obs-studio/themes/Dark/no_sources.svg
QMetaObject::connectSlotsByName: Connecting slot on_transitionDuration_valueChanged() with the first of the following compatible signals: ("valueChanged(int)", "valueChanged(QString)")
info: OBS 29.1.3.1-2 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
        samples per sec: 48000
        speakers:        2
        max buffering:   960 milliseconds
        buffering type:  dynamically increasing
info: ---------------------------------
info: Initializing OpenGL...
debug: Created EGLDisplay 0x56259bb149a0
info: Loading up OpenGL on adapter Intel Mesa Intel(R) UHD Graphics (CML GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 23.1.7-1, shading language 4.60
info: ---------------------------------
info: video settings reset:
        base resolution:   1920x1080
        output resolution: 1280x720
        downscale filter:  Bicubic
        fps:               30/1
        format:            NV12
        YUV mode:          Rec. 709/Partial
info: NV12 texture support not available
info: P010 texture support not available
info: Audio monitoring device:
        name: 默认        id: default
info: ---------------------------------
debug: ---------------------------------
debug: Loading module: decklink-captions.so
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
debug: ---------------------------------
debug: Loading module: decklink-output-ui.so
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
debug: ---------------------------------
debug: Loading module: decklink.so
libDeckLinkAPI.so: 无法打开共享对象文件: 没有那个文件或目录warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
warning: Failed to initialize module 'decklink.so'
debug: ---------------------------------
debug: Loading module: frontend-tools.so
debug: ---------------------------------
debug: Loading module: image-source.so
debug: ---------------------------------
debug: Loading module: linux-alsa.so
debug: ---------------------------------
debug: Loading module: linux-capture.so
debug: ---------------------------------
debug: Loading module: linux-jack.so
debug: ---------------------------------
debug: Loading module: linux-pipewire.so
info: [pipewire] No captures available
debug: ---------------------------------
debug: Loading module: linux-pulseaudio.so
debug: ---------------------------------
debug: Loading module: linux-v4l2.so
debug: ---------------------------------
debug: Loading module: obs-backgroundremoval.so
info: [obs-backgroundremoval] Plugin loaded successfully (version 1.1.6)
info: [obs-backgroundremoval] Latest release is 
QWidget: Must construct a QApplication before a QWidget
[1]    235507 IOT instruction (core dumped)  obs --verbose

Same issue, OBS 29.1.3.1-2.

We don't support Qt5.

So... not works on default obs of debian12.

Yes, we only support official OBS

Yes, we only support official OBS

This IS OBS, although I'll agree Debian doesn't necessarily have current stable OBS release in it's repo. Sad, but I do understand only supporting current stable OBS as per their own source tree.

I suppose I could go ahead and use OBS flatpak, I'll consider and see.

Why would v1.1.5 fail to work when it did before though?

Our feature enhancement got to require Qt6

Qt5 support will be dropped after OBS 30 so we aren't going to support Qt5 again.

@umireon it's just strange, I had 1.1.5 working fine 3 weeks ago when I first downloaded it, but then end of last week when I went to start up OBS Studio, it started core dumping. Maybe OBS had a minor version update in Debian that I updated to, but since obs-backgroundremoval isn't in the Debian repos, that wouldn't have been updated.

This is because 1.1.6 was released. When a newer version of our plugin is released, our plugin tries to show the dialog that recommends downloading the latest version. This dialog is not compatible with Qt5 so showing the update dialog results in coredump.

@umireon Ohhhh, ok. That makes sense, although maybe it'd be better to have some sort of debug/error message, and a way to configure that off so I could still use v1.1.5, even with 1.1.6 having been released? Or at least have some consideration for this sort of thing for future versions, at least, so that folks like me that use Debian that are often a bit behind current stable OBS can still use older versions of plugins that working acceptably fine as things are.

@umireon awesome!

I made sure to do apt purge, and fresh unzip and install from the .deb contained within, but still getting the core dump.

I see a debug symbol .ddeb file, should that be .deb and should I install it?

debug: ---------------------------------
debug: Loading module: frontend-tools.so
debug: ---------------------------------
debug: Loading module: image-source.so
debug: ---------------------------------
debug: Loading module: linux-alsa.so
debug: ---------------------------------
debug: Loading module: linux-capture.so
debug: ---------------------------------
debug: Loading module: linux-jack.so
debug: ---------------------------------
debug: Loading module: linux-pipewire.so
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
info: [pipewire]     - Window capture
debug: ---------------------------------
debug: Loading module: linux-pulseaudio.so
debug: ---------------------------------
debug: Loading module: linux-v4l2.so
debug: ---------------------------------
debug: Loading module: obs-backgroundremoval.so
info: [obs-backgroundremoval] Plugin loaded successfully (version 1.1.6)
info: [obs-backgroundremoval] Latest release is 
QWidget: Must construct a QApplication before a QWidget
Aborted (core dumped)

The err message actually is a more of help
The update function runs potentially before the main obs window was constructed
So we need a delay of sorts or bail if we can't get the main window through the obs frontend api
@umireon

I will try the Debian environment later.

Having the same issue.

Would it be possible to disable this update dialog if it is the sole reason for crashing obs?

  • For example with command line options or somehow else?
  • Or is there some other kind of workaround?

to summarize:

@adaptive-shield-matrix @Drizzt321 can y'all check the artifcats on #469 plz? i changed some things to make the updated more robust
tested on ubuntu 22.04 - works for me without crash

trying it to build

git clone https://github.com/obs-ai/obs-backgroundremoval
git fetch origin pull/469/head:roy.fix_updater_crash
git checkout roy.fix_updater_crash
./.github/scripts/build-linux

build is interrupted by missing add-apt-repository

❯ ./.github/scripts/build-linux
   =>   Check Linux build requirements
   =>   Installing obs-studio build dependencies...
sudo: add-apt-repository: command not found

I guess the build process is only working on Ubuntu and is not meant to be run/build on any other Linux distribution.

  • Is where something else that can be done (besides installing Ubuntu) ?
  • Is where some already build image that can be downloaded and run to be tested by us?
  • Or how are we meant to be able to test this new version?

@adaptive-shield-matrix There's no need to build
The CI system creates binaries for you, called "artifacts"

https://github.com/obs-ai/obs-backgroundremoval/actions/runs/6452001120#artifacts

Download the Linux ones and test them out just like a regular release

I tried installing the obs plugin manually

I can't find obs in the list of effects
#468 (comment)

Have I extracted the files in the right directory ?
It feels like they are in the wrong place, because obs does not seem to load / list the background-removal-plugin

cd ~/.config/obs-studio/
fd .
basic/
basic/profiles/
basic/profiles/Untitled/
basic/profiles/Untitled/basic.ini
basic/scenes/
basic/scenes/Untitled.json
basic/scenes/Untitled.json.bak
global.ini
logs/
logs/2023-10-07 09-28-19.txt
logs/2023-10-07 09-28-34.txt
logs/2023-10-07 09-48-25.txt
logs/2023-10-07 10-00-41.txt
logs/2023-10-09 19-59-25.txt
logs/2023-10-09 20-01-46.txt
logs/2023-10-09 20-02-23.txt
logs/2023-10-09 20-04-14.txt
logs/2023-10-09 20-09-00.txt
logs/2023-10-09 20-25-07.txt
plugin_config/
plugin_config/rtmp-services/
plugin_config/rtmp-services/meta.json
plugin_config/rtmp-services/package.json
plugin_config/rtmp-services/services.json
plugin_config/rtmp-services/twitch_ingests.json
plugin_config/text-freetype2/
plugins/
plugins/obs-backgroundremoval/
plugins/obs-backgroundremoval/config.json
plugins/obs-backgroundremoval/effects/
plugins/obs-backgroundremoval/effects/blend_images.effect
plugins/obs-backgroundremoval/effects/kawase_blur.effect
plugins/obs-backgroundremoval/effects/mask_alpha_filter.effect
plugins/obs-backgroundremoval/libonnxruntime.so.1.16.0
plugins/obs-backgroundremoval/libonnxruntime_providers_cuda.so
plugins/obs-backgroundremoval/libonnxruntime_providers_shared.so
plugins/obs-backgroundremoval/libonnxruntime_providers_tensorrt.so
plugins/obs-backgroundremoval/locale/
plugins/obs-backgroundremoval/locale/ar-EG.ini
plugins/obs-backgroundremoval/locale/bn-IN.ini
plugins/obs-backgroundremoval/locale/en-US.ini
plugins/obs-backgroundremoval/locale/es-SP.ini
plugins/obs-backgroundremoval/locale/fr-FR.ini
plugins/obs-backgroundremoval/locale/hi-IN.ini
plugins/obs-backgroundremoval/locale/it-IT.ini
plugins/obs-backgroundremoval/locale/ja-JP.ini
plugins/obs-backgroundremoval/locale/ko-KR.ini
plugins/obs-backgroundremoval/locale/pt-BR.ini
plugins/obs-backgroundremoval/locale/ru-RU.ini
plugins/obs-backgroundremoval/locale/ta-IN.ini
plugins/obs-backgroundremoval/locale/tr-TR.ini
plugins/obs-backgroundremoval/locale/zh-CN.ini
plugins/obs-backgroundremoval/models/
plugins/obs-backgroundremoval/models/SINet_Softmax_simple.onnx
plugins/obs-backgroundremoval/models/mediapipe.onnx
plugins/obs-backgroundremoval/models/pphumanseg_fp32.onnx
plugins/obs-backgroundremoval/models/rvm_mobilenetv3_fp32.onnx
plugins/obs-backgroundremoval/models/selfie_segmentation.onnx
plugins/obs-backgroundremoval/models/semantic_guided_llie_180x324.onnx
plugins/obs-backgroundremoval/models/tbefn_fp32.onnx
plugins/obs-backgroundremoval/models/tcmonodepth_tcsmallnet_192x320.onnx
plugins/obs-backgroundremoval/models/uretinex_net_180x320.onnx
plugins/obs-backgroundremoval/models/zero_dce_180x320.onnx
plugins/obs-backgroundremoval.so
profiler_data/
profiler_data/2023-05-10 15-17-17.csv.gz
profiler_data/2023-10-07 08-52-27.csv.gz
profiler_data/2023-10-07 09-10-20.csv.gz
profiler_data/2023-10-07 09-48-25.csv.gz
profiler_data/2023-10-07 10-00-41.csv.gz
profiler_data/2023-10-09 19-59-25.csv.gz
profiler_data/2023-10-09 20-01-46.csv.gz
profiler_data/2023-10-09 20-02-23.csv.gz
profiler_data/2023-10-09 20-04-14.csv.gz
profiler_data/2023-10-09 20-09-00.csv.gz
profiler_data/2023-10-09 20-25-07.csv.gz

@adaptive-shield-matrix thanks , this actually looks OK(-ish)
can we have a peek at the logs? do you see the plugin .so detected by OBS?

@royshil works for me!

@adaptive-shield-matrix so I actually had to list the files in the original .deb to figure it out. From the extracted zip/xv, the .so & dir from lib/x86_64-linux-gnu/obs-plugins goes into the system /usr/lib/x86_64-linux-gnu/obs-plugins, and the dir within share/obs/obs-plugins goes into the system /usr/share/obs/obs-plugins. I don't think putting them into the ~/.config is sufficient, although there might be some dirs that maybe could be created in there, I'd have to read through the OBS dot file information.

@royshil works for me!

@adaptive-shield-matrix so I actually had to list the files in the original .deb to figure it out. From the extracted zip/xv, the .so & dir from lib/x86_64-linux-gnu/obs-plugins goes into the system /usr/lib/x86_64-linux-gnu/obs-plugins, and the dir within share/obs/obs-plugins goes into the system /usr/share/obs/obs-plugins. I don't think putting them into the ~/.config is sufficient, although there might be some dirs that maybe could be created in there, I'd have to read through the OBS dot file information.

The instructions work me as well.
The plugin no longer crashes for me as well.
Good work!

boom! we squashed this bug 🐛
i need this little win today. thank you @adaptive-shield-matrix @Drizzt321

implemented, closing