[BUG?] Asterisk crashes randomly, possible ODBC issue?

Hello all,

I’ve got a weird issue on a new Asterisk 13.6.0 install. This is a fairly complex install, with ODBC logging for CDR and queue_log, and heavy use of multiple queues and AGI applications.

EDIT: Some details:
Asterisk is running on CentOS 7.2 64-bit
The database server is running on another CentOS 7.2 box. MariaDB Server version: 5.5.44-MariaDB

Periodically, I’m seeing the Asterisk process die and get rebooted by safe_asterisk (maybe a couple of times a week, usually late at night). However, it looks like this is happening consistently at the end of calls. So far, my users haven’t reported an issue, either, so it seems like it might be dying after call completion.

In my /var/log/messages:

In /var/log/asterisk/messages, with verbose and debug enabled:

[Jan 4 00:47:34] VERBOSE[21873][C-00000a5a] pbx.c: Executing [h@CONTEXT:5] NoOp("Local/3XXX@REDACTED-0000023b;2", "Call is completely over.") in new stack [Jan 4 00:47:34] VERBOSE[21874][C-00000a5a] bridge_channel.c: Channel SIP/REDACTED-0000134d left 'simple_bridge' basic-bridge <c767def7-5d37-47ea-8522-fc91a04242eb> [Jan 4 00:47:34] WARNING[9159] res_odbc.c: SetConnectAttr (Txn isolation) returned an error: HY000: [MySQL][ODBC 5.2(w) Driver]You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '7' at line 1 [Jan 4 00:47:34] WARNING[9159] res_odbc.c: SQL Execute returned an error -1: 08S01: [MySQL][ODBC 5.2(w) Driver][mysqld-5.5.44-MariaDB]MySQL server has gone away (76) [Jan 4 00:47:34] WARNING[9159] res_odbc.c: SQL Execute error -1! Verifying connection to asterisk-connector [asterisk-connector]... [Jan 4 00:47:34] WARNING[9159] res_odbc.c: Connection is down attempting to reconnect... [Jan 4 00:47:34] VERBOSE[21869][C-00000a5a] app_mixmonitor.c: MixMonitor close filestream (mixed) [Jan 4 00:47:34] VERBOSE[21869][C-00000a5a] pbx.c: Executing [h@CONTEXT2:3] AGI("SIP/REDACTED-1-0000134c", "queue_hangup.php,1451889809.9861") in new stack [Jan 4 00:47:40] Asterisk 13.6.0 built by root @ HOSTNAME on a x86_64 running Linux on 2015-12-11 17:46:18 UTC [Jan 4 00:47:40] VERBOSE[22121] manager.c: Manager registered action DBGet

Now, I will say that I never noticed that ODBC error before when it has crashed, but I also had logging configured not to store as much verbosity.

I’ve also got coredumps. Unfortunately, they are from a build that was complied with optimizations.

Jan 4 crash: pastebin.com/9tyXj0zR
Dec 29 crash: pastebin.com/VavV0iB6

I know I really need DONT_OPTIMIZE for these core dumps, and I’ll get one ASAP. I’ll see if I can get this production Asterisk reinstalled during off-peak hours without optimizations, but in the interim, can anyone see from these dumps if there’s anything I can do to make it stop crashing?

In the hangup context ‘h’, have you tried DeadAGI instead of AGI ?

Also, what happens when you do not load the ODBC modules ?

DeadAGI is obsolete.

This is a prod box so not having CDRs isn’t going to fly… and unfortunately, it only seems to happen rarely, so I need those production calls going through it.

Thankfully, I finally got a real backtrace on this, so the issue has been submitted to the bugtracker. :smile: