Summary:ASTERISK-09760: Func_odbc causes crash
Reporter:Andrew Pepler (pep)Labels:
Date Opened:2007-06-26 09:15:42Date Closed:2011-06-07 14:00:18
Versions:Frequency of
Environment:Attachments:( 0) output12497.txt
( 1) requestedoutput.rtf
Description:I am using func_odbc to connect to a sybase database via tds.
Occasionally this causes Asterisk to crash but I am not able to recreate it.  The same sql query used in func_odbc will not cause a re-crash.


I am using func_odbc in a non-standard way in that I pass a whole query to the function from the dialplan rather than just a variable.

This is the entry in func_odbc.conf

Comments:By: Tilghman Lesher (tilghman) 2007-06-26 09:43:19

Please specify the version of unixODBC, the driver you're using to connect to Sybase and its version.

By: Andrew Pepler (pep) 2007-06-26 10:00:11

I am using UnixODBC 2.2.12 and freetds 0.64.
The Sybase database is ASA 7.0.4

By: Tilghman Lesher (tilghman) 2007-06-26 10:33:22

In gdb, with this core, I need to see the output of:

p *statement
p *(DMHSTMT)statement_handle

FYI, this would appear to be a bug in unixODBC, but I would like to be sure, before I send you upstream to them.

By: Andrew Pepler (pep) 2007-06-26 17:08:08

I have uploaded the requested output.

By: Tilghman Lesher (tilghman) 2007-06-27 07:54:45

Okay, I'm satisfied that this is a bug in unixODBC.  Please report this issue to their development team.

By: Andrew Pepler (pep) 2007-06-27 09:33:11

Can you give me an idea of how Asterisk is causing this bug in unixODBC, i.e. if there is something I can avoid to stop crashing Asterisk.

Also, as this bug is causing Asterisk to crash, shouldn't Asterisk be able to handle this case and not crash?

By: Tilghman Lesher (tilghman) 2007-06-27 16:58:39

I don't know the answer to any of those questions, other than to say that if a library segfaults the process, it will take Asterisk down.  This could also be a bug in FreeTDS, for that matter, but the code which is segfaulting is clearly UnixODBC, not FreeTDS.

By: Tilghman Lesher (tilghman) 2007-07-31 11:41:59

Closing, as the issue is in the interaction between UnixODBC and FreeTDS, not fixable within Asterisk.