Edit report at http://bugs.php.net/bug.php?id=54007&edit=1
ID: 54007 Updated by: ka...@php.net Reported by: ken at focusschoolsoftware dot com Summary: odbc seg faults with null data returned from DB2 -Status: Open +Status: Feedback Type: Bug Package: ODBC related Operating System: Linux PHP Version: 5.3.5 Block user comment: N Private report: N New Comment: Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php for *NIX and http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32 Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2011-02-13 16:23:02] ken at focusschoolsoftware dot com Description: ------------ This bug happens in many of the odbc functions that handle results from a query, but I'll point out one example: The default case in php_odbc.c: default: if (result->values[field_ind].vallen == SQL_NULL_DATA) { RETURN_NULL(); } else { RETURN_STRINGL(result->values[field_ind].value, result- >values[field_ind].vallen, 1); } break; result->values[field_ind].vallen seems to be corrupted when fetching NULL data on a 64-bit system. Since it does not equal SQL_NULL_DATA, the else clause is executed causing a seg fault because it is trying to handle a NULL case. Test script: --------------- I have no test script to show, because the only as400/db2 server I have access to is behind a VPN at the moemnt. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54007&edit=1