pi-apps icon indicating copy to clipboard operation
pi-apps copied to clipboard

OBS Studio crashes without error message when Twitch stream starts.

Open Bastlerstube opened this issue 1 year ago • 23 comments

Confirmations

  • [X] I searched for similar bug reports in https://github.com/Botspot/pi-apps/issues and found none were relevant.
  • [X] I tried updating Pi Apps and the issue is still not fixed. How to update Pi Apps?

What happened?

OBS crashes without error message when Twitch stream starts.

Description

Tested with updated Bullseye 32Bit and 64Bit version, same behavior with both.

What is your operating system?

2022-04-04-raspios-bullseye-armhf.img.xz

(Optional) Error log? Terminal output? Debug messages?

22:46:40.751: [rtmp stream: 'simple_stream'] Connecting to RTMP URL rtmp://live-ber.twitch.tv/app...
<--- is the last entry in the log file and then the crash occurs...

Bastlerstube avatar Jul 23 '22 13:07 Bastlerstube

Hello there 👋 Thanks for submitting your first issue to the Pi-Apps project! We'll try to get back to you as soon as possible. In the meantime, we encourage you join our Discord server, where you can ask any questions you might have.

github-actions[bot] avatar Jul 23 '22 13:07 github-actions[bot]

can't reproduce on bionic debs (streaming to twitch works fine there on switch)

@ryanfortner needs testing on your debs

theofficialgman avatar Jul 23 '22 18:07 theofficialgman

@Bastlerstube, Could you try running OBS in a terminal to see if there are additional messages that were not caught in the log file?

Botspot avatar Jul 26 '22 14:07 Botspot

I just tried running OBS Studio in the terminal and had it set to keep the terminal window open.

Unfortunately, both crash as soon as I start the stream.

Since I forgot to plug in the network cable the first time I tested it, it couldn't connect to the Twitch server and gave me an error message.

However, as soon as there is internet connection, it crashes without any hints.

Bastlerstube avatar Jul 26 '22 17:07 Bastlerstube

To keep the terminal running after OBS crashes, this time open a terminal, type obs, and press Enter.

Botspot avatar Jul 26 '22 18:07 Botspot

I tried again, thanks for the tip and got the following error message:

/usr/bin/obs: Zeile 2: 8271 Speicherzugriffsfehler LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libGL.so MESA_GL_VERSION_OVERRIDE=3.3 /usr/bin/obs-exec "$@"

Bastlerstube avatar Jul 26 '22 19:07 Bastlerstube

Could you run obs again, this time with the english locale?

Like this:

export LANG="en_US.UTF-8"
export LANGUAGE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
obs

(You can copy and paste all of these commands into the terminal at the same time)

Botspot avatar Jul 26 '22 19:07 Botspot

same problem, but new error message...

/usr/bin/obs: line 2: 8557 Segmentation fault LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libGL.so MESA_GL_VERSION_OVERRIDE=3.3 /usr/bin/obs-exec "$@"

Bastlerstube avatar Jul 26 '22 19:07 Bastlerstube

@Bastlerstube How much RAM do you have? The error is about memory, although on RPis it usually doesn't mean that..

Crilum avatar Jul 26 '22 19:07 Crilum

same problem, but new error message...

/usr/bin/obs: line 2: 8557 Segmentation fault LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libGL.so MESA_GL_VERSION_OVERRIDE=3.3 /usr/bin/obs-exec "$@"

I'm surprised there was not any more output than that. Okay, in that same terminal that you ran those export commands in, try running strace obs. If it says "strace: command not found", install it with sudo apt install strace

Strace will display all system calls that a program makes. It generates a lot of output, but in the case of a segmentation fault, usually the end of the output contains a clue to the problem, if there is a clue anywhere. Once you run strace on obs and get the crash, copy out around the last 20 lines of output and post them here.

Botspot avatar Jul 26 '22 19:07 Botspot

I had tried all the time with the Raspberry Pi with 4GB Ram.

For testing I have now used the Raspberry Pi with 8GB Ram, but also the same error.

error message:

/usr/bin/obs: line 2: 1220 Segmentation fault LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libGL.so MESA_GL_VERSION_OVERRIDE=3.3 /usr/bin/obs-exec "$@"

Bastlerstube avatar Jul 26 '22 19:07 Bastlerstube

error message:

/usr/bin/obs: line 2: 1220 Segmentation fault LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libGL.so MESA_GL_VERSION_OVERRIDE=3.3 /usr/bin/obs-exec "$@"

Was that error message with you running strace obs, or just obs?

Botspot avatar Jul 26 '22 19:07 Botspot

Output after strace obs:

info: [rtmp stream: 'simple_stream'] Connecting to RTMP URL rtmp://live-ber.twitch.tv/app... [{WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV}], 0, NULL) = 1772 rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, {sa_handler=0x557561ee64, sa_mask=[], sa_flags=0}, 8) = 0 ioctl(2, TIOCGWINSZ, {ws_row=24, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 newfstatat(AT_FDCWD, "/home/pi/.terminfo", 0x55b502bdd0, 0) = -1 ENOENT (No such file or directory) newfstatat(AT_FDCWD, "/etc/terminfo", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0 newfstatat(AT_FDCWD, "/lib/terminfo", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0 newfstatat(AT_FDCWD, "/usr/share/terminfo", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0 faccessat(AT_FDCWD, "/etc/terminfo/x/xterm-256color", R_OK) = -1 ENOENT (No such file or directory) faccessat(AT_FDCWD, "/lib/terminfo/x/xterm-256color", R_OK) = 0 openat(AT_FDCWD, "/lib/terminfo/x/xterm-256color", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=3790, ...}) = 0 read(3, "\36\2%\0&\0\17\0\235\1\34\6xterm-256color|xterm"..., 32768) = 3790 read(3, "", 28672) = 0 close(3) = 0 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TIOCGWINSZ, {ws_row=24, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0 ioctl(0, TIOCGWINSZ, {ws_row=24, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0 brk(0x55b5059000) = 0x55b5059000 openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=2996, ...}) = 0 read(3, "# Locale name alias data base.\n#"..., 4096) = 2996 read(3, "", 4096) = 0 close(3) = 0 openat(AT_FDCWD, "/usr/share/locale/en_US.UTF-8/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale/en_US.utf8/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory) fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x1), ...}) = 0 openat(AT_FDCWD, "/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) write(2, "/usr/bin/obs: line 2: 1772 Segm"..., 151/usr/bin/obs: line 2: 1772 Segmentation fault LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libGL.so MESA_GL_VERSION_OVERRIDE=3.3 /usr/bin/obs-exec "$@" ) = 151 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=1772, si_uid=1000, si_status=SIGSEGV, si_utime=462, si_stime=126} --- wait4(-1, 0x7ff21ec080, WNOHANG, NULL) = -1 ECHILD (No child processes) rt_sigreturn({mask=[]}) = 0 read(255, "", 111) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 exit_group(139) = ? +++ exited with 139 +++

Bastlerstube avatar Jul 26 '22 20:07 Bastlerstube

I forgot the obs command is actually a bash script. Running strace on it will mix in output from bash. Run this instead:

export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libGL.so
export MESA_GL_VERSION_OVERRIDE=3.3 
strace obs-exec

Botspot avatar Jul 26 '22 20:07 Botspot

@Botspot wrong command, this user is running on aarch64 in the last test

theofficialgman avatar Jul 26 '22 20:07 theofficialgman

There are really a lot of messages coming in.

I think this is the most interesting:

+++ killed by SIGSEGV +++ Segmentation fault

Bastlerstube avatar Jul 26 '22 20:07 Bastlerstube

@Bastlerstube I edited botspots command. copy it again run it again ^

a segfault doesn't give any clue as to what the issue is. all it means is that a piece of code tried to execute something in ram that that it does not have access to (like can happen if the library referenced on the system that compiled the binary is not of the same version of the one of the system that is running the binary). This would be guaranteed to not happen if @ryanfortner rebuilds his debs using the proper method outlined in https://github.com/Pi-Apps-Coders/files/blob/main/CompileCommands.md#obs

theofficialgman avatar Jul 26 '22 20:07 theofficialgman

It did not matter if

export LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libGL.so export MESA_GL_VERSION_OVERRIDE=3.3 strace obs-exec

or

export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libGL.so export MESA_GL_VERSION_OVERRIDE=3.3 strace obs-exec

The output was blazing fast and it looked seemingly the same.

However, both ended with:

+++ killed by SIGSEGV +++ Segmentation fault

Bastlerstube avatar Jul 26 '22 20:07 Bastlerstube

the ending is not what we care about copy the 20 or so lines above that using

export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libGL.so
export MESA_GL_VERSION_OVERRIDE=3.3
strace obs-exec

theofficialgman avatar Jul 26 '22 20:07 theofficialgman

write(37, "{"DesktopAudioDevice1":{"balance"..., 2627) = 2627 close(37) = 0 faccessat(AT_FDCWD, "/home/pi/.config/obs-studio/basic/scenes/Unbenannt.json", F_OK) = 0 renameat(AT_FDCWD, "/home/pi/.config/obs-studio/basic/scenes/Unbenannt.json", AT_FDCWD, "/home/pi/.config/obs-studio/basic/scenes/Unbenannt.json.bak") = 0 renameat(AT_FDCWD, "/home/pi/.config/obs-studio/basic/scenes/Unbenannt.json.tmp", AT_FDCWD, "/home/pi/.config/obs-studio/basic/scenes/Unbenannt.json") = 0 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 ppoll([{fd=3, events=POLLIN|POLLOUT}], 1, NULL, NULL, 0) = 1 ([{fd=3, revents=POLLOUT}]) writev(3, [{iov_base="+\0\1\0", iov_len=4}], 1) = 4 futex(0x557b0639f8, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0x557b0639f8, FUTEX_WAKE_PRIVATE, 1) = 0 ppoll([{fd=3, events=POLLIN|POLLOUT}], 1, NULL, NULL, 0) = 1 ([{fd=3, revents=POLLOUT}]) writev(3, [{iov_base="<\0\2\0x\0\300\0017\0\5\0y\0\300\1\6\0\300\1\0\0\1\0\0\0\0\0;\3\7\0"..., iov_len=152}], 1) = 152 ppoll([{fd=3, events=POLLIN|POLLOUT}], 1, NULL, NULL, 0) = 1 ([{fd=3, revents=POLLOUT}]) writev(3, [{iov_base="<\0\2\0y\0\300\0017\0\5\0z\0\300\1\37\0\300\1\0\0\1\0\0\0\0\0;\3\7\0"..., iov_len=152}], 1) = 152 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 ppoll([{fd=5, events=POLLIN}, {fd=26, events=POLLIN}], 2, {tv_sec=0, tv_nsec=0}, NULL, 0) = 1 ([{fd=5, revents=POLLIN}], left {tv_sec=0, tv_nsec=0}) read(5, "\3\0\0\0\0\0\0\0", 16) = 8 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 ppoll([{fd=3, events=POLLIN|POLLOUT}], 1, NULL, NULL, 0) = 1 ([{fd=3, revents=POLLOUT}]) writev(3, [{iov_base="<\0\2\0z\0\300\0017\0\5\0{\0\300\1\33\0\300\1\0\0\1\0\0\0\0\0;\3\5\0"..., iov_len=104}], 1) = 104 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 ppoll([{fd=5, events=POLLIN}, {fd=26, events=POLLIN}], 2, {tv_sec=0, tv_nsec=0}, NULL, 0) = 1 ([{fd=5, revents=POLLIN}], left {tv_sec=0, tv_nsec=0}) read(5, "\2\0\0\0\0\0\0\0", 16) = 8 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 write(5, "\1\0\0\0\0\0\0\0", 8) = 8 ppoll([{fd=5, events=POLLIN}, {fd=26, events=POLLIN}], 2, {tv_sec=0, tv_nsec=0}, NULL, 0) = 1 ([{fd=5, revents=POLLIN}], left {tv_sec=0, tv_nsec=0}) read(5, "\t\0\0\0\0\0\0\0", 16) = 8 ppoll([{fd=3, events=POLLIN|POLLOUT}], 1, NULL, NULL, 0) = 1 ([{fd=3, revents=POLLOUT}]) writev(3, [{iov_base="<\0\2\0{\0\300\0017\0\5\0|\0\300\1\6\0\300\1\0\0\1\0\0\0\0\0;\3\r\0"..., iov_len=296}], 1) = 296 ppoll([{fd=5, events=POLLIN}, {fd=26, events=POLLIN}], 2, {tv_sec=0, tv_nsec=9000000}, NULL, 0) = 0 (Timeout) write(5, "\1\0\0\0\0\0\0\0", 8) = 8 ppoll([{fd=5, events=POLLIN}, {fd=26, events=POLLIN}], 2, {tv_sec=0, tv_nsec=0}, NULL, 0) = 1 ([{fd=5, revents=POLLIN}], left {tv_sec=0, tv_nsec=0}) read(5, "\1\0\0\0\0\0\0\0", 16) = 8 ppoll([{fd=3, events=POLLIN|POLLOUT}], 1, NULL, NULL, 0) = 1 ([{fd=3, revents=POLLOUT}]) writev(3, [{iov_base="+\0\1\0", iov_len=4}], 1) = ? +++ killed by SIGSEGV +++ Segmentation fault

Bastlerstube avatar Jul 26 '22 20:07 Bastlerstube

a segfault doesn't give any clue as to what the issue is. all it means is that a piece of code tried to execute something in ram that that it does not have access to (like can happen if the library referenced on the system that compiled the binary is not of the same version of the one of the system that is running the binary). This would be guaranteed to not happen if @ryanfortner rebuilds his debs using the proper method outlined in https://github.com/Pi-Apps-Coders/files/blob/main/CompileCommands.md#obs

Unfortunately I'm currently away from home and will be for just under 2 weeks now (with no access to my pi). I'll get to it as soon as I can.

ryanfortner avatar Jul 26 '22 20:07 ryanfortner

Thank you and have a great time, I'm looking forward to tackling it afterwards.

Many thanks to the professional and quick help here.

Bastlerstube avatar Jul 26 '22 20:07 Bastlerstube

I think I had the same problem. It looks similar. The problem was the connection to YouTube. OBS crashed when I tried starting the stream or tested my connection. By default OBS used YouTube - RTMPS when you set your stream key. Try choosing Show All... > YouTube HLS. You can use the Auto-Configuration Wizard. After choosing HLS the bandwith test and streaming worked for me.

b42n1 avatar Jul 27 '22 23:07 b42n1