php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56756 Apache segmentation fault on stored procedure call
Submitted: 2005-12-29 03:49 UTC Modified: 2007-06-29 11:06 UTC
From: pavel at ctk dot ru Assigned:
Status: Closed Package: PDO_OCI (PECL)
PHP Version: 5.1.1 OS: FreeBSD6-STABLE
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: pavel at ctk dot ru
New email:
PHP Version: OS:

 

 [2005-12-29 03:49 UTC] pavel at ctk dot ru
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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-29 11:06 UTC] christopher dot jones at oracle dot com
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/PDO_OCI

------------
I can not reproduce this now with PHP 5.2.4-dev.  It may have been fixed a long time ago.

I have merged your testcase to ext/pdo_oci/tests/pecl_bug_6364.phpt
------------
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC