php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23376 crash using OCINewDescriptor
Submitted: 2003-04-27 17:43 UTC Modified: 2003-05-02 03:38 UTC
From: francesco dot laurita at NOSPAM_fastweb dot it Assigned:
Status: Closed Package: OCI8 related
PHP Version: 4-STABLE-200304291530 OS: Linux 2.4.19
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: francesco dot laurita at NOSPAM_fastweb dot it
New email:
PHP Version: OS:

 

 [2003-04-27 17:43 UTC] francesco dot laurita at NOSPAM_fastweb dot it
PHP crash when i try to execute this (wrong) pice of code:

$id = OciLogon("user","pass","db");
$sql = "BEGIN UTENTI_PKG.SEL_ALL_USER(:retVal);END;";
$stmt = OCIParse($id,$sql);
$cur = OCINewDescriptor($id, OCI_B_CURSOR);
OciBindByName($stmt, ':retVal' , &$cur , -1 , OCI_B_CURSOR);
OciExecute($stmt);

error:
[root@stealthp htdocs]# php -q info.php 
Warning: Unknown descriptor type 116. in /usr/local/apache/htdocs/info.php on line 8
Segmentation fault (core dumped)
[root@stealthp htdocs]#

gdb output:
[root@stealthp htdocs]# gdb /usr/local/bin/php core.6325 
GNU gdb 5.2.1-2mdk (Mandrake Linux)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-mandrake-linux-gnu"...
Core was generated by `php -q info.php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libz.so.1...done.
Loaded symbols for /lib/libz.so.1
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /lib/i686/libm.so.6...done.
Loaded symbols for /lib/i686/libm.so.6
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /opt2/oracle/product/9.2.0/lib/libclntsh.so.9.0...done.
Loaded symbols for /opt2/oracle/product/9.2.0/lib/libclntsh.so.9.0
Reading symbols from /lib/i686/libc.so.6...done.
Loaded symbols for /lib/i686/libc.so.6
Reading symbols from /opt2/oracle/product/9.2.0/lib/libwtc9.so...done.
Loaded symbols for /opt2/oracle/product/9.2.0/lib/libwtc9.so
Reading symbols from /lib/i686/libpthread.so.0...done.
Loaded symbols for /lib/i686/libpthread.so.0
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
#0  0x08072b7a in zif_ocinewdescriptor (ht=2, return_value=0x81ed864, this_ptr=0x0, return_value_used=1)
    at /root/php-4.3.1/ext/oci8/oci8.c:3538
3538            add_property_resource(return_value, "descriptor", descr->id);
(gdb) bt
#0  0x08072b7a in zif_ocinewdescriptor (ht=2, return_value=0x81ed864, this_ptr=0x0, return_value_used=1)
    at /root/php-4.3.1/ext/oci8/oci8.c:3538
#1  0x081283c6 in execute (op_array=0x81d9a24) at /root/php-4.3.1/Zend/zend_execute.c:1596
#2  0x0811b267 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /root/php-4.3.1/Zend/zend.c:864
#3  0x080f464e in php_execute_script (primary_file=0xbffff6e0) at /root/php-4.3.1/main/main.c:1573
#4  0x0812cf3f in main (argc=3, argv=0xbffff774) at /root/php-4.3.1/sapi/cli/php_cli.c:746
#5  0x409c0082 in __libc_start_main () from /lib/i686/libc.so.6
(gdb) frame 1
#1  0x081283c6 in execute (op_array=0x81d9a24) at /root/php-4.3.1/Zend/zend_execute.c:1596
1596                                                            ((zend_internal_function *) EX(function_state).function)->handler(EX(opline)->extended_value, EX(Ts)[EX(opline)->result.u.var].var.ptr, EX(object).ptr, return_value_used TSRMLS_CC);
(gdb) exit
Undefined command: "exit".  Try "help".
(gdb) quit
[root@stealthp htdocs]#

configure option:
'./configure' \
'--enable-ftp' \
'--with-apxs=/usr/local/apache/bin/apxs' \
'--with-oci8=/opt2/oracle/product/9.2.0' \
'--with-mysql=/usr/local/mysql' \
'--enable-sigchild' \
'--enable-cli' \

ini file:
default values

best regads!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-29 10:51 UTC] francesco dot laurita at NOSPAM_fastweb dot it
The problem is also in the last CVS Snap.
I've used the same configuration.
This is the gdb output:

[root@stealthp cli]# ./php -q ../../uu.php 

Warning: ocinewdescriptor(): Unknown descriptor type 116. in /root/php4-STABLE-200304291530/uu.php on line 5
Segmentation fault (core dumped)
[root@stealthp cli]# gdb php core.30583    
GNU gdb 5.2.1-2mdk (Mandrake Linux)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-mandrake-linux-gnu"...
Core was generated by `./php -q ../../uu.php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libz.so.1...done.
Loaded symbols for /lib/libz.so.1
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /lib/i686/libm.so.6...done.
Loaded symbols for /lib/i686/libm.so.6
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /opt2/oracle/product/9.2.0/lib/libclntsh.so.9.0...done.
Loaded symbols for /opt2/oracle/product/9.2.0/lib/libclntsh.so.9.0
Reading symbols from /lib/i686/libc.so.6...done.
Loaded symbols for /lib/i686/libc.so.6
Reading symbols from /opt2/oracle/product/9.2.0/lib/libwtc9.so...done.
Loaded symbols for /opt2/oracle/product/9.2.0/lib/libwtc9.so
Reading symbols from /lib/i686/libpthread.so.0...done.
Loaded symbols for /lib/i686/libpthread.so.0
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
#0  0x080732ba in zif_ocinewdescriptor (ht=2, return_value=0x81f4c64, this_ptr=0x0, return_value_used=1)
    at /root/php4-STABLE-200304291530/ext/oci8/oci8.c:3621
3621            add_property_resource(return_value, "descriptor", descr->id);
(gdb) bt
#0  0x080732ba in zif_ocinewdescriptor (ht=2, return_value=0x81f4c64, this_ptr=0x0, return_value_used=1)
    at /root/php4-STABLE-200304291530/ext/oci8/oci8.c:3621
#1  0x0812a2f6 in execute (op_array=0x81e11b4) at /root/php4-STABLE-200304291530/Zend/zend_execute.c:1606
#2  0x0811d077 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /root/php4-STABLE-200304291530/Zend/zend.c:864
#3  0x080f5c09 in php_execute_script (primary_file=0xbffff760) at /root/php4-STABLE-200304291530/main/main.c:1637
#4  0x0812ef9c in main (argc=3, argv=0xbffff7f4) at /root/php4-STABLE-200304291530/sapi/cli/php_cli.c:786
#5  0x409cd082 in __libc_start_main () from /lib/i686/libc.so.6
(gdb) frame 1
#1  0x0812a2f6 in execute (op_array=0x81e11b4) at /root/php4-STABLE-200304291530/Zend/zend_execute.c:1606
1606                                                            ((zend_internal_function *) EX(function_state).function)->handler(EX(opline)->extended_value, EX(Ts)[EX(opline)->result.u.var].var.ptr, EX(object).ptr, return_value_used TSRMLS_CC);
(gdb) quit
[root@stealthp cli]# 

best regards
 [2003-05-02 03:38 UTC] thies@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun May 22 20:05:44 2022 UTC