[unixODBC-dev] SQLFETCH api is crashing

Nick Gorham nick at lurcher.org
Sat Jul 21 10:31:42 BST 2012

On 20/07/12 12:17, Radhesh Krishnan K wrote:
> Hi all,
> I was trying to use odbc api for my application. And my application is 
> crashing inside the sqlfetch odbc api.
> Version of unixODBC is 2.3.1.
> This is the backtrace I got from gdb :
> #0  0xffffe424 in __kernel_vsyscall ()
> #1  0x002a7df0 in raise () from /lib/libc.so.6
> #2  0x002a9701 in abort () from /lib/libc.so.6
> #3  0x002e03ab in __libc_message () from /lib/libc.so.6
> #4  0x00367031 in __stack_chk_fail () from /lib/libc.so.6
> #5  0x446d4f74 in ?? () from /usr/lib/libodbc.so.1
> #6  0x446e240c in shmget () from /usr/lib/libodbc.so.1
> #7  0xbfea4788 in ?? ()
> #8  0x4468fad6 in SQLFetch () from /usr/lib/libodbc.so.1
> I am not able to figure it out what is the problem! Could someone help 
> me to resolve this issue.
Well, the only shmget in the driver manager is in the stats collection 
module, that I don't think builds by default, but from the /usr/lib 
location you may not be using the version you think you are.

Even if it is the right version and the gdb trace is correct (you may 
find its not getting the symbols from the lib you expect), the call that 
uses shmget is only called from handle allocation and not SQLFetch.

The most likely cause of a failure in a SQLFetch is you have bound some 
memory in a SQLBindCol that either has a invalid address, or more likely 
has gone out of scope (bound a automatic variable and then returned from 
that function).


More information about the unixODBC-dev mailing list