Hi, I am running mediasoup in a k8s container and the worker crashes when I attempt to close a webrtc transport. The crash only happens when I create a pipe transport on a router first, and then create & close a webrtc transport on the same router.
crash logs:
mediasoup:Transport close()
mediasoup:Channel request() [method:ROUTER_CLOSE_TRANSPORT]
mediasoup:ERROR:Worker (stderr) terminate called after throwing an instance of 'std::out_of_range' undefined
mediasoup:ERROR:Worker (stderr) what(): vector<bool>::_M_range_check: __n (which is 18446744073709550847) >= this->size() (which is 201) undefined
mediasoup:Channel Consumer Channel ended by the worker process
mediasoup:ERROR:Channel Producer Channel error: Error: read ECONNRESET undefined
mediasoup:ERROR:Worker worker process died unexpectedly [pid:17, code:null, signal:SIGABRT] undefined
mediasoup:Worker died() [error:Error: [pid:17, code:null, signal:SIGABRT]]
my environment:
mediasoup version: 3.14.15
node version: v18.20.3
gcc/clang version: I used a pre-build mediasoup executable
steps to reproduce the crash:
1.create two mediasoup workers
2.create a router on each worker
3.create a pipe transport and call pipeTransport.connect() on each router
4.create a webrtc transport and call webrtcTransport.connect() on one of the routers
5.create producers on the transport, after 10-15 seconds, close the producers
6.call webrtcTransport.close(), triggering the crash
The worker works perfectly when I create a single router (and obviously not creating any pipe transports), but it consistently crashes when I create multiple routers across workers.
Audio & video transmission across routers is smooth and the mediasoup client apps can see and hear each other perfectly, the crash only happens when I try to free webrtc transports.
At first I thought I probably made a mistake when I create and free pipe producers/consumers, but it crashed even when no pipe producer/consumer were created.
Please help, thanks a lot!