Worker Dies

We are having and issue were worker is dies unexpectedly . We tried creating the core dump files as mentioned in the mediasoup :: Support
We did the
$ mkdir /tmp/cores
$ chmod 777 /tmp/cores
$ echo “/tmp/cores/core.%e.sig%s.%p” > /proc/sys/kernel/core_pattern
$ ulimit -c unlimited

and started the process using pm2 and it didnt create the core file we then started the process using node but no luck. If we kill the process manually using kill -s SIGSEGV the file get produced. So stuck not sure where to go from here
Our platform is as follows
node v14.15.1
mediasoup-3.7.14
gcc 9.3.0
g++ 9.3.0
c++ 9.3.0
–The log before
2021-06-13T15:42:59: 2021-06-13T22:42:59.432Z mediasoup:ERROR:Channel Producer Channel error: Error: write EPIPE
2021-06-13T15:42:59: xxxxxxxxxxxxxx
2021-06-13T15:42:59: 2021-06-13T22:42:59.433Z mediasoup:Transport consume()
2021-06-13T15:42:59: 2021-06-13T22:42:59.433Z mediasoup:Channel request() [method:transport.consume, id:5912]
2021-06-13T15:42:59: xxxxxxxxxxxxxx
2021-06-13T15:42:59: 2021-06-13T22:42:59.434Z mediasoup:Transport consume()
2021-06-13T15:42:59: 2021-06-13T22:42:59.434Z mediasoup:Channel request() [method:transport.consume, id:5913]
2021-06-13T15:42:59: 2021-06-13T22:42:59.436Z mediasoup:Channel Consumer Channel ended by the worker process
2021-06-13T15:42:59: 2021-06-13T22:42:59.443Z mediasoup:PayloadChannel Consumer PayloadChannel ended by the worker process
2021-06-13T15:42:59: 2021-06-13T22:42:59.443Z mediasoup:PayloadChannel Producer PayloadChannel ended by the worker process
2021-06-13T15:42:59: 2021-06-13T22:42:59.445Z mediasoup:Worker close()

May be this Error write EPIPE may be the issue. Our best guess is that the event is ahppeneing when a user is trying to share their screen.
Trying to figure out how we can core dump file , any help would be much appreciated

It doesn’t crash with memory issue or anything like that, hence there is no crash dump.

When does this happen exactly?

Nazar
Thank you for your prompt response, we believe it is happening when user(s) are sharing screens. Our business case is to allow users to share screens so , after a few users have shared their screens in quick succession the worker crashes. not sure if this piece of log helps but we see

2021-06-13T15:42:59: 2021-06-13T22:42:59.432Z mediasoup:ERROR:Channel Producer Channel error: Error: write EPIPE

2021-06-13T15:42:59: xxxxxxxxxxxxxx
and then the crash

We also see a lot of

6|Mediasou | 2021-06-13T18:44:41: 2021-06-14T01:44:41.965Z mediasoup:Channel [pid:3544] RTC::RTCP::XR::Parse() | unknown RTCP XR block type [blockType:42]
6|Mediasou | 2021-06-13T18:44:42: 2021-06-14T01:44:42.462Z mediasoup:Channel [pid:3544] RTC::RTCP::XR::Parse() | unknown RTCP XR block type [blockType:42]

in our log file when we do screen sharing … not sure if these issues are inter related

Those are harmless.

EPIPE indicates that the channel you’re writing to is already closed. Not sure why that is happening, but is shoudn’t be related to screen sharing as mediasoup doesn’t care what kind of video you’re sending.

Check application logic in case you accidentally close worker.

not the application but linux OOM was killing it…whew I was getting a bit nervous about this…Thank you Nazar for brain storming with me … thats what made me look at the platform… what is not clear is why memory spike was not showing high in metrics but adding 1 GB swap did the trick

If there is more info about this please let’s move it to Crash when sharing screen from Chrome using VP9 SVC · Issue #588 · versatica/mediasoup · GitHub

Sorry, ignore it. Not related.

If you kill mediasoup-worker process with a SIGABRT signal it will generate a core dump (assuming you have set those properly). I cannot help if PM2 is in use, but I think it should not make any different.