Summary:ASTERISK-17199: Asterisk may crash when PostgreSQL database is reconnecting
Reporter:Ramon Peek-Fares (ramonpeek)Labels:
Date Opened:2011-01-04 05:04:22.000-0600Date Closed:2011-07-27 13:18:56
Versions:Frequency of
Environment:Attachments:( 0) backtrace.txt
( 1) backtrace-full.txt
( 2) backtrace-threads.txt
( 3) gdb.tar.gz
Description:Asterisk may crash when PostgreSQL database is reconnecting.
This may occur when an invalid SQL query causes a reconnect procedure whilst at the same time other threads are trying to access the database.

!See Steps to Reproduce!

****** STEPS TO REPRODUCE ******

By using this simple dialplan the error can be triggered.

exten = 800,1,Dial(Local/461@local&Local/462@local&Local/463@local&Local/464@local&Local/465@local&Local/466@local&Local/467@local&Local/468@local,120,g)
exten = 800,n,Hangup

exten = _XXX,1,Dial(SIP/${EXTEN},2,g)
exten = _XXX,n,Hangup

exten = h,1,Set(VARIABLE=${ODBC_CST(SELECT * FROM bla)}) ; Use an invalid query here!
exten = h,n,Hangup

Please note:
You must have a PostgreSQL database (ODBC_CST) configured in your func_odbc.conf
Comments:By: Ramon Peek-Fares (ramonpeek) 2011-01-04 05:05:56.000-0600

Attached gdb trace...

Might be related to issue ASTERISK-16902 (Asterisk 1.6)
However, I tried backporting the solution offered in that case but with no success

By: Leif Madsen (lmadsen) 2011-01-05 10:00:10.000-0600

Please attach the backtrace as a plain-text file and not a compressed file.

By: Ramon Peek-Fares (ramonpeek) 2011-03-23 02:22:48

Issue was fixed in Asterisk 1.4.40 rc1 via r300621 and ASTERISK-16902
Successfully tested again with Asterisk 1.4.41 rc1.

Case closed ;-)