Bug #53007 [Bgs]: crash when result set contains NULL
| From: | crewone at gmail dot com | Date: | Sat, 30 Oct 2010 07:41:50 +0000 |
| Subject: | Bug #53007 [Bgs]: crash when result set contains NULL | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-155638@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53007&edit=1
ID: 53007
User updated by: crewone at gmail dot com
Reported by: crewone at gmail dot com
Summary: crash when result set contains NULL
Status: Bogus
Type: Bug
Package: ODBC related
Operating System: ubuntu 10.4 amd64
PHP Version: 5.3.3
Block user comment: N
New Comment:
Weird that nobody seems to fix this, even though the fix is simple and
available.
Previous Comments:
------------------------------------------------------------------------
[2010-10-30 00:53:57] lindoja at juno dot com
I've also experienced ODBC crashing PHP when the result set contains a
Null (and sometimes even when it does not). This occurs when accessing
NUMBER fields in a Pervasive database via an ODBC DSN.
The workaround I found is to add zero or an empty string to the start of
the results rather than returning them directly.
i.e. instead of 'Select "MyNumber","MyString" FROM
"MyTable"', you'd do
this:
'Select 0 + "MyNumber" As "MyNumber", '' + "MyString"
As "MyString" FROM
"MyTable"'
------------------------------------------------------------------------
[2010-10-07 02:26:15] felipe@php.net
Duplicated of bug #52554
------------------------------------------------------------------------
[2010-10-07 02:06:10] crewone at gmail dot com
Description:
------------
PHP (CLI) crashes (Segfault) on a NULL in the result set.
- latest easysoft odbc-odbc bridge and unixODBC-2.3.0 (compiled from
source)
- php-5.3.3 compiled from source (--with-unixODBC)
Database is a PROGRESS OPENEDGE 10.1C database.
Actual result:
--------------
#0 0x00007ffff5386085 in memcpy () from /lib/libc.so.6
#1 0x00000000006dee08 in _estrndup (s=0x1331c08 "\030\034\063\001",
length=
<value optimized out>) at /usr/include/bits/string3.h:52
#2 0x0000000000579b6a in zif_odbc_result (ht=<value optimized out>,
return_value=0x1332c60, return_value_ptr=<value optimized out>,
this_ptr=<value
optimized out>, return_value_used=<value optimized out>)
at /usr/src/php-5.3.3/ext/odbc/php_odbc.c:2110
#3 0x0000000000746a3c in zend_do_fcall_common_helper_SPEC
(execute_data=0x7ffff7e8ab58) at
/usr/src/php-5.3.3/Zend/zend_vm_execute.h:316
#4 0x000000000071ebd8 in execute (op_array=0x10b4380) at /usr/src/php-
5.3.3/Zend/zend_vm_execute.h:107
#5 0x00000000006f982a in zend_execute_scripts (type=8, retval=<value
optimized
out>, file_count=3) at /usr/src/php-5.3.3/Zend/zend.c:1194
#6 0x00000000006a80ed in php_execute_script (primary_file=<value
optimized
out>) at /usr/src/php-5.3.3/main/main.c:2260
#7 0x000000000078064e in main (argc=<value optimized out>, argv=<value
optimized out>) at /usr/src/php-5.3.3/sapi/cli/php_cli.c:1192
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53007&edit=1