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
57.8k stars 7.74k forks source link

Segmentation fault when switching off a scene that contains a VLC Video Source playing Subtitles. #8166

Open Baa14453 opened 1 year ago

Baa14453 commented 1 year ago

Operating System Info

Ubuntu 22.04

OBS Studio Version

29.0.0

OBS Studio Log URL

https://obsproject.com/logs/XduMPo1FucI2nakF

OBS Studio Crash Log URL

https://obsproject.com/logs/XduMPo1FucI2nakF

Expected Behavior

OBS switches scenes.

Current Behavior

OBS crashed while switching scenes.

Steps to Reproduce

  1. Create two scenes, one contains nothing, the other contains a single VLC Video Source
  2. Have the VLC Video Source play a file that contains embedded text subtitles.
  3. Once the subtitles have displayed, switch to the blank scene. OBS will freeze indefinitely or seg-fault. ...

Anything else we should know?

I updated from OBS 27 to 29 today and also switch from the Snap install to the Apt install at the same time, this only started occurring when I did that. I have a core dump not sure if you need it or where to upload it. Example video file I'm having trouble with is attached here, it has multiple embedded fonts which could contribute to the issue possibly. trigun2.zip

kkartaltepe commented 1 year ago

I cannot replicate this, please provide a backtrace from gdb if you are able to get obs to segfault. If you have a coredump you can provide the backtrace from that.

Baa14453 commented 1 year ago

I just updated VLC from 3.0.16 to 3.0.18 using these community PPAs:

  sudo add-apt-repository ppa:savoury1/ffmpeg4
  sudo add-apt-repository ppa:savoury1/vlc3.

More info here: https://launchpad.net/~savoury1/+archive/ubuntu/vlc3

This seems to have resolved the problem, I'm not sure if it was VLC or one of the many libraries that this PPA provides that fixed the problem. VLC 3.0.16 is the default version with Ubuntu 22.04

Baa14453 commented 1 year ago

I cannot replicate this, please provide a backtrace from gdb if you are able to get obs to segfault. If you have a coredump you can provide the backtrace from that.

#0  0x00007ff0005b7344 in  () at /lib/x86_64-linux-gnu/libvlccore.so.9
#1  0x00007fef4c00b070 in  ()
#2  0x00007fef4c013780 in  ()
#3  0x00007fef4c00b120 in  ()
#4  0x00007ff0005bd5c9 in var_AddListCallback () at /lib/x86_64-linux-gnu/libvlccore.so.9
#5  0x00007fef3c0a0610 in  ()
#6  0x0000556b0f591d70 in  ()
#7  0x00007fefffbd492a in  () at /usr/lib/x86_64-linux-gnu/vlc/plugins/codec/liblibass_plugin.so
#8  0x00007fefffbd4e12 in  () at /usr/lib/x86_64-linux-gnu/vlc/plugins/codec/liblibass_plugin.so
#9  0x00007fef3c09ffd0 in  ()
#10 0x00007ff0005c7a9c in  () at /lib/x86_64-linux-gnu/libvlccore.so.9
#11 0x0000000000000000 in  ()
kkartaltepe commented 1 year ago

This doesnt look like our bug, and we cannot support alternative dependencies to those provided by base ubuntu. So if you use ppa's for obs dependencies like vlc there is nothing we can do.

Baa14453 commented 1 year ago

This doesnt look like our bug, and we cannot support alternative dependencies to those provided by base ubuntu. So if you use ppa's for obs dependencies like vlc there is nothing we can do.

I agree this looks like a VLC bug, but it occurred when I was using the default dependencies that came with Ubuntu 22 so this may occur again.

Baa14453 commented 1 year ago

@kkartaltepe Please re-open this issue so it can be investigated. There is no officially supported configuration in Ubuntu 22.04 where OBS can use the VLC Video Player without encountering this bug. In a fresh installation of Ubuntu 22.04 fully updated, installing the obs-studio and vlc apt packages will encounter this bug.

Official Supported VLC Installation Methods for Ubuntu 22.04
 - Apt version 3.0.16
 - Snap version 3.0.18

Officially Supported OBS Installation Methods for Ubuntu 22.04
 - Apt version 29.0.2

Unofficial OBS Installation Methods:
 - Snap version 27

Unofficial VLC Installation Methods:
 - Apt through 3rd party PPA (3.0.19) (Now behind some kind of paywall idk)

