You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you resolve and build an inlet stream and then that stream dies, calling info never returns. It gets stuck waiting for its thread to finish, which is stuck in epoll_wait with a forever timeout.
Steps to reproduce:
Start an LSL stream. Can use pylsl.examples.SendData
Get a list of all streams with lsl::resolve_streams
Create an lsl::stream_inlet out of the resolved stream.
Kill the stream.
Get the full info from the stream by calling 'info'.
The program will get stuck.
The fix is for the info_receiver to check the return status of buffer.connect, and if it's nullptr to throw buffer.error(). None of the checks that would trigger shutdown or lost on the connection have been done so the only way to know that the stream is now gone is to try to use it, and that's done by the buffer.connect call. If this check is not done then the cancellable_streambuf is given data to send and after that the problem is realized but the cancellable_streambuf is going to try to send its data when its destroyed and this results in an epoll_wait forever on an invalid fd.
In other words, in info_receiver::info_thread on line 55 change:
buffer.connect(conn_.get_tcp_endpoint());
To:
if (nullptr == buffer.connect(conn_.get_tcp_endpoint()))
{
throw buffer.error();
}
The text was updated successfully, but these errors were encountered:
* Adds test to for calling info on a disconnected stream_inlet to
testing/ext/discovery.cpp
* Fixes deadlock that occurred by checking return value of
buffer.connect and throwing a system_error based on the error_code in
buffer if the check fails.
issue: sccn#201
* Adds test to for calling info on a disconnected stream_inlet to
testing/ext/discovery.cpp
* Fixes deadlock that occurred by checking return value of
buffer.connect and throwing a system_error based on the error_code in
buffer if the check fails.
issue: #201
If you resolve and build an inlet stream and then that stream dies, calling info never returns. It gets stuck waiting for its thread to finish, which is stuck in epoll_wait with a forever timeout.
Steps to reproduce:
The program will get stuck.
The fix is for the info_receiver to check the return status of buffer.connect, and if it's nullptr to throw buffer.error(). None of the checks that would trigger shutdown or lost on the connection have been done so the only way to know that the stream is now gone is to try to use it, and that's done by the buffer.connect call. If this check is not done then the cancellable_streambuf is given data to send and after that the problem is realized but the cancellable_streambuf is going to try to send its data when its destroyed and this results in an epoll_wait forever on an invalid fd.
In other words, in info_receiver::info_thread on line 55 change:
buffer.connect(conn_.get_tcp_endpoint());
To:
if (nullptr == buffer.connect(conn_.get_tcp_endpoint()))
{
throw buffer.error();
}
The text was updated successfully, but these errors were encountered: