php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48037 PDO_OCI: Error "zend_mm_heap corrupted" when binding a param in an sql comment
Submitted: 2009-04-21 12:47 UTC Modified: 2016-03-08 01:49 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mailinglists at if-core dot de Assigned:
Status: No Feedback Package: PDO OCI
PHP Version: 5.2.9 OS: SUSE ES 10 SP2 (x86_64)
Private report: No CVE-ID: None
 [2009-04-21 12:47 UTC] mailinglists at if-core dot de
Description:
------------
The error "zend_mm_heap corrupted" and eventually a "Segmentation fault" error occurs when I try to use bindParam for a parameter which is commented out in the sql statement.
The error occurs only and then even not at all times if i use persistent connections
I reproduced the error on two servers, both running with PDO_OCI and persistent connections.

Reproduce code:
---------------
<?php
$user_id=1;
$dbh = new PDO('oci:dbname=//127.0.0.1:1521/xe;charset=AL32UTF8', 'xx', 'xx', array(PDO::ATTR_PERSISTENT => true));
$dbx = $dbh->prepare('
	SELECT
		id
	FROM
		user_data
	/* ? */
');
$dbx->bindParam(1, $user_id);
$dbx->execute();
var_dump($dbx->fetchAll());
?>

Expected result:
----------------
An array with the contents of the Database-Table user_data

Actual result:
--------------
A blank page and errors in the error_log of the Apache Server.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-21 19:04 UTC] kalle@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2009-04-21 20:19 UTC] mailinglists at if-core dot de
(gdb) bt
#0  0x082f29af in zend_mm_check_ptr (heap=0x91261a8, ptr=0x929b6c8, silent=1, __zend_filename=0x840386c "/usr/local/bin/php-5.2.9/ext/pdo_oci/oci_driver.c", __zend_lineno=74, __zend_orig_filename=0x0, __zend_orig_lineno=0)
    at /usr/local/bin/php-5.2.9/Zend/zend_alloc.c:1299
#1  0x082f3f6a in _zend_mm_free_int (heap=0x91261a8, p=0x929b6c8, __zend_filename=0x840386c "/usr/local/bin/php-5.2.9/ext/pdo_oci/oci_driver.c", __zend_lineno=74, __zend_orig_filename=0x0, __zend_orig_lineno=0)
    at /usr/local/bin/php-5.2.9/Zend/zend_alloc.c:1938
#2  0x082f4f91 in _efree (ptr=0x929b6c8, __zend_filename=0x840386c "/usr/local/bin/php-5.2.9/ext/pdo_oci/oci_driver.c", __zend_lineno=74, __zend_orig_filename=0x0, __zend_orig_lineno=0)
    at /usr/local/bin/php-5.2.9/Zend/zend_alloc.c:2306
#3  0x0813479c in _oci_error (err=0x927cf14, dbh=0x92395e8, stmt=0x9209d6c, what=0x8403c68 "OCIAttrGet: \"OCI_ATTR_STMT_TYPE\"", status=0, isinit=0, file=0x8403c30 "/usr/local/bin/php-5.2.9/ext/pdo_oci/oci_statement.c", line=125)
    at /usr/local/bin/php-5.2.9/ext/pdo_oci/oci_driver.c:74
#4  0x08136e36 in oci_stmt_execute (stmt=0x9209d6c) at /usr/local/bin/php-5.2.9/ext/pdo_oci/oci_statement.c:124
#5  0x0812c9e0 in zim_PDOStatement_execute (ht=0, return_value=0x92099b4, return_value_ptr=0x0, this_ptr=0x92099f0, return_value_used=0) at /usr/local/bin/php-5.2.9/ext/pdo/pdo_stmt.c:521
#6  0x0833731c in zend_do_fcall_common_helper_SPEC (execute_data=0xbfeb87e8) at /usr/local/bin/php-5.2.9/Zend/zend_vm_execute.h:200
#7  0x08337f3b in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0xbfeb87e8) at /usr/local/bin/php-5.2.9/Zend/zend_vm_execute.h:322
#8  0x08336e9c in execute (op_array=0x9208d18) at /usr/local/bin/php-5.2.9/Zend/zend_vm_execute.h:92
#9  0x083122de in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/bin/php-5.2.9/Zend/zend.c:1134
#10 0x082c145c in php_execute_script (primary_file=0xbfebab64) at /usr/local/bin/php-5.2.9/main/main.c:2023
#11 0x0838d639 in main (argc=2, argv=0xbfebaca4) at /usr/local/bin/php-5.2.9/sapi/cli/php_cli.c:1133
 [2009-12-08 23:22 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-12-16 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2016-03-08 01:49 UTC] sixd@php.net
-Package: PDO related +Package: PDO OCI
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC