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

Fixed crash found with non-blocking linger in srt-live-transmit #627

Merged
merged 4 commits into from
Apr 15, 2019

Conversation

ethouris
Copy link
Collaborator

The crash observed during closing the program with non-blocking and working linger was due to collision of the global object destruction.

This fix provides fair call of srt_cleanup() at the end, as it should be, and some smaller fixes to avoid possible collisions around global variables in the future.

@maxsharabayko maxsharabayko added this to the v.1.3.3 milestone Mar 28, 2019
@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Mar 28, 2019
@maxsharabayko maxsharabayko added [apps] Area: Test applications related improvements and removed [core] Area: Changes in SRT library core labels Mar 28, 2019
Copy link
Collaborator

@maxsharabayko maxsharabayko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix tabs. The rest is approved.

srtcore/api.cpp Outdated
{
HLOGC(mglog.Debug, log << "@" << u << "U::close: NOT AN ACTIVE SOCKET, returning.");
return 0;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabs.

srtcore/api.cpp Outdated
@@ -1831,11 +1833,13 @@ void* CUDTUnited::garbageCollect(void* p)
timeout.tv_sec = now.tv_sec + 1;
timeout.tv_nsec = now.tv_usec * 1000;

HLOGC(mglog.Debug, log << "GC: sleep until " << FormatTime(uint64_t(now.tv_usec) + 1000000*(timeout.tv_sec)));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabs.

srtcore/api.cpp Outdated
@@ -964,35 +965,36 @@ int CUDTUnited::close(const SRTSOCKET u)
s->m_TimeStamp = CTimer::getTime();

m_Sockets.erase(s->m_SocketID);
m_ClosedSockets.insert(pair<SRTSOCKET, CUDTSocket*>(s->m_SocketID, s));
m_ClosedSockets[s->m_SocketID] = s;
HLOGC(mglog.Debug, log << "@" << u << "U::close: Socket MOVED TO CLOSED for collecting later.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabs.

@rndi rndi merged commit 2bdebef into Haivision:master Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[apps] Area: Test applications related improvements Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants