[Home]

Summary:ASTERISK-23615: logger reload causes asterisk to crash
Reporter:Pascal Cadotte Michaud (pcadotte)Labels:
Date Opened:2014-04-10 10:18:01Date Closed:2014-04-14 11:25:08
Priority:MajorRegression?
Status:Closed/CompleteComponents:
Versions:11.8.1 Frequency of
Occurrence
Frequent
Related
Issues:
Environment:debian wheezyAttachments:( 0) bt1.txt
( 1) bt2.txt
Description:We have an asterisk under load with calls distributed to queues.

If I run watch -n 0.5 "asterisk -rx 'logger reload'" on the asterisk server asterisk crashes every 2 or 3 minutes.
Comments:By: Pascal Cadotte Michaud (pcadotte) 2014-04-10 10:22:41.454-0500

The output of "gdb -batch -ex 'thread apply all bt' asterisk" the two of the core dumps

By: Matt Jordan (mjordan) 2014-04-14 11:07:54.480-0500

This doesn't look to be a bug in Asterisk so much as in either the PostgreSQL library and/or the OpenSSL library.

{noformat}
Thread 1 (Thread 0xb2c02b70 (LWP 28967)):
#0  0xb7761416 in __kernel_vsyscall ()
#1  0xb7619941 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0xb761cd72 in *__GI_abort () at abort.c:92
#3  0xb7655e15 in __libc_message (do_abort=2, fmt=0xb772f450 "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:189
#4  0xb765ff01 in malloc_printerr (action=<optimized out>, str=0x6 <Address 0x6 out of bounds>, ptr=0x83bd900) at malloc.c:6312
#5  0xb7661768 in _int_free (av=<optimized out>, p=<optimized out>) at malloc.c:4824
#6  0xb76648ad in *__GI___libc_free (mem=0x83bd900) at malloc.c:3738
#7  0xb721c7ca in CRYPTO_free (str=str@entry=0x83bd900) at mem.c:397
#8  0xb72e1e1f in X509_VERIFY_PARAM_free (param=0x83bd900) at x509_vpm.c:100
#9  0xb73c8337 in SSL_free (s=0x83bd690) at ssl_lib.c:526
#10 0xb622df1a in close_SSL (conn=conn@entry=0x83b3cb8) at /build/postgresql-9.1-O8Okgh/postgresql-9.1-9.1.12/build/../src/interfaces/libpq/fe-secure.c:1544
#11 0xb622e023 in pqsecure_close (conn=conn@entry=0x83b3cb8) at /build/postgresql-9.1-O8Okgh/postgresql-9.1-9.1.12/build/../src/interfaces/libpq/fe-secure.c:323
#12 0xb6224b41 in pqReadData (conn=conn@entry=0x83b3cb8) at /build/postgresql-9.1-O8Okgh/postgresql-9.1-9.1.12/build/../src/interfaces/libpq/fe-misc.c:758
#13 0xb62227ae in PQgetResult (conn=conn@entry=0x83b3cb8) at /build/postgresql-9.1-O8Okgh/postgresql-9.1-9.1.12/build/../src/interfaces/libpq/fe-exec.c:1540
#14 0xb6222a48 in PQexecFinish (conn=conn@entry=0x83b3cb8) at /build/postgresql-9.1-O8Okgh/postgresql-9.1-9.1.12/build/../src/interfaces/libpq/fe-exec.c:1825
#15 0xb6222e13 in PQexec (conn=0x83b3cb8, query=query@entry=0xb1881694 "INSERT INTO queue_log (time, callid, queuename, agent, event, data1, data2, data3, data4, data5) VALUES ('2014-04-10 11:01:02.777771', '1397142055.178', 'queue11002', 'Agent/9034', 'CONNECT', '6', '13"...) at /build/postgresql-9.1-O8Okgh/postgresql-9.1-9.1.12/build/../src/interfaces/libpq/fe-exec.c:1659
#16 0xb5922af2 in _pgsql_exec (result=0xb2bf894c, sql=0xb1881694 "INSERT INTO queue_log (time, callid, queuename, agent, event, data1, data2, data3, data4, data5) VALUES ('2014-04-10 11:01:02.777771', '1397142055.178', 'queue11002', 'Agent/9034', 'CONNECT', '6', '13"..., tablename=0xb2bf8aac "queue_log", database=0xb59313a0 "asterisk") at res_config_pgsql.c:160
{noformat}

In both backtraces, the crash occurs during some interaction of the PostgreSQL library and an SSL function. The fact that your database connection is secured using OpenSSL is actually outside of Asterisk's control - {{res_pgsql.conf}} simply instructs Asterisk where to find the dbsock.

I would raise this issue in the PostgreSQL issue tracker.

By: Matt Jordan (mjordan) 2014-04-14 11:25:08.569-0500

Closing as Not a Bug in Asterisk. Doing a quick google search did turn up other crashes in SSL/PostgreSQL interaction, so the issue is likely to be in their court.