Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have connected an openSUSE LAMP and an Ubuntu LAMP server to DB2 using ODBC. The openSUSE system we're using for a development environment, and the final deployment is to be on the Ubuntu system. On Ubuntu we get segfaults when SQL statements return nulls (see links to related bug reports), but this does not happen on openSUSE. Both machines are running 64-bit, here are the versions of both boxes and their software:

OS         Version    Kernel                Apache    PHP
openSUSE   12.2       3.4.11-2.16-default   2.2.22    5.3.15
Ubuntu     11.04      2.6.38-11-server      2.2.17    5.3.22-1~dotdeb.0
                                       (upgraded from 5.3.5-1ubuntu7)

Links:
https://bugs.php.net/bug.php?id=59405
https://bugs.php.net/bug.php?id=54007

Reading the changelog on php.net it looked like the bug was fixed in 5.3.11 but upgrading still has not solved our issue. I have finally compared phpinfo() output from both servers line-by-line and found one portion that seems like a red flag, but no idea how to fix this. In the ODBC section the ODBC_LFLAGS option shows:

openSUSE     -L/usr/lib64
Ubuntu       -L/usr/lib

Both systems are 64-bit, and are configured to use the 64-bit version of iSeriesAccess and unixODBC. iSeriesAccess had to be converted from RPM using alien as IBM doesn't support Ubuntu. Unfortunately upgrading Ubuntu or switching distros are not options for us. How can I switch Ubuntu to use /usr/lib64 for ODBC_LFLAGS? Also is there any other problem I may have overlooked?

share|improve this question
    
Did you find a solution to this problem? I am having the same issue with PHP 5.5.12 and unixODBC 2.3 on Ubuntu 14.10 64bit. I am also having the same problem on Windows 7 64 bit. I have managed to trace it to PDOExecute, but cannot get any further than that. The SQL query I'm using is a guaranteed result containing 4 columns with max length of 15 chars. The unixODBC log shows the SQL being executed and the parameters being passed to it, but then it seg faults. –  Paul Taylor Oct 29 at 22:59
    
No, we're actually running in production with this bug. Our solution was to coalesce every field, which obviously isn't ideal. We're also not using PDO. As I said though, it's only when the statement returns nulls, otherwise everything runs fine. –  MaKR Oct 30 at 21:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.