[unixODBC-support] Core dump issue from UnixODBC on AIX platform

Hassan Shaik hshaik at arcot.com
Mon Nov 5 16:17:26 GMT 2007


Hi Nick,

I need few more clarifications:

1. I extracted UnixODBC2.2.13pre source and the source code in
__handles.c looks similar. Will there be any impact on this problem from
code changes in other files?

2. Adding "Threading = 0" to odbcinst.ini file is just a suggestion, and
may not solve this issue, right?

3. If the above two can't solve this problem, we need to analyze the
current code. I checked the Makefile under the directory where I built
UnixODBC2.2.12. The flag HAVE_LIBTHREAD is set there. So, following code
is active in __handles.c, 

=======================================================
#include <thread.h>

static mutex_t mutex_lists;
static mutex_t mutex_env;
static mutex_t mutex_pool;
static mutex_t mutex_iconv;

static int mutex_entry( mutex_t *mutex )
{
    return mutex_lock( mutex );
}

static int mutex_exit( mutex_t *mutex )
{
    return mutex_unlock( mutex );
}
=======================================================

Our code dumps are happening in following functions:
a. __validate_stmt (885 line:        ptr = ptr -> next_class_list; ) ptr
is statement root.

b. __release_desc (1104 line :       ptr = ptr -> next_class_list; ).
ptr is descriptor root.

But mutex_entry( &mutex_lists ) and mutex_exit( &mutex_lists ) calls are
used at start and end of these functions. I am wondering how come str
can become NULL suddenly, as we already validating for it in while loop
(using while( ptr )). 

Sorry, if I am troubling you with many questions.

Please clarify on this.

Thanks
Hassan

-----Original Message-----
From: unixodbc-support-bounces at easysoft.com
[mailto:unixodbc-support-bounces at easysoft.com] On Behalf Of Nick Gorham
Sent: Monday, November 05, 2007 8:44 PM
To: Support for the unixODBC project
Subject: Re: [unixODBC-support] Core dump issue from UnixODBC on AIX
platform

Hassan Shaik wrote:

>Hi Nick,
>
>We are using DB2 ODBC driver. Looks like, it is thread-safe; 
>http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=
>/
>com.ibm.db29.doc.odbc/db2z_lethrd.htm
>
>
>Following are the contents of odbcinst.ini file.
>
>[DB2]
>Description=DB2 ODBC Driver
>Driver=cd /home/db2inst3/sqllib/lib/libdb2.so
>Fileusage=1
>Dontdlclose=1
>
>[ODBC]
>Trace=No
>Tracefile=/opt/odbc/logs/odbc_trc.log
>
>
>So, default value for Threading level is 3, right? Do you recommend 
>adding "Threading = 0" in this file?
>
>  
>
=0 should be fine for a thread safe driver.

>Interesting thing is, when I turn on trace logging, we couldn't see 
>core dump for 2 days (because of delay introduced?).
>  
>
Yep, threading issues are always a problem.

--
Nick Gorham
Easysoft Limited
http://www.easysoft.com, http://www.unixODBC.org

_______________________________________________
unixODBC-support mailing list
unixODBC-support at easysoft.com
http://mail.easysoft.com/mailman/listinfo/unixodbc-support



More information about the unixODBC-support mailing list