Asterisk crashes in retrans_pkt (chan_sip.c:1255)


Situaiton is the following:
Asterisk is installed in a closed network in different country, there is no ability to play. Asterisk crashes, according to the core dump it happens in retrans_pkt function (chan_sip.c:1255).

Line content is:

This is a “standard” cause:
(gdb) x/i $pc
=> 0x7f5ba7835439: Cannot access memory at address 0x7f5ba7835439

I found a similar bug for asterisk 1.4.9:, it is fixed and I can confirm that another client works fine with asterisk 1.4.44.

The 1.4.44 code in this place is changed:

for (prev = NULL, cur = pkt->owner->packets; cur; prev = cur, cur = cur->next) { if (cur == pkt) break; }

The problem is that I cannot just upgrade asterisk - there are a lot of dependencies on it and business restrictions/regulations.

Question: Cause it happens only sometime - is there any way to find a condition why it could happen, probably someone had this experience?

Some other info:
OS: RedHat 5.4 x64
Kernel: 2.6.25

Thank you!

You are running an -ultra-mega- unsupported version of asterisk.

It will be eight years since mainstream support ended on Thursday, and it is more than six years since all support ceased.