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

Valgrind Report for ext/oci8/tests/drcp_scope2.phpt ('DRCP: oci_new_connect() and oci_connect with scope end when oci8.old_oci_close_semantics OFF')

Script

1: <?php
2:
3:
require dirname(__FILE__)."/drcp_functions.inc";
4: require 
dirname(__FILE__)."/details.inc";
5:
6:
// Scope considered here is the  functional scope
7: // Test will open a connection within a function (function 1).
8: // Update a table
9: // Open another connection from function 2.
10: // When the scope ends the txn is rolled back and hence the updated value
11: // will not be  reflected for oci_connect and oci_new_connect.
12:
13: // Create the table
14:
$c oci_new_connect($user,$password,$dbase);
15: @
drcp_drop_table($c);
16:
drcp_create_table($c);
17:
18:
// OCI_NEW_CONNECT
19:
$conn_type 1;
20: echo 
"This is with a OCI_NEW_CONNECT\n";
21:
function1($user,$password,$dbase,$conn_type);
22:
23:
// Should return the OLD value
24:
function2($user,$password,$dbase,$conn_type);
25:
26:
// OCI_CONNECT
27:
$conn_type 2;
28: echo 
"\n\nThis is with a OCI_CONNECT\n";
29:
function1($user,$password,$dbase,$conn_type);
30:
31:
// Should return the OLD value
32:
function2($user,$password,$dbase,$conn_type);
33:
34:
//This is the first scope for the script
35:
36:
function function1($user,$password,$dbase,$conn_type)
37: {
38:     switch(
$conn_type)
39:     {
40:     case 
1:
41:         
var_dump($conn1 oci_new_connect($user,$password,$dbase));
42:         break;
43:     case 
2:
44:         
var_dump($conn1 oci_connect($user,$password,$dbase));
45:         break;
46:     }
47:     
drcp_update_table($conn1);
48: }
49:
50:
// This is the second scope
51:
52:
function function2($user,$password,$dbase,$conn_type)
53: {
54:     switch(
$conn_type)
55:     {
56:     case 
1:
57:         
var_dump($conn1 oci_new_connect($user,$password,$dbase));
58:         break;
59:     case 
2:
60:         
var_dump($conn1 oci_connect($user,$password,$dbase));
61:         break;
62:     }
63:     
drcp_select_value($conn1);
64: }
65:
drcp_drop_table($c);
66:
oci_close($c);
67:
68: echo 
"Done\n";
69:
70:
?>
71:

Report

==31027== Invalid read of size 1
==31027==    at 0xA1E9C6: zval_get_type (zend_types.h:327)
==31027==    by 0xA1E9C6: php_oci_register_taf_callback (oci8_failover.c:108)
==31027==    by 0xA1E97F: php_oci_unregister_taf_callback (oci8_failover.c:92)
==31027==    by 0xA1998D: zif_oci_close (oci8_interface.c:1620)
==31027==    by 0x1092F2A: ZEND_DO_ICALL_SPEC_HANDLER (zend_vm_execute.h:586)
==31027==    by 0x1090CFD: execute_ex (zend_vm_execute.h:417)
==31027==    by 0x1091923: zend_execute (zend_vm_execute.h:458)
==31027==    by 0xFC3656: zend_execute_scripts (zend.c:1443)
==31027==    by 0xEC11C4: php_execute_script (main.c:2493)
==31027==    by 0x11C5E29: do_cli (php_cli.c:977)
==31027==    by 0x11C77B9: main (php_cli.c:1347)
==31027==  Address 0x1503e778 is 136 bytes inside a block of size 144 free'd
==31027==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==31027==    by 0xF643C0: _efree (zend_alloc.c:2472)
==31027==    by 0x9F3CAF: php_oci_connection_close (oci8.c:2267)
==31027==    by 0x9ED7DB: php_oci_connection_list_dtor (oci8.c:1266)
==31027==    by 0x10033C9: zend_resource_dtor (zend_list.c:76)
==31027==    by 0x10034A1: zend_list_close (zend_list.c:89)
==31027==    by 0xA1996F: zif_oci_close (oci8_interface.c:1617)
==31027==    by 0x1092F2A: ZEND_DO_ICALL_SPEC_HANDLER (zend_vm_execute.h:586)
==31027==    by 0x1090CFD: execute_ex (zend_vm_execute.h:417)
==31027==    by 0x1091923: zend_execute (zend_vm_execute.h:458)
==31027==    by 0xFC3656: zend_execute_scripts (zend.c:1443)
==31027==    by 0xEC11C4: php_execute_script (main.c:2493)
==31027==  Block was alloc'd at
==31027==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==31027==    by 0xF65A20: __zend_malloc (zend_alloc.c:2864)
==31027==    by 0xF6409D: _emalloc (zend_alloc.c:2457)
==31027==    by 0xF6492B: _safe_emalloc (zend_alloc.c:2516)
==31027==    by 0xF64D3D: _ecalloc (zend_alloc.c:2539)
==31027==    by 0x9F244D: php_oci_do_connect_ex (oci8.c:1981)
==31027==    by 0x9EECE0: php_oci_do_connect (oci8.c:1645)
==31027==    by 0xA199EC: zif_oci_new_connect (oci8_interface.c:1632)
==31027==    by 0x1092F2A: ZEND_DO_ICALL_SPEC_HANDLER (zend_vm_execute.h:586)
==31027==    by 0x1090CFD: execute_ex (zend_vm_execute.h:417)
==31027==    by 0x1091923: zend_execute (zend_vm_execute.h:458)
==31027==    by 0xFC3656: zend_execute_scripts (zend.c:1443)
==31027== 

 

Generated at Wed, 20 Sep 2017 13:49:37 +0000 (5 days ago)

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