Asterisk restarting

Hello,

For last few days, I am experiencing frequent asterisk restarts.

From the logs and GDB it seems to be some issue in libnspr4.so library but I am not able to figure out WHY? And certainly do not know how to fix it?

Below is the data that I have gathered.

In /var/log/messages

Apr 15 09:32:44 blr-dev-1 kernel: asterisk[29768]: segfault at a646574 ip 0000003727a145b2 sp 00007f01bbc9ad70 error 4 in libnspr4.so[3727a00000+39000]

Applying GDB,

[code]Thread 6 (Thread 0x7fd9a9e5b700 (LWP 7102)):
#0 0x0000003a4060b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x0000000000544172 in tps_processing_function ()
#2 0x000000000055243b in dummy_start ()
#3 0x0000003a40607851 in start_thread () from /lib64/libpthread.so.0
#4 0x0000003a402e767d in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7fd95d3bf700 (LWP 7142)):
#0 0x0000003a4060b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fd97308e7f1 in iax2_process_thread (data=0x329ea20) at chan_iax2.c:11803
#2 0x000000000055243b in dummy_start ()
#3 0x0000003a40607851 in start_thread () from /lib64/libpthread.so.0
#4 0x0000003a402e767d in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7fd9aa04b700 (LWP 7095)):
#0 0x0000003a4060b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x0000000000544172 in tps_processing_function ()
#2 0x000000000055243b in dummy_start ()
#3 0x0000003a40607851 in start_thread () from /lib64/libpthread.so.0
#4 0x0000003a402e767d in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7fd9aa269800 (LWP 7094)):
#0 0x0000003a402ddfc3 in poll () from /lib64/libc.so.6
—Type to continue, or q to quit—
#1 0x00000000004389d2 in monitor_sig_flags ()
#2 0x000000000043b557 in main ()

	Thread 2 (Thread 0x7fd95d533700 (LWP 7139)):

#0 0x0000003a4060b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fd97308e7f1 in iax2_process_thread (data=0x329b020) at chan_iax2.c:11803
#2 0x000000000055243b in dummy_start ()
#3 0x0000003a40607851 in start_thread () from /lib64/libpthread.so.0
#4 0x0000003a402e767d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7fd95c89b700 (LWP 8341)):
#0 0x0000003727a145b2 in ?? () from /lib64/libnspr4.so
#1 0x0000003727a28cfd in ?? () from /lib64/libnspr4.so
#2 0x0000003727a28d73 in ?? () from /lib64/libnspr4.so
#3 0x0000003a406078e9 in start_thread () from /lib64/libpthread.so.0
#4 0x0000003a402e767d in clone () from /lib64/libc.so.6

[/code]

ls -ltr /lib64/libnspr4.so 
-rwxr-xr-x 1 root root 243096 Feb  1 00:54 /lib64/libnspr4.so

Please help me to fix it.

Thanks,
Rawat

It seems to be failing in pthreads during a thread startup, or just possibly, a thread shutdown.

I would consider the possibility of memory corruption, and look for primary errors in the log, in the minutes leading up to the crash.

I’d also try to work out why a thread would have just been started.

However, this is likely to be difficult to debug.

Is this code which is unmodified from the official source distribution, and is it a recent version on the 1.8 or 11 branches? If so, I would raise it issues.asterisk.org, but don’t expect a quick fix. You will need logs at verbose level 5 and possibly also at debug level 5.

As you seem to be using IAX, you may need IAX protocol debugging enabled.