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_scope4.phpt ('DRCP: oci_pconnect() 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:
// The default expected behavior of this test is different between PHP
7: // 5.2 and PHP 5.3
8: //
9: // In PHP 5.3, the test opens a connection within function1 and
10: // updates a table (without committing).  Another connection is opened
11: // from function 2, and the table queried.  When function1 ends, the
12: // txn is rolled back and hence the updated value will not be
13: // reflected in function2.  Use oci8.old_oci_close_semantics=1 to
14: // get old behavior
15:
16: // Create the table
17:
$c oci_new_connect($user,$password,$dbase);
18: @
drcp_drop_table($c);
19:
drcp_create_table($c);
20:
21: echo 
"This is with a OCI_PCONNECT\n";
22:
function1($user,$password,$dbase);
23:
24:
// Should return the OLD value
25:
function2($user,$password,$dbase);
26:
27:
// This is the first scope for the script
28:
29:
function function1($user,$password,$dbase)
30: {
31:     
var_dump($c oci_pconnect($user,$password,$dbase));
32:     
drcp_update_table($c);
33: }
34:
35:
// This is the second scope
36:
37:
function function2($user,$password,$dbase)
38: {
39:     
var_dump($c oci_pconnect($user,$password,$dbase));
40:     
drcp_select_value($c);
41: }
42:
43:
drcp_drop_table($c);
44:
oci_close($c);
45:
46: echo 
"Done\n";
47:
48:
?>
49:

Report

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

 

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

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