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

"Quit OBS" crashes OBS if there's an open websocket connection #465

Closed
christianscheuer opened this issue Apr 10, 2020 · 4 comments
Closed

Comments

@christianscheuer
Copy link

christianscheuer commented Apr 10, 2020

Issue type

Bug report

Description
  • OBS crashes on exit if there's an open websocket connection.
Steps to reproduce and other useful info
  • Open a websocket connection to obs-websocket
  • Fire off some commands
  • Choose "Quit OBS"
  • OBS crashes.
Comment

It should not crash OBS if there's an open websocket connection.
The opener of the connection might not be aware that the user is about to close OBS.

Technical information
  • Operating System : macOS 10.14.6
  • OBS Studio version : 24.0.6
  • obs-websocket version : 4.7.0 - from mac pkg installer
Crashlog stacktrace
Thread 4 Crashed:: Thread (pooled)
0 com.obsproject.obs-studio 0x00000001014af4cb 0x10147a000 + 218315
1 obs-websocket.so 0x000000001011e87a WSServer::notifyDisconnection(QString) + 26
2 obs-websocket.so 0x000000001011d21a WSServer::onClose(std::__1::weak_ptr<void>) + 250
3 obs-websocket.so 0x0000000010123c91 std::__1::__function::__func<std::__1::__bind<void (WSServer::*)(std::__1::weak_ptr<void>), WSServer*, std::__1::placeholders::__ph<1> const&>, std::__1::allocator<std::__1::__bind<void (WSServer::*)(std::__1::weak_ptr<void>), WSServer*, std::__1::placeholders::__ph<1> const&> >, void (std::__1::weak_ptr<void>)>::operator()(std::__1::weak_ptr<void>&&) + 65
4 obs-websocket.so 0x000000001016285a websocketpp::connection<websocketpp::config::asio>::handle_terminate(websocketpp::connection<websocketpp::config::asio>::terminate_status, std::__1::error_code const&) + 330
5 obs-websocket.so 0x0000000010162f0b websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::handle_async_shutdown(std::__1::shared_ptr<asio::basic_waitable_timer<std::__1::chrono::steady_clock, asio::wait_traits<std::__1::chrono::steady_clock> > >, std::__1::function<void (std::__1::error_code const&)>, std::__1::error_code const&) + 427
6 obs-websocket.so 0x0000000010149953 void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::shared_ptr<asio::basic_waitable_timer<std::__1::chrono::steady_clock, asio::wait_traits<std::__1::chrono::steady_clock> > >, std::__1::function<void (std::__1::error_code const&)>, std::__1::error_code const&), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::shared_ptr<asio::basic_waitable_timer<std::__1::chrono::steady_clock, asio::wait_traits<std::__1::chrono::steady_clock> > >&, std::__1::function<void (std::__1::error_code const&)>&, std::__1::placeholders::__ph<1> const&>&, std::__1::error_code const&>(std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::shared_ptr<asio::basic_waitable_timer<std::__1::chrono::steady_clock, asio::wait_traits<std::__1::chrono::steady_clock> > >, std::__1::function<void (std::__1::error_code const&)>, std::__1::error_code const&), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::shared_ptr<asio::basic_waitable_timer<std::__1::chrono::steady_clock, asio::wait_traits<std::__1::chrono::steady_clock> > >&, std::__1::function<void (std::__1::error_code const&)>&, std::__1::placeholders::__ph<1> const&>&&&, std::__1::error_code const&&&) + 163
7 obs-websocket.so 0x00000000101623b1 websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::async_shutdown(std::__1::function<void (std::__1::error_code const&)>) + 1025
8 obs-websocket.so 0x000000001012693b websocketpp::connection<websocketpp::config::asio>::terminate(std::__1::error_code const&) + 555
9 obs-websocket.so 0x0000000010129a9d websocketpp::connection<websocketpp::config::asio>::handle_read_frame(std::__1::error_code const&, unsigned long) + 3421
10 obs-websocket.so 0x00000000101394c6 websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::handle_async_read(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long) + 294
11 obs-websocket.so 0x000000001013b2a1 void websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> >::operator()<std::__1::error_code, unsigned long>(std::__1::error_code, unsigned long) + 145
12 obs-websocket.so 0x000000001013add2 void asio::detail::strand_service::dispatch<asio::detail::binder2<websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> >, std::__1::error_code, unsigned long> >(asio::detail::strand_service::strand_impl*&, asio::detail::binder2<websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> >, std::__1::error_code, unsigned long>&) + 98
13 obs-websocket.so 0x00000000101398f6 void asio::detail::wrapped_handler<asio::io_context::strand, websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> >, asio::detail::is_continuation_if_running>::operator()<std::__1::error_code, unsigned long>(std::__1::error_code const&, unsigned long const&) + 198
14 obs-websocket.so 0x000000001013a742 void asio::asio_handler_invoke<asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>, asio::mutable_buffers_1, asio::mutable_buffer const*, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> >, asio::detail::is_continuation_if_running> >, std::__1::error_code, unsigned long>, websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> > > >(asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>, asio::mutable_buffers_1, asio::mutable_buffer const*, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> >, asio::detail::is_continuation_if_running> >, std::__1::error_code, unsigned long>, websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> > >&, ...) + 162
15 obs-websocket.so 0x000000001013a409 asio::detail::completion_handler<asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>, asio::mutable_buffers_1, asio::mutable_buffer const*, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> >, asio::detail::is_continuation_if_running> >, std::__1::error_code, unsigned long>, websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> > > >::do_complete(void*, asio::detail::scheduler_operation*, std::__1::error_code const&, unsigned long) + 345
16 obs-websocket.so 0x000000001013a231 void asio::detail::strand_service::dispatch<asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>, asio::mutable_buffers_1, asio::mutable_buffer const*, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> >, asio::detail::is_continuation_if_running> >, std::__1::error_code, unsigned long>, websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> > > >(asio::detail::strand_service::strand_impl*&, asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>, asio::mutable_buffers_1, asio::mutable_buffer const*, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> >, asio::detail::is_continuation_if_running> >, std::__1::error_code, unsigned long>, websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> > >&) + 321
17 obs-websocket.so 0x0000000010139ec1 asio::detail::reactive_socket_recv_op<asio::mutable_buffers_1, asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>, asio::mutable_buffers_1, asio::mutable_buffer const*, asio::detail::transfer_at_least_t, asio::detail::wrapped_handler<asio::io_context::strand, websocketpp::transport::asio::custom_alloc_handler<std::__1::__bind<void (websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&, unsigned long)>, std::__1::error_code const&, unsigned long), std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&, unsigned long)>&, std::__1::placeholders::__ph<1> const&, std::__1::placeholders::__ph<2> const&> >, asio::detail::is_continuation_if_running> > >::do_complete(void*, asio::detail::scheduler_operation*, std::__1::error_code const&, unsigned long) + 465
18 obs-websocket.so 0x0000000010163f2f asio::detail::scheduler::do_run_one(asio::detail::conditionally_enabled_mutex::scoped_lock&, asio::detail::scheduler_thread_info&, std::__1::error_code const&) + 783
19 obs-websocket.so 0x0000000010163a42 asio::detail::scheduler::run(std::__1::error_code&) + 194
20 obs-websocket.so 0x00000000101638ef websocketpp::transport::asio::endpoint<websocketpp::config::asio::transport_config>::run() + 47
21 obs-websocket.so 0x0000000010163839 QtConcurrent::StoredFunctorCall0<void, WSServer::start(unsigned short)::$_0>::runFunctor() + 41
22 obs-websocket.so 0x0000000010163780 QtConcurrent::RunFunctionTask<void>::run() + 48
23 org.qt-project.QtCore 0x00000001042d712e 0x1042ad000 + 172334
24 org.qt-project.QtCore 0x00000001042da45c 0x1042ad000 + 185436
25 libsystem_pthread.dylib 0x00007fff69f4b2eb _pthread_body + 126
26 libsystem_pthread.dylib 0x00007fff69f4e249 _pthread_start + 66
27 libsystem_pthread.dylib 0x00007fff69f4a40d thread_start + 13
@tt2468
Copy link
Member

tt2468 commented May 1, 2020

Unable to replicate on Ubuntu 20.0.4 using latest compiled OBS (25.0.8) and obs-websocket (v4.8.0 technically)

What if you used a newer OBS or obs-websocket version? Does the problem persist?

@faithoflifedev
Copy link
Contributor

I think I'm seeing a bug related to this. On OSX 10.15.4 with OBS25.0.8 and obs-websocket cloned today, I can make OBS crash by sending the command sequence "StartStopStreaming", "GetStreamingStatus","StartStopStreaming", "GetStreamingStatus", "StartStopStreaming", after authentication of course.

Essentially what I am trying to do is start a second streaming session. The second "start" always crashes OBS.

@tt2468
Copy link
Member

tt2468 commented May 2, 2020

@faithoflifedev Go ahead and create a separate issue with a crash dump (if you have one)

@Palakis Palakis removed this from the 4.8 milestone May 12, 2020
@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.

@tt2468 tt2468 closed this as completed Feb 2, 2021
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

4 participants