Red Hat Bugzilla – Bug 831941
ODBC driver segfault accessing null value from DB2 database
Last modified: 2014-02-02 17:11:10 EST
Description of problem:
In php with ODBC driver tries to access null value from DB2 database getting segfault.
Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux Client release 6.2 (Santiago)
Always with DB2 database
Steps to Reproduce:
1.Create DB2 database with one value NULL
2.Write code which will fetch values from database in php using unixODBC driver
3.You will get segfault for NULL value
segfault occurs for NULL value
segfault did not occur
Created attachment 591750 [details]
AFAIK we do not ship or support any ODBC driver for DB2. What driver is being used here?
Customer is using unixODBC-2.2.14-11.el6.x86_64 to connect DB2 database.
unixODBC, by itself, is incapable of connecting to any database. It needs a driver module for the particular database type, and we do not ship one for DB2.
So, again, what are they using?
Sorry I did not know the concept of driver module.
In my case PHP-ODBC-MySQL I installaed unixODBC driver and add driver entry to /etc/odbc.ini.
So this might be a module to connect database.
Correct me if I am wrong.
(In reply to comment #10)
> > DRIVER=/usr/lib64/libodbcmyS.so
Did that actually work? Because libodbcmyS.so is the GUI setup library associated with the mysql driver, not the mysql driver itself. The driver entry ought to be something like /usr/lib64/libmyodbc3_r.so.
In any case, the mysql driver wouldn't work with DB2, unless DB2 is exactly emulating mysql's connection protocol which seems highly unlikely. So I'm still wondering what the customer is using.
The bottom line here is that I suspect they are using some third-party driver that hasn't been built to be compatible with unixODBC 2.2.14. There's been some unfortunate instability in the ABI for unixODBC on 64-bit platforms, and if they are using a driver that was built against, say, RHEL5's unixODBC 2.2.11, this type of failure is not surprising at all.
You were right. From comment #13 it looks like cu might be using some third party libraries to connect DB2 database.
$ cat /etc/odbcinst.ini
Description = DB2 Driver
Driver = /home/db2admin/sqllib/lib32/libdb2.so
Driver64 = /home/db2admin/sqllib/lib64/libdb2.so
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.
Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.
This Bugzilla has been reviewed by Red Hat and is not planned on being addressed in Red Hat Enterprise Linux 6, and will be closed. If this bug is critical to production systems, please contact your Red Hat support representative and provide sufficient business justification.