Bug #6364 [NEW]: Apache segmentation fault on stored procedure call
| From: | pavel at ctk dot ru | Date: | Thu, 29 Dec 2005 08:49:01 +0000 |
| Subject: | Bug #6364 [NEW]: Apache segmentation fault on stored procedure call | ||
| Groups: | php.pear.webmaster | ||
| Request: | Send a blank email to pear-webmaster+get-4680@lists.php.net to get a copy of this message | ||
From: pavel at ctk dot ru
Operating system: FreeBSD6-STABLE
PHP version: 5.1.1
Package: Bug System
Bug Type: Bug
Bug description: Apache segmentation fault on stored procedure call
Description:
------------
Calling Oracle stored procedure cause the apache http daemon segmentation
fault on FreeBSD6-STABLE box.
Used software:
ZendOptimizer-2.6.0
apache-2.2.0_4
oracle8-client-0.1.1_1
pecl-PDO-1.0.2
pecl-PDO_OCI-1.0
php5-5.1.1
Reproduce code:
---------------
<?php
$dbh = new PDO("oci:dbname=dbhost", 'user, 'pass');
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "CALL sp_test('p1','p2','p3',?,?)";
$stmt = $dbh->prepare($sql);
$out_param1 = "a";
$out_param2 = "a";
$stmt->bindParam(1,$out_param1,PDO::PARAM_STR, 1024);
$stmt->bindParam(2,$out_param2,PDO::PARAM_STR, 1024);
$stmt->execute() // <===== !!! this is line 14
or die ("<pre>Execution error:\n" . print_r($dbh->errorInfo(),
true));
$dbh = null;
print $out_param1 . " ". $out_param2;
?>
Expected result:
----------------
This code should print in a browser window two strings returned from SP.
In my case - "Stored" and "procedure"
Actual result:
--------------
I'm failed to produce backtrace because gbd coredumps:
# ulimit -c unlimited
# gdb httpd
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 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 "i386-marcel-freebsd"...
(gdb) run -DNOHTTPACCEPT -X
Starting program: /usr/local/sbin/httpd -DNOHTTPACCEPT -X
warning: Unable to get location for thread creation breakpoint: generic
error
[New LWP 100359]
[New Thread 0x80b0000 (LWP 100359)]
gdb in realloc(): error: pointer to wrong page
Abort trap (core dumped)
In apache error log:
[Thu Dec 29 11:32:13 2005] [error] [client x.x.x.x] PHP Warning:
PDOStatement::execute() [<a href='function.execute'>function.execute</a>]:
param is NULL in oci_bind_input_cb; this should not happen in
/u01/www/www.myhost.ru/test_sp.php on line 14
[Thu Dec 29 11:32:13 2005] [error] [client x.x.x.x] PHP Fatal error:
Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General
error: 24343 OCIStmtExecute: ORA-24343: user defined callback error\n
(/usr/obj/usr/ports/databases/pecl-PDO_OCI/work/PDO_OCI-1.0/oci_statement.c:142)'
in /u01/www/www.myhost.ru/test_sp.php:14\nStack trace:\n#0
/u01/www/www.myhost.ru/test_sp.php(14): PDOStatement->execute()\n#1
{main}\n thrown in /u01/www/www.myhost.ru/test_sp.php on line 14
--
Edit bug report at http://pecl.php.net/bugs/bug.php?id=6364&edit=1
--