The apt installation of VLC encounters this bug. OBS can't work with the official VLC Snap or Appimage, I've run out of options :(

The Snap version of OBS included VLC inside the snap, it was really good, but support was dropped in favour of AppImage, which doesn't include the VLC dependencies inside.

kkartaltepe commented 1 year ago

We dont support apimage, so im not sure where you are getting the claim that it is officially supported. If someone else can confirm this happens with vlc from ubuntu's repos we can reopen this.

Baa14453 commented 1 year ago

We dont support apimage, so im not sure where you are getting the claim that it is officially supported. If someone else can confirm this happens with vlc from ubuntu's repos we can reopen this.

Oh sorry I've removed the appimage reference, it wasn't relevant anyway. I don't know anyone else using Ubuntu to ask them to test this, but if you try it in a virtual machine as I did today you'll get the same results. If you have anyone you can ask to help test please do

kkartaltepe commented 1 year ago
Thread 23 "libobs: graphic" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff9cff9640 (LWP 6969)]
___pthread_mutex_lock (mutex=0x90752c8a69152464) at ./nptl/pthread_mutex_lock.c:80
80    ./nptl/pthread_mutex_lock.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  ___pthread_mutex_lock (mutex=0x90752c8a69152464)
    at ./nptl/pthread_mutex_lock.c:80
#1  0x00007fff67d9f5b1 in  () at /lib/x86_64-linux-gnu/libvlccore.so.9
#2  0x00007fff0c65492a in  ()
    at /usr/lib/x86_64-linux-gnu/vlc/plugins/codec/liblibass_plugin.so
#3  0x00007fff0c654e12 in  ()
    at /usr/lib/x86_64-linux-gnu/vlc/plugins/codec/liblibass_plugin.so
#4  0x00007fff67da9a9c in subpicture_Delete ()
    at /lib/x86_64-linux-gnu/libvlccore.so.9
#5  0x00007fff67d71978 in spu_Destroy ()
    at /lib/x86_64-linux-gnu/libvlccore.so.9
#6  0x00007fff67d771e2 in vout_Close ()
    at /lib/x86_64-linux-gnu/libvlccore.so.9
#7  0x00007fff67d574df in input_resource_TerminateVout ()
    at /lib/x86_64-linux-gnu/libvlccore.so.9
#8  0x00007fff73e8222b in libvlc_media_player_stop ()
    at /usr/lib/x86_64-linux-gnu/libvlc.so.5
#9  0x00007fff73e868e3 in libvlc_media_list_player_stop ()
    at /usr/lib/x86_64-linux-gnu/libvlc.so.5
#10 0x00007fff7893e30f in  ()
    at /usr//lib/x86_64-linux-gnu/obs-plugins/vlc-video.so
#11 0x00007ffff696a213 in obs_source_video_tick ()
    at /usr/lib/x86_64-linux-gnu/libobs.so.0
Baa14453 commented 1 year ago

Thank you

Baa14453 commented 1 year ago

We can get OBS to use the Snap version of the VLC libraries by linking them:

sudo ln -s '/snap/vlc/current/usr/lib/libvlccore.so' /lib/x86_64-linux-gnu/libvlccore.so.9
sudo ln -s '/snap/vlc/current/usr/lib/libvlc.so' /lib/x86_64-linux-gnu/libvlc.so.5
sudo ln -s '/snap/vlc/current/lib/x86_64-linux-gnu/libidn.so.11' /lib/x86_64-linux-gnu/libidn.so.11

This seems to be working well for me as a workaround. info: [vlc-video]: VLC 3.0.18 Vetinari found, VLC video source enabled

ogmkp commented 1 year ago

Can't replicate the issue on OBS 29.1.3, Debian 12, info: [vlc-video]: VLC 3.0.18 Vetinari found, VLC video source enabled.

Baa14453 commented 1 year ago

Can't replicate the issue on OBS 29.1.3, Debian 12, info: [vlc-video]: VLC 3.0.18 Vetinari found, VLC video source enabled.

VLC 3.0.18 seems to have resolved the issue, but this version isn't available in the LTS version of Ubuntu through supported installation methods (apt), which is the main reason this is notable right now. Presumably, any distro that has access to version 3.0.18 or higher will be OK

ogmkp commented 1 year ago

For documentation, maybe this ? https://code.videolan.org/videolan/vlc/-/issues/26865

Baa14453 commented 1 year ago

For documentation, maybe this ? https://code.videolan.org/videolan/vlc/-/issues/26865

For me this occurs with VLC 3.0.16 which this issue suggests it doesn't affect