Asterisk crashes from time to time after upgrade to 13.17.0

Hi,

I am running FreePBX distro with asterisk 13.17.0. After I performed an upgrade to this version, asterisk became unstable and crashes once or twice a week.

I have around 500 extensions all on the PJSIP, with approx. 250 online. Usually no more than 40 calls are present at any given time. There is no problem with CPU utilization (0.5 from 8), memory, swapping or network issues I can detect.

Backtrace from the last crash core can be found here: backtrace

Before an upgrade, I ran Asterisk 13.15 with no significant issues.

Any suggestion on how to track the problem and if possible fix it is welcome.

Thank you

Your backtrace is optimized so it’s not really useful except to say it may have been something in SIP. The wiki[1] has details on how to enable the things to ensure that the backtrace is useful.

[1] https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace

The backtrace is not only optimised, it is from a build without debug symbols.

FreePBX users tend to use pre-built versions of Asterisk, so generally have problems creating a debug build, especially one that matches the one in use.

This may be helpful, although I have a feeling it only solves the lack of debug symbols and not the optimisation issue: https://wiki.freepbx.org/display/SUP/Providing+Great+Debug#ProvidingGreatDebug-Backtraces(Segfaults/CoreDumps/AsteriskCrashing)

Ah yes, I forgot about FreePBX. Thanks for the link.

Thank you for an answer. Maybe I did something wrong, but my “core show settings” tells me otherwise:

PBX Core settings

Version: 13.17.0
Build Options: DONT_OPTIMIZE, COMPILE_DOUBLE, OPTIONAL_API

I have tried the script from the page you suggested, now core-full.txt looks as follows: core-full.txt

I cannot tell anything about the debug symbols though. As for the FreePBX page, using the command from there I got the previous trace.

Thank you both very much.

Stuff still seems to be optimized and not overly useful. I’m not familiar with the FreePBX environment so I don’t really know how best to get it within their world.

Very well, thank you Joshua, I will ask there how to make the debug usable for you guys as well. I will paste it here again, if I move somewhere.

Thank you very much for your time.

Hi again,

I downgraded to asterisk 13.16 and it took it 14 days before the crash occured. I created a backtrace that is hopefully of some use now. You can find it in the link below. Could you please tell me if there is something that is possible to learn from the backtrace so that I can prevent crashes from occuring? In syslog, there is a message:

asterisk[18584]: segfault at 7f3632322e6e ip 00007fafc228472f sp 00007fafbcc80710 error 4 in libasteriskpj.so.2[7fafc2204000+180000]

Therefore I assume it is connected to PJSIP somehow and probably switching back to chan_sip might solve the issue. My preference is to stick with PJSIP though.

Link to a backtrace: backtrace

Any opinion/advice is welcome. Thank you.

is there really no-one that could point me to a direction on how to solve this?

Someone has to dig in and try to identify the particular case and situation that is causing the crash. I can say it’s not a crash I’ve ever seen before. You can file an issue on the issue tracker[1] but I have no time frame on when it would get looked into.

[1] https://issues.asterisk.org/jira

1 Like

Thank you, Joshua. It is perfectly fine, I understand you guys are pretty busy. I will do as you say.

Thank you very much for your time and effort.

Having the same issue you are. Have posted on these forums, as well as FreePBX. However, I’m using chan_sip only.

What are you doing in the meantime? Just taking the crashes, or have you reverted to an older version of Asterisk?

Also, is this a VM? If so, running on KVM?

Well, I downgraded to 13.16 and the problem became much less frequent (with 13.17 I got a crash every 3-4 days, now I am on once a fortnight). 13.15 worked for me with same configuration for two months with just higher CPU spikes than I am used to. PJSIP is probably not so production-ready as it is presented everywhere and needs a lot of optimization effort devoted to it.

In syslog, I always get pjproject errors in time of crash, so I strongly believe my issue is connected directly or indirectly with PJPROJECT. But I cannot be sure, since my knowledge of Asterisk code is very limited and level of understanding of backtraces is close to zero.

To the second question, yes I run it on KVM. I have been through a lot of sources telling the old kernel 2.6.32 (FreePBX has this one) can have some trouble on KVM, so I hoped upgrading to SNG7 might mitigate the issue, but there is no production ready upgrade path as far as I know.

This is a pattern I keep noticing. That said, the Sangoma team says they use KVM as well, though not sure what favor. We’re using proxmox 4.4.

Are you using TCP or SIP, or just UDP?

You should contact Sangoma. They made the decision to create their own OS and their own RPMs for their distro so they need to provide support for things like this themselves.

I was running that version of Asterisk on KVM for awhile and haven’t had any problems but I compile it from source.

Thanks for your input.

Did you compile asterisk with any specifics? And it sounds like you aren’t running it on KVM anymore? If not, why?

My experience is that you have to disable BUILD_NATIVE for KVM. I don’t think that is your problem because as far as I know the RPM’s already do that.

https://wiki.asterisk.org/wiki/display/AST/Building+and+Installing+Asterisk#BuildingandInstallingAsterisk-Buildingfornon-nativearchitectures