Skip to content

Conversation

@JonnyKong
Copy link

@JonnyKong JonnyKong commented Apr 19, 2021

Currently, when the client is terminated on SIGINT, Tracking::~Tracking() shows unsafe behavior:

edgeslam/src/Tracking.cc

Lines 2323 to 2330 in d548979

Tracking::~Tracking(){
keyframe_socket->~TcpSocket();
frame_socket->~TcpSocket();
map_socket->~TcpSocket();
// This is just a dummy enqueue to unblock the wait_dequeue function in tcp_send()
keyframe_queue.enqueue("exit");
frame_queue.enqueue("exit");
}

The sockets are destroyed, then "exit" messages are sent through the queue to signal keyframe_thread and frame_thread to terminate.

After the two threads are un-blocked in tcp_send(), they will then call TcpSocket::checkAlive() before terminating. This is unsafe since the sockets might have already been destroyed (it causes a segfault on my machine):

if(!socketObject->checkAlive())

This pull request fixes this issue.

@dasda-asd
Copy link

Can the code run monocular mode, please?

@dasda-asd
Copy link

@JonnyKong

@dasda-asd
Copy link

@dkkarthik

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

Successfully merging this pull request may close these issues.

2 participants