PHP  
 PHP_HEAD
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

==26089== Invalid read of size 1
==26089==    at 0xA96B1E: zval_get_type (zend_types.h:390)
==26089==    by 0xA96B1E: php_oci_register_taf_callback (oci8_failover.c:108)
==26089==    by 0xA96AD7: php_oci_unregister_taf_callback (oci8_failover.c:92)
==26089==    by 0xA91959: zif_oci_close (oci8_interface.c:1620)
==26089==    by 0x11BD4EB: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:573)
==26089==    by 0x1339863: execute_ex (zend_vm_execute.h:59726)
==26089==    by 0x1339EDB: zend_execute (zend_vm_execute.h:63763)
==26089==    by 0x10DF02D: zend_execute_scripts (zend.c:1494)
==26089==    by 0xFD0CE5: php_execute_script (main.c:2566)
==26089==    by 0x133FA79: do_cli (php_cli.c:1011)
==26089==    by 0x134142D: main (php_cli.c:1404)
==26089==  Address 0x14fc5ad8 is 136 bytes inside a block of size 144 free'd
==26089==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==26089==    by 0x1076214: _efree (zend_alloc.c:2428)
==26089==    by 0xA6B758: php_oci_connection_close (oci8.c:2267)
==26089==    by 0xA6517B: php_oci_connection_list_dtor (oci8.c:1266)
==26089==    by 0x1120A31: zend_resource_dtor (zend_list.c:76)
==26089==    by 0x1120B09: zend_list_close (zend_list.c:89)
==26089==    by 0xA9193B: zif_oci_close (oci8_interface.c:1617)
==26089==    by 0x11BD4EB: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:573)
==26089==    by 0x1339863: execute_ex (zend_vm_execute.h:59726)
==26089==    by 0x1339EDB: zend_execute (zend_vm_execute.h:63763)
==26089==    by 0x10DF02D: zend_execute_scripts (zend.c:1494)
==26089==    by 0xFD0CE5: php_execute_script (main.c:2566)
==26089==  Block was alloc'd at
==26089==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==26089==    by 0x10777DB: __zend_malloc (zend_alloc.c:2811)
==26089==    by 0x1075EF1: _emalloc (zend_alloc.c:2413)
==26089==    by 0x107677F: _safe_emalloc (zend_alloc.c:2472)
==26089==    by 0x1076B91: _ecalloc (zend_alloc.c:2495)
==26089==    by 0xA69EF6: php_oci_do_connect_ex (oci8.c:1981)
==26089==    by 0xA66680: php_oci_do_connect (oci8.c:1645)
==26089==    by 0xA919B8: zif_oci_new_connect (oci8_interface.c:1632)
==26089==    by 0x11BD9D3: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:617)
==26089==    by 0x1339863: execute_ex (zend_vm_execute.h:59726)
==26089==    by 0x1339EDB: zend_execute (zend_vm_execute.h:63763)
==26089==    by 0x10DF02D: zend_execute_scripts (zend.c:1494)
==26089== 

 

Generated at Sat, 09 Sep 2017 03:10:54 +0000 (14 days ago)

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