Asterisk Crash : Segmentation Fault

Hi Everyone,
For the past few days, I have been facing segmentation fault error which is intermittent on the asterisk server. This server was working fine till now. The fault is not caused due to any load it just happens sometimes and asterisk reloads all the modules and It works fine after that.
Below is the error I am getting the following message on centos logs.
[13066.575029] asterisk[17848]: segfault at 8 ip 00007f8b46816ff9 sp 00007f8ac850c920 error 4 in libasteriskpj.so.2[7f8b466d1000+190000]

Below is the link to full.txt from astcoredump

Edit - Asterisk version - 16.10
Using chan_pjsip

I’m with the same problem and I don’t know how to fix it …

@Tiagoggsouza:
It is extremely unlikely that you have exactly the same problem!

@ashutosh_chaubey:

You didn’t mention which Asterisk version and which channel technologies. I can’t tell the former, but this is happening in chan_pjsip, during a re-INVITE.

I’m not 100% sure, but I think it may be a session timers re-INVITE, so it might be worth disabling those. Turning up logging until you can see decisions to re-INVITE is likely to be useful.

Have you tried looking at the values associated with the the pj_strdup call, to see if either them is for non-allocated memory, or shows obvious corruption?

Does it always crash in pj_strup? If not it may be memory corruption and the primary fault may lie elsewhere. Particularly in that case, looking for recent warnings and errors in the logs can be useful. Also running with thread debugging can be useful, although there is a performance penalty associated with this.

@david551
Asterisk version - 16.10
I am using chan_pjsip
Will look into the above mentioned solutions. Can you please guide me how I might be able to disable the session timers re-INVITE.

@david551
Here is another dump for another crash maybe this might help you to clear my doubt.

Thanks

Note that I’m guessing that it is a timer refresh from the names used, and because it is being run from the thread pool, but I haven’t looked at the code to confirm that.

From time to time different modules may bring to segfault.
For example, it happens on astertisk 16.x versions:

[6110490.490278] asterisk[8080]: segfault at 10 ip 00007ff0db924c1c sp 00007ff0c7b47cd0 error 4 in app_queue.so[7ff0db905000+38000]
error 4 in asterisk[556395f58000+1dd000]

If it happens with critical module - the only solution is to upgrade asterisk version and hope it will be fixed.
In other case - when possible, just disabling the module helps to escape such problems :wink: Digging the code and apply patches only takes time,efforts and sleepless nights.