PHP  
 PHP_5_3
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Valgrind Report for ext/oci8/tests/bug37581.phpt ('Bug #37581 (oci_bind_array_by_name clobbers input array when using SQLT_AFC, AVC)')

Script

1: <?php
2:
3:
require dirname(__FILE__)."/connect.inc";
4:
5:
$p1 "create or replace package ARRAYBINDPKG1 as
6: type str_array is table of char(2) index by binary_integer;
7: procedure array_bind(in_str in str_array, out_str out string);
8: end ARRAYBINDPKG1;"
;
9:
10:
$p2 "create or replace package body ARRAYBINDPKG1 as
11:   procedure array_bind(in_str in str_array, out_str out string) is
12:   begin
13:     for i in 1 .. in_str.count loop
14:       out_str := in_str(i);
15:     end loop;
16:   end array_bind;
17: end ARRAYBINDPKG1;"
;
18:
19:
$s1 oci_parse($c$p1);
20:
$s2 oci_parse($c$p2);
21:
oci_execute($s1);
22:
oci_execute($s2);
23:
24:
25:
$stmt           oci_parse($c,'begin ARRAYBINDPKG1.array_bind(:in_arr, :out_str); end;');
26:
$strings        = array('A','B','C','D','E');
27:
28:
oci_bind_array_by_name($stmt,':in_arr',$strings,5,1,SQLT_AFC);
29:
oci_bind_by_name($stmt,':out_str',$result,10);
30:
31:
oci_execute($stmt);
32:
var_dump($strings);
33:
34:
oci_execute($stmt);
35:
var_dump($strings);
36:
37: echo 
"Done\n";
38:
?>
39:

Report

==7504== Invalid read of size 16
==7504==    at 0xB5510C9: __intel_new_memcpy (in /u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1)
==7504==    by 0xA049217: kpureq (in /u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1)
==7504==    by 0xA04CB10: kpuStmtPrep2New (in /u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1)
==7504==    by 0xA14E153: kpuStmtCachePrepare2 (in /u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1)
==7504==    by 0xA04BB1E: kpureq2 (in /u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1)
==7504==    by 0x9F25E43: OCIStmtPrepare2 (in /u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1)
==7504==    by 0x8850B3: php_oci_statement_create (oci8_statement.c:60)
==7504==    by 0x89DD79: zif_oci_parse (oci8_interface.c:1724)
==7504==    by 0xDBB76C: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:322)
==7504==    by 0xDC1AA3: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:1634)
==7504==    by 0xDBA7C3: execute (zend_vm_execute.h:107)
==7504==    by 0xD6DC63: zend_execute_scripts (zend.c:1259)
==7504==  Address 0x150d26a0 is 176 bytes inside a block of size 185 alloc'd
==7504==    at 0x4C27AFA: malloc (vg_replace_malloc.c:291)
==7504==    by 0xD354D0: _emalloc (zend_alloc.c:2348)
==7504==    by 0xD35AA4: _estrndup (zend_alloc.c:2503)
==7504==    by 0xD698FB: _zval_copy_ctor_func (zend_variables.c:122)
==7504==    by 0xDB37EF: _zval_copy_ctor (zend_variables.h:45)
==7504==    by 0xDB7BE2: zend_assign_to_variable (zend_execute.c:729)
==7504==    by 0xE7E556: ZEND_ASSIGN_SPEC_CV_CONST_HANDLER (zend_vm_execute.h:24167)
==7504==    by 0xDBA7C3: execute (zend_vm_execute.h:107)
==7504==    by 0xD6DC63: zend_execute_scripts (zend.c:1259)
==7504==    by 0xCB9C70: php_execute_script (main.c:2316)
==7504==    by 0xEB1004: main (php_cli.c:1189)
==7504== 

 

Generated at Fri, 18 Apr 2014 07:01:42 +0000 (5 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.