Skip to content

[BUG] Deadlock at cleanup due to pending delivery. #2841

Closed

Description

@STVHA

I am using SRT 5.3.1 for data transmission from one PC to another.
I setup for both sender and receiver like this:

  • Transtype=SRTT_FILE,
  • MessageAPI=true,
  • BlockingMode = false,
  • Latency = 100

It seems working well within one PC, but for cross-PC, sometimes the sender stops sending in the middle of transmission
When I close the sender, it hangs forever.

Here are the stack of all SRT's related threads when the hang happened. I hope those may be helpful for your debug.

// MainThread:
 	srt.dll!std::thread::join() Line 133	C++
	srt.dll!srt::CUDTUnited::cleanup() Line 306	C++
 	srt.dll!srt::CUDT::cleanup() Line 3363	C++
 	srt.dll!srt_cleanup() Line 33	C++

This is the context of the CUDTUnited:

CUDTUnited-context

// GarbageCollect:
	srt.dll!std::thread::join() Line 133	C++
	srt.dll!srt::CSndQueue::~CSndQueue() Line 434	C++
 	srt.dll!srt::CSndQueue::`scalar deleting destructor'(unsigned int)	C++
 	srt.dll!srt::CMultiplexer::destroy() Line 1791	C++
 	srt.dll!srt::CUDTUnited::removeSocket(const int u) Line 2822	C++
 	srt.dll!srt::CUDTUnited::checkBrokenSockets() Line 2702	C++
 	srt.dll!srt::CUDTUnited::garbageCollect(void * p) Line 3338	C++

This is the context of the CSndQueue:

CSndQueue-context

// SendingWorker:
	ws2_32.dll!00007ffc249a2c10()	Unknown
	srt.dll!srt::CChannel::sendto(const srt::sockaddr_any & addr, srt::CPacket & packet, const srt::sockaddr_any & source_addr) Line 784	C++
 	srt.dll!srt::CSndQueue::worker(void * param) Line 597	C++
 	srt.dll!std::invoke<void * (__cdecl*)(void *),void *>(void *(*)(void *) && _Obj, void * && _Arg1) Line 1756	C++
 	srt.dll!std::thread::_Invoke<std::tuple<void * (__cdecl*)(void *),void *>,0,1>(void * _RawVals) Line 61	C++

This is the context of the CChannel:

CChannel-context

Local variables inside CChannel::sendto()
CChannel-sendto() local vars

Activity

  1. added
    Type: Bug
    on Jan 4, 2024
  2. maxsharabayko commented on Jan 8, 2024

    @maxsharabayko
    Collaborator

    Likely related to the issue in SRT v1.5.3 fixed in PR #2834.

  3. added
    [core]
    on Jan 8, 2024
  4. added this to the v1.5.4 milestone on Jan 8, 2024
  5. maxsharabayko commented on Aug 23, 2024

    @maxsharabayko
    Collaborator

    Closing: no activity and likely solved by #2834.

  6. added a commit that references this issue on Oct 23, 2026
  7. added a commit that references this issue on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: Bug[core]

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions