Skip to content

[BUG] srt-test-multiplex seg faults when output is rtp:// #2687

@kmathewmk

Description

@kmathewmk

Describe the bug
srt-test-multiplex seg faults when output is rtp:// and input is udp://

To Reproduce
Steps to reproduce the behavior:

  1. Run sender and receiver as below
srt-test-multiplex-log -v -ll debug srt://10.86.91.15:10000 -i udp://239.194.45.46:10001?id=1 udp://239.194.45.46:10002?id=2 udp://239.194.45.46:10003?id=3
srt-test-multiplex -v -ll debug srt://:10000 -o rtp://239.194.35.36:3001?id=1 rtp://239.194.35.36:3002?id=2 rtp://239.194.35.36:3003?id=3
  1. Receiver ends with a seg fault

Expected behavior
UDP is output as RTP without seg fault

Screenshots
None

Desktop (please provide the following information):

  • OS: RHEL8, Alma Linux 8
  • SRT Version / commit ID: commit 1cffd2f (HEAD -> master, tag: v1.5.2-rc.1, origin/master, origin/HEAD)

Additional context
Sender:

[root@inspur ~]# ~/utils/srt-test-multiplex-log -v -ll debug srt://10.86.91.15:10000 -i udp://239.194.45.46:10001?id=1 udp://239.194.45.46:10002?id=2 udp://239.194.45.46:10003?id=3
10:50:15.851523/main D:SRT.sm: generateSocketID: : @779351129
Connect with requesting stream [1]
Connecting to 10.86.91.15:10000 ... 10:50:15.853077/main.N:SRT.cn: @779351129: Connection established to: 10.86.91.15:10000
 connected.
Extracted outgoing port: 50545
10:50:15.853125/main.N:srt-mplex: SelectMedium: for [1] found medium: udp://239.194.45.46:10001?id=1
Multicast: home address: INADDR_ANY:10001
Multicast(POSIX): will bind to IGMP address: 239.194.45.46
10:50:15.853291/main D:SRT.sm: generateSocketID: : @779351128
10:50:15.853265/TL<udp://239.19.N:srt-mplex: STARTING TRANSMiSSION: udp://239.194.45.46:10001?id=1  ->  10.86.91.15:10000[1]%779351129
Connect with requesting stream [2]
Setting outgoing port: 50545 adapter:
Binding the caller socket to :50545 ...
Connecting to 10.86.91.15:10000 ... 10:50:15.854305/main.N:SRT.cn: @779351128: Connection established to: 10.86.91.15:10000
 connected.
10:50:15.854329/main.N:srt-mplex: SelectMedium: for [2] found medium: udp://239.194.45.46:10002?id=2
Multicast: home address: INADDR_ANY:10002
Multicast(POSIX): will bind to IGMP address: (#1 %1554393139  239.194.45.46408CC2F3)
10:50:15.854427/TL<udp://239.19.N:srt-mplex:  << 1316  ->   sent
10:50:15.854514/main D:SRT.sm: generateSocketID: : @779351127
Connect with requesting stream [3]
Setting outgoing port: 50545 adapter:
Binding the caller socket to :50545 ...
10:50:15.854504/TL<udp://239.19.N:srt-mplex: STARTING TRANSMiSSION: udp://239.194.45.46:10002?id=2  ->  10.86.91.15:10000[2]%779351128
Connecting to 10.86.91.15:10000 ... (#1 %304552584  E854A037) 10:50:15.854932/TL<udp://239.19.N:srt-mplex:  << 1316  ->   sent
10:50:15.855609/main.N:SRT.cn: @779351127: Connection established to: 10.86.91.15:10000
 connected.
10:50:15.855635/main.N:srt-mplex: SelectMedium: for [3] found medium: udp://239.194.45.46:10003?id=3
Multicast: home address: INADDR_ANY:10003
Multicast(POSIX): will bind to IGMP address: 239.194.45.46
10:50:15.856133/main.N:srt-mplex: All local stream definitions covered. Waiting for interrupt/broken all connections.
10:50:15.856137/TL<udp://239.19.N:srt-mplex: STARTING TRANSMiSSION: udp://239.194.45.46:10003?id=3  ->  10.86.91.15:10000[3]%779351127
(#2 %1554393140  C20761B1) 10:50:15.856373/TL<udp://239.19.N:srt-mplex:  << 1316  ->   sent
(#3 %1554393141  572D962D) 10:50:15.857342/TL<udp://239.19.N:srt-mplex:  << 1316  ->   sent
...
(#2157 %304554740  B1166290) 10:50:21.072886/TL<udp://239.19.N:srt-mplex:  << 1316  ->   sent
FAILURE
srt_sendmsg: [2001.0] Connection was broken
10:50:21.074465/TL<udp://239.19.N:srt-mplex: INTERRUPTED: error: srt_sendmsg: Connection was broken
SrtCommon: DESTROYING CONNECTION, closing socket (rt%779351129)...
SrtCommon: ... done.
10:50:21.074530/TL<udp://239.19.N:srt-mplex: CLOSED: udp://239.194.45.46:10001?id=1  ->  10.86.91.15:10000[1]%779351129
10:50:21.074540/TL<udp://239.19.N:srt-mplex: MediumPair: Giving it 5 seconds delay before exiting
FAILURE
srt_sendmsg: [5004.0] Operation not supported: Invalid socket ID
10:50:21.074934/TL<udp://239.19.N:srt-mplex: INTERRUPTED: error: srt_sendmsg: Operation not supported: Invalid socket ID
SrtCommon: DESTROYING CONNECTION, closing socket (rt%779351128)...
SrtCommon: ... done.
10:50:21.074966/TL<udp://239.19.N:srt-mplex: CLOSED: udp://239.194.45.46:10002?id=2  ->  10.86.91.15:10000[2]%779351128
10:50:21.074974/TL<udp://239.19.N:srt-mplex: MediumPair: Giving it 5 seconds delay before exiting
(#884 %746053014  B5AEC81D) 10:50:21.076034/TL<udp://239.19.N:srt-mplex:  << 1316  ->   sent
FAILURE
srt_sendmsg: [2001.0] Connection was broken
10:50:21.081089/TL<udp://239.19.N:srt-mplex: INTERRUPTED: error: srt_sendmsg: Connection was broken
SrtCommon: DESTROYING CONNECTION, closing socket (rt%779351127)...
SrtCommon: ... done.
10:50:21.081164/TL<udp://239.19.N:srt-mplex: CLOSED: udp://239.194.45.46:10003?id=3  ->  10.86.91.15:10000[3]%779351127
10:50:21.081175/TL<udp://239.19.N:srt-mplex: MediumPair: Giving it 5 seconds delay before exiting
Found QUIT mediumpair: udp://239.194.45.46:10001?id=1  ->  10.86.91.15:10000[1]%779351129 - removing from base
SrtCommon: DESTROYING CONNECTION, closing socket (rt%779351129)...
SrtCommon: ... done.
Found QUIT mediumpair: udp://239.194.45.46:10002?id=2  ->  10.86.91.15:10000[2]%779351128 - removing from base
SrtCommon: DESTROYING CONNECTION, closing socket (rt%779351128)...
SrtCommon: ... done.
Found QUIT mediumpair: udp://239.194.45.46:10003?id=3  ->  10.86.91.15:10000[3]%779351127 - removing from base
SrtCommon: DESTROYING CONNECTION, closing socket (rt%779351127)...
SrtCommon: ... done.
All media have quit. Marking exit.
[root@inspur ~]#

Receiver:

[root@x1lidl ~]# ~/utils/srt-test-multiplex -v -ll debug srt://:10000 -o rtp://239.194.35.36:3001?id=1 rtp://239.194.35.36:3002?id=2 rtp://239.194.35.36:3003?id=3
Setting up listener: port=10000 backlog=5
10:49:57.180671/main D:SRT.sm: generateSocketID: : @85392077
Binding a server on :10000 ...
10:49:57.180831/main D:SRT.km: CHANNEL: Bound to local address: 0.0.0.0:10000
 listen... Accepting a client...
 accept...10:50:15.851997/SRT:RcvQ:w1.N:SRT.cn: PASSING request from: 10.86.91.31:50545 to agent:85392077
10:50:15.852078/SRT:RcvQ:w1.N:SRT.cn: Listener managed the connection request from: 10.86.91.31:50545 result:waveahand
10:50:15.852232/SRT:RcvQ:w1.N:SRT.cn: PASSING request from: 10.86.91.31:50545 to agent:85392077
10:50:15.852261/SRT:RcvQ:w1 D:SRT.sm: generateSocketID: : @85392076
10:50:15.852540/SRT:RcvQ:w1.N:SRT.cn: HSREQ/rcv: cmd=1(HSREQ) len=12 vers=0x10502 opts=0xbf delay=120
10:50:15.852583/SRT:RcvQ:w1.N:SRT.cn: @85392077: listen ret: -1 - conclusion
10:50:15.852598/SRT:RcvQ:w1.N:SRT.cn: Listener managed the connection request from: 10.86.91.31:50545 result:waveahand
 connected [10.86.91.15:10000] <-- 10.86.91.31:50545
... GOT CLIENT for stream [1]
10:50:15.852673/main.N:srt-mplex: SelectMedium: for [1] found medium: rtp://239.194.35.36:3001?id=1
Accepting a client...
 accept...10:50:15.852786/TL>rtp://239.19.N:srt-mplex: STARTING TRANSMiSSION: :10000[1]%85392076  ->  rtp://239.194.35.36:3001?id=1
10:50:15.853414/SRT:RcvQ:w1.N:SRT.cn: PASSING request from: 10.86.91.31:50545 to agent:85392077
10:50:15.853434/SRT:RcvQ:w1.N:SRT.cn: Listener managed the connection request from: 10.86.91.31:50545 result:waveahand
10:50:15.853503/SRT:RcvQ:w1.N:SRT.cn: PASSING request from: 10.86.91.31:50545 to agent:85392077
10:50:15.853537/SRT:RcvQ:w1 D:SRT.sm: generateSocketID: : @85392075
10:50:15.853793/SRT:RcvQ:w1.N:SRT.cn: HSREQ/rcv: cmd=1(HSREQ) len=12 vers=0x10502 opts=0xbf delay=120
10:50:15.853816/SRT:RcvQ:w1.N:SRT.cn: @85392077: listen ret: -1 - conclusion
10:50:15.853823/SRT:RcvQ:w1.N:SRT.cn: Listener managed the connection request from: 10.86.91.31:50545 result:waveahand
 connected [10.86.91.15:10000] <-- 10.86.91.31:50545
... GOT CLIENT for stream [2]
10:50:15.853884/main.N:srt-mplex: SelectMedium: for [2] found medium: rtp://239.194.35.36:3002?id=2
Accepting a client...
 accept...10:50:15.853963/TL>rtp://239.19.N:srt-mplex: STARTING TRANSMiSSION: :10000[2]%85392075  ->  rtp://239.194.35.36:3002?id=2
10:50:15.854649/SRT:RcvQ:w1.N:SRT.cn: PASSING request from: 10.86.91.31:50545 to agent:85392077
10:50:15.854680/SRT:RcvQ:w1.N:SRT.cn: Listener managed the connection request from: 10.86.91.31:50545 result:waveahand
10:50:15.854764/SRT:RcvQ:w1.N:SRT.cn: PASSING request from: 10.86.91.31:50545 to agent:85392077
10:50:15.854786/SRT:RcvQ:w1 D:SRT.sm: generateSocketID: : @85392074
10:50:15.855078/SRT:RcvQ:w1.N:SRT.cn: HSREQ/rcv: cmd=1(HSREQ) len=12 vers=0x10502 opts=0xbf delay=120
10:50:15.855107/SRT:RcvQ:w1.N:SRT.cn: @85392077: listen ret: -1 - conclusion
10:50:15.855119/SRT:RcvQ:w1.N:SRT.cn: Listener managed the connection request from: 10.86.91.31:50545 result:waveahand
 connected [10.86.91.15:10000] <-- 10.86.91.31:50545
... GOT CLIENT for stream [3]
10:50:15.855166/main.N:srt-mplex: SelectMedium: for [3] found medium: rtp://239.194.35.36:3003?id=3
10:50:15.855222/main.N:srt-mplex: All local stream definitions covered. Waiting for interrupt/broken all connections.
10:50:15.855223/TL>rtp://239.19.N:srt-mplex: STARTING TRANSMiSSION: :10000[3]%85392074  ->  rtp://239.194.35.36:3003?id=3
(#1 %1554393139  408CC2F3) Segmentation fault (core dumped)
[root@x1lidl ~]#

Receiver stack backtrace:

[root@x1lidl ~]# gdb -p 93576
GNU gdb (GDB) Red Hat Enterprise Linux 8.2-19.el8
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 93576
[New LWP 93577]
[New LWP 93578]
[New LWP 93579]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f323ad5045c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
Missing separate debuginfos, use: yum debuginfo-install glibc-2.28-211.el8.x86_64 libgcc-8.5.0-16.el8_7.alma.x86_64 libstdc++-8.5.0-16.el8_7.alma.x86_64 openssl-libs-1.1.1k-7.el8_6.x86_64 zlib-1.2.11-21.el8_7.x86_64
(gdb) cont
Continuing.
[New Thread 0x7f3233fff700 (LWP 93594)]
[New Thread 0x7f32337fe700 (LWP 93595)]
[New Thread 0x7f3232ffd700 (LWP 93596)]
[New Thread 0x7f32327fc700 (LWP 93597)]
[New Thread 0x7f3231ffb700 (LWP 93598)]
[New Thread 0x7f32317fa700 (LWP 93599)]

Thread 6 "TL>rtp://239.19" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f32337fe700 (LWP 93595)]
0x000000000043e674 in MediumPair::TransmissionLoop() ()
(gdb) bt
#0  0x000000000043e674 in MediumPair::TransmissionLoop() ()
#1  0x00007f323aa6fba3 in execute_native_thread_routine () from /lib64/libstdc++.so.6
#2  0x00007f323ad4a1cf in start_thread () from /lib64/libpthread.so.0
#3  0x00007f323a086e73 in clone () from /lib64/libc.so.6
(gdb)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugIndicates an unexpected problem or unintended behavior[apps]Area: Test applications related improvements

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions