Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client app crashes OBS studio when client closes socket / terminates #626

Closed
ghost opened this issue Dec 6, 2020 · 3 comments
Closed

Client app crashes OBS studio when client closes socket / terminates #626

ghost opened this issue Dec 6, 2020 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 6, 2020

Issue type

Bug report

Description

Client application connects to OBS studio on the websocket port ( localhost:4444 tcp ipv4 ) and sends initial HTTP upgrade request over a blocking socket.

Client application then switches socket to non-blocking and uses epoll to wait for incoming data from OBS studio.

Websocket plugin sends HTTP upgrade response to client application and client application reads 156 bytes successfully into a buffer.

Client application then exits / terminates itself because its still under active development, which causes OBS studio to crash with the following output to the terminal:

[2020-12-05 21:55:50] [connect] WebSocket Connection [::ffff:127.0.0.1]:43826 v13 "" / 101
info: [obs-websocket] new client connection from [::ffff:127.0.0.1]:43826
[2020-12-05 21:55:50] [error] handle_read_frame error: websocketpp.transport:7 (End of File)
[2020-12-05 21:55:50] [info] Error getting remote endpoint: asio.system:107 (Transport endpoint is not connected)
QPaintDevice: Cannot destroy paint device that is being painted
Segmentation fault (core dumped)

The websocket plugin, because it is acting as a server, should expect a client application to terminate at any point in time and handle the socket closure / client disconnect gracefully, but instead it just crashes everything.

Steps to reproduce and other useful info

See above description for steps to reproduce.

Technical information
  • Operating System : Arch Linux kernel 5.9.11-arch2-1
  • OBS Studio version : OBS Studio - 26.0.2-3 (linux) ( from arch repo )
  • obs-websocket version : obs-websocket 4.8.0-1 ( from arch AUR repo )
@tt2468
Copy link
Member

tt2468 commented Dec 20, 2020

Are you able to provide a crash log?

@markmandel
Copy link

Just encountered this too when working on a project that implements my own client connection to the websocket protocol.

QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_SCALE_FACTOR=1 ./obs --unfiltered_log
info: User switched to scene 'All Me'
info: User switched to scene 'Waiting'
[2021-01-02 11:39:48] [connect] WebSocket Connection [::1]:60482 v13 "" / 101
info: [obs-websocket] new client connection from [::1]:60482
[2021-01-02 11:39:55] [connect] WebSocket Connection [::1]:60486 v13 "" / 101
info: [obs-websocket] new client connection from [::1]:60486
[2021-01-02 12:20:41] [error] handle_read_frame error: websocketpp.transport:7 (End of File)
[2021-01-02 12:20:41] [info] Error getting remote endpoint: asio.system:107 (Transport endpoint is not connected)
info: [obs-websocket] client Unknown disconnected
[2021-01-02 12:20:41] [disconnect] Disconnect close local:[1006,End of File] remote:[1006]
[2021-01-02 12:20:41] [error] handle_read_frame error: websocketpp.transport:7 (End of File)
[2021-01-02 12:20:41] [info] Error getting remote endpoint: asio.system:107 (Transport endpoint is not connected)
info: [obs-websocket] client Unknown disconnected
[2021-01-02 12:20:41] [disconnect] Disconnect close local:[1006,End of File] remote:[1006]
[2021-01-02 12:24:09] [connect] WebSocket Connection [::1]:34116 v13 "" / 101
info: [obs-websocket] new client connection from [::1]:34116
[2021-01-02 12:24:12] [connect] WebSocket Connection [::1]:34124 v13 "" / 101
info: [obs-websocket] new client connection from [::1]:34124
info: User switched to scene '---'
info: User switched to scene 'Secret'
info: User switched to scene 'Waiting'
info: User switched to scene 'All Me'
info: User switched to scene 'Working'
info: User switched to scene 'Secret'
info: User switched to scene 'Waiting'
[2021-01-02 12:38:23] [error] handle_read_frame error: websocketpp.transport:7 (End of File)
[2021-01-02 12:38:23] [info] Error getting remote endpoint: asio.system:107 (Transport endpoint is not connected)
info: [obs-websocket] client Unknown disconnected
[2021-01-02 12:38:23] [disconnect] Disconnect close local:[1006,End of File] remote:[1006]
[2021-01-02 12:38:23] [error] handle_read_frame error: websocketpp.transport:7 (End of File)
[2021-01-02 12:38:23] [info] Error getting remote endpoint: asio.system:107 (Transport endpoint is not connected)
./run.sh: line 12: 1226160 Segmentation fault      QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_SCALE_FACTOR=1 ./obs --unfiltered_log

(run.sh is how I run OBS locally with some scaling options, and with unfiltered logs)

What is interesting, is that it doesn't seem to happen all the time, you can see me connecting and disconnecting as I'm working on my integration.

Here is my full log as well:
2021-01-02 11-24-30.txt

I'm not seeing a reference to a minidump though. 🤔 happy to follow some steps if you have a specific set you would like me to take.

@tt2468
Copy link
Member

tt2468 commented Feb 2, 2021

This should now be fixed in #644

I'm keeping #645 open for now in case anyone has any further comments about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants