#43340 [NEW]: Segmentation fault after executing the same proc twice
| From: | marplatense at ubuntu dot com | Date: | Tue, 20 Nov 2007 03:16:43 +0000 |
| Subject: | #43340 [NEW]: Segmentation fault after executing the same proc twice | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-119861@lists.php.net to get a copy of this message | ||
From: marplatense at ubuntu dot com
Operating system: Centos 4 64 bits
PHP version: 5.2.5
PHP Bug Type: OCI8 related
Bug description: Segmentation fault after executing the same proc twice
Description:
------------
Bug related to http://bugs.php.net/bug.php?id=37471 and
http://bugs.php.net/bug.php?id=38173 but with
version 5.2.5 (the other two
are closed but we can reproduce the error every time we run
the test case with the latest stable release)
1- My php configuration:
./configure --prefix=/opt/php/php5.2.5 --exec-prefix=/opt/php/php5.2.5
--with-config-file-path=etc/httpd/conf.d --with-libdir=lib64 --with-gd
--with-zlib=/usr --with-xmlrpc
--with-oci8=/opt/oracle/orase/oracle/product/10.2.0/db_1
--with-apxs2=/usr/sbin/apxs --enable-sigchild --with-ttf=/usr/lib64
--enable-gd-native-ttf --enable-gd-imgstrttf --enable-gd-native-ttf
--with-ttf-dir=/usr/local/lib --with-freetype-dir=/opt/freetype
--with-zlib-dir=/usr/local/lib --with-png-dir=/usr/local/lib
--with-jpeg-dir=/usr/local/lib
--with-imap=/opt/imap-2006d.DEV.SNAP-0611201609/ --with-imap-ssl
--with-mysql=/usr/bin --enable-mbstring --with-iconv --with-zlib
--enable-sockets --disable-cgi --enable-debug
2- My apache version:
# ./apachectl -v
Server version: Apache/2.0.52
Server built: Jul 14 2007 11:50:35
3- My php version
# ./php -v
PHP 5.2.5 (cli) (built: Nov 19 2007 19:10:59) (DEBUG)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
Reproduce code:
---------------
1- The pl/sql script used for this example:
create or replace procedure test_lookup(p_out out sys_refcursor)
is
begin
open p_out for
select 1,2,3 from dual;
end;
/
create or replace procedure test_lookup2(p_out out sys_refcursor)
is
begin
open p_out for
select 1,2,3 from dual;
end;
/
2- the php script:
<?php
oci_internal_debug(true);
$conn=OCILogon(user, password, database);
$out=oci_new_cursor($conn);
$s=oci_parse($conn, "begin test_lookup(:b3); end;");
oci_bind_by_name($s, ":b3", $out ,-1, OCI_B_CURSOR);
oci_execute($s, OCI_DEFAULT);
oci_execute($out);
while (OCIFetchInto($out,$data)) {
echo $data[0];
}
OCIFreeCursor($out);
OCIFreeStatement($s);
// do it again
$out=oci_new_cursor($conn);
$s=oci_parse($conn, "begin test_lookup(:b3); end;");
//running with this test_lookup2 line instead of test_lookup works
perfectly
//$s=oci_parse($conn, "begin test_lookup2(:b3); end;");
oci_bind_by_name($s, ":b3", $out ,-1, OCI_B_CURSOR);
oci_execute($s, OCI_DEFAULT);
oci_execute($out);
while (OCIFetchInto($out,$data)) {
echo $data[0];
}
OCIFreeCursor($out);
?>
Expected result:
----------------
We expect the right output from procedure "test_lookup".
Actual result:
--------------
1- We get a segmentation fault in the apache's error log:
[Mon Nov 19 18:50:19 2007] [notice] child pid 29774 exit signal
Segmentation fault (11)
2- this is what we get with oci_internal_debug:
# ./php -c /etc/httpd/conf.d/php.ini test.php
OCI8 DEBUG: OCINlsEnvironmentVariableGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8.c:1067)
OCI8 DEBUG: OCIEnvNlsCreate at
(/opt/downloads/php-5.2.5/ext/oci8/oci8.c:1223)
OCI8 DEBUG: OCIHandleAlloc at
(/opt/downloads/php-5.2.5/ext/oci8/oci8.c:1252)
OCI8 DEBUG: OCIServerAttach at
(/opt/downloads/php-5.2.5/ext/oci8/oci8.c:1261)
OCI8 DEBUG: OCIHandleAlloc at
(/opt/downloads/php-5.2.5/ext/oci8/oci8.c:1271)
OCI8 DEBUG: OCIHandleAlloc at
(/opt/downloads/php-5.2.5/ext/oci8/oci8.c:1280)
OCI8 DEBUG: OCIHandleAlloc at
(/opt/downloads/php-5.2.5/ext/oci8/oci8.c:1289)
OCI8 DEBUG: OCIAttrSet at (/opt/downloads/php-5.2.5/ext/oci8/oci8.c:1299)
OCI8 DEBUG: OCIAttrSet at (/opt/downloads/php-5.2.5/ext/oci8/oci8.c:1310)
OCI8 DEBUG: OCIAttrSet at (/opt/downloads/php-5.2.5/ext/oci8/oci8.c:1320)
OCI8 DEBUG: OCIAttrSet at (/opt/downloads/php-5.2.5/ext/oci8/oci8.c:1329)
OCI8 DEBUG: OCISessionBegin at
(/opt/downloads/php-5.2.5/ext/oci8/oci8.c:1360)
OCI8 DEBUG: OCIAttrSet at (/opt/downloads/php-5.2.5/ext/oci8/oci8.c:1393)
OCI8 DEBUG: OCIHandleAlloc at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:55)
OCI8 DEBUG: OCIHandleAlloc at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:61)
OCI8 DEBUG: OCIAttrSet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:135)
OCI8 DEBUG: OCIAttrSet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:144)
OCI8 DEBUG: OCIHandleAlloc at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:61)
OCI8 DEBUG: OCIStmtPrepare2 at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:77)
OCI8 DEBUG: OCIAttrSet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:135)
OCI8 DEBUG: OCIAttrSet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:144)
OCI8 DEBUG: OCIBindByName at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:1050)
OCI8 DEBUG: OCIBindDynamic at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:1068)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:418)
OCI8 DEBUG: OCIStmtExecute at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:442)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:418)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:471)
OCI8 DEBUG: OCIParamGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:491)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:500)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:510)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:520)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:530)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:543)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:553)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:563)
OCI8 DEBUG: OCIDescriptorFree at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:571)
OCI8 DEBUG: OCIDefineByPos at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:694)
OCI8 DEBUG: OCIParamGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:491)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:500)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:510)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:520)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:530)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:543)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:553)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:563)
OCI8 DEBUG: OCIDescriptorFree at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:571)
OCI8 DEBUG: OCIDefineByPos at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:694)
OCI8 DEBUG: OCIParamGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:491)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:500)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:510)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:520)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:530)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:543)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:553)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:563)
OCI8 DEBUG: OCIDescriptorFree at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:571)
OCI8 DEBUG: OCIDefineByPos at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:694)
OCI8 DEBUG: OCIStmtFetch at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:168)
1OCI8 DEBUG: OCIStmtFetch at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:168)
OCI8 DEBUG: OCIHandleFree at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:748)
OCI8 DEBUG: OCIHandleFree at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:757)
OCI8 DEBUG: OCIStmtRelease at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:746)
OCI8 DEBUG: OCIHandleFree at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:757)
OCI8 DEBUG: OCIHandleAlloc at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:55)
OCI8 DEBUG: OCIHandleAlloc at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:61)
OCI8 DEBUG: OCIAttrSet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:135)
OCI8 DEBUG: OCIAttrSet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:144)
OCI8 DEBUG: OCIHandleAlloc at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:61)
OCI8 DEBUG: OCIStmtPrepare2 at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:77)
OCI8 DEBUG: OCIAttrSet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:135)
OCI8 DEBUG: OCIAttrSet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:144)
OCI8 DEBUG: OCIBindByName at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:1050)
OCI8 DEBUG: OCIBindDynamic at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:1068)
OCI8 DEBUG: OCIAttrGet at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:418)
OCI8 DEBUG: OCIStmtExecute at
(/opt/downloads/php-5.2.5/ext/oci8/oci8_statement.c:442)
Violación de segmento
Where "Violación de segmento" stands for "Segmentation fault" (in spanish)
--
Edit bug report at http://bugs.php.net/?id=43340&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43340&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43340&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43340&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43340&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43340&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=43340&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43340&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43340&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43340&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43340&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43340&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=43340&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=43340&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43340&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43340&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43340&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43340&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43340&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43340&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43340&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43340&r=mysqlcfg