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/bug41069.phpt ('Bug #41069 (Oracle crash with certain data over a DB-link when prefetch memory limit used - Oracle bug 6039623)')

Script

1:     <?php
2:
3:     
require(dirname(__FILE__).'/connect.inc');
4:
5:
// Initialization
6:
7:
$stmtarray = array(
8:     
"alter session set nls_date_format = 'MM/DD/YYYY'",
9:
10:     
"drop database link bug41069_dblink",
11:
12:     
"drop table bug41069_tab",
13:
14:     
"create shared database link bug41069_dblink authenticated by $user identified by $password using '$dbase'",
15:
16:     
"create table bug41069_tab
17:     (
18:         c1  number(20),
19:         c2  varchar2(60 byte),
20:         c3  varchar2(1000 byte),
21:         c4  varchar2(255 byte),
22:         c5  varchar2(2 byte),
23:         c6  varchar2(1 byte),
24:         c7  varchar2(255 byte),
25:         c8  varchar2(50 byte),
26:         c9  date,
27:         c10 date,
28:         c12 number(20),
29:         c13 varchar2(20 byte),
30:         c15 varchar2(50 byte)
31:      )"
,
32:
33:     
"insert into bug41069_tab (c1, c2, c5, c6, c9, c10, c12, c15)    values
34:     (111, 'aaaaaaa', 'b', 'c', '01/17/2008', '01/07/2017', 2222, 'zzzzzzzzzz')"
,
35:
36:     
"insert into bug41069_tab (c1, c2, c3, c4, c5, c6, c7, c9, c10, c12, c13, c15) values
37:     (112, 'aaaaaaa', 'bbbbbbbb', 'ccccccc', 'd', 'e', 'rrrrrrr', '04/16/2007', '04/16/2007', 2223, 'xxxxxxxx', 'zzzzzzzz')"
,
38:
39:     
"insert into bug41069_tab (c1, c2, c3, c4, c5, c6, c7, c9, c10, c12, c15)    values
40:     (113, 'aaaaaaa', 'bbbbbbbbbb', 'cccccc', 'e', 'f', 'dddd', '12/04/2006', '12/04/2006', 2224, 'zzzzzzz')"
41:
);
42:                          
43:
oci8_test_sql_execute($c$stmtarray);
44:
45:
46:
// Run Tests
47:
48:
echo "Test 1: non-DB link case that always worked\n";
49:
$stid oci_parse($c'select * from bug41069_tab order by c1');
50:
oci_execute($stidOCI_DEFAULT);
51:
oci_fetch_all($stid$results0, -1OCI_ASSOC+OCI_FETCHSTATEMENT_BY_ROW);
52:
var_dump($results);
53:
54: echo 
"Test 2: Should not crash\n";
55:
$stid oci_parse($c'select * from bug41069_tab@bug41069_dblink order by c1');
56:
oci_execute($stidOCI_DEFAULT);
57:
oci_fetch_all($stid$results0, -1OCI_ASSOC+OCI_FETCHSTATEMENT_BY_ROW);
58:
var_dump($results);
59:
60:
// Cleanup
61:
62:
$c oci_new_connect($user$password$dbase);
63:
64:
$stmtarray = array(
65:     
"drop database link bug41069_dblink",
66:     
"drop table bug41069_tab"
67:
);
68:
69:
oci8_test_sql_execute($c$stmtarray);
70:
71: echo 
"Done\n";
72:
73:
?>
74:

Report

==2986== Invalid read of size 16
==2986==    at 0xB5520C9: __intel_new_memcpy (in /u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1)
==2986==    by 0xA04A217: kpureq (in /u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1)
==2986==    by 0xA04DB10: kpuStmtPrep2New (in /u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1)
==2986==    by 0xA14F153: kpuStmtCachePrepare2 (in /u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1)
==2986==    by 0xA04CB1E: kpureq2 (in /u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1)
==2986==    by 0x9F26E43: OCIStmtPrepare2 (in /u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1)
==2986==    by 0x8850B3: php_oci_statement_create (oci8_statement.c:60)
==2986==    by 0x89DD79: zif_oci_parse (oci8_interface.c:1724)
==2986==    by 0xDBB770: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:322)
==2986==    by 0xDC1AA7: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:1634)
==2986==    by 0xDBA7C7: execute (zend_vm_execute.h:107)
==2986==    by 0xD6DC67: zend_execute_scripts (zend.c:1259)
==2986==  Address 0x14f373d0 is 304 bytes inside a block of size 319 alloc'd
==2986==    at 0x4C27AFA: malloc (vg_replace_malloc.c:291)
==2986==    by 0xD354D4: _emalloc (zend_alloc.c:2348)
==2986==    by 0xD35AA8: _estrndup (zend_alloc.c:2503)
==2986==    by 0xD698FF: _zval_copy_ctor_func (zend_variables.c:122)
==2986==    by 0xDB37F3: _zval_copy_ctor (zend_variables.h:45)
==2986==    by 0xDCC881: ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER (zend_vm_execute.h:4086)
==2986==    by 0xDBA7C7: execute (zend_vm_execute.h:107)
==2986==    by 0xD6DC67: zend_execute_scripts (zend.c:1259)
==2986==    by 0xCB9C74: php_execute_script (main.c:2316)
==2986==    by 0xEB1008: main (php_cli.c:1189)
==2986== 

 

Generated at Sun, 27 Jul 2014 12:58:43 +0000 (5 days ago)

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