Valgrind Report for ext/interbase/tests/003.phpt ('InterBase: misc sql types (may take a while)')
Script
1:
<?php /* $Id$ */ 2: 3: require("interbase.inc"); 4: ibase_connect($test_base); 5: 6: ibase_query( 7: "create table test3 ( 8: iter integer not null, 9: v_char char(1000), 10: v_date timestamp, 11: v_decimal4_2 decimal(4,2), 12: v_decimal4_0 decimal(4,0), 13: v_decimal7_2 decimal(7,2), 14: v_decimal7_0 decimal(7,0), 15: v_numeric15_15 numeric(15,15), 16: v_numeric15_0 numeric(15,0), 17: v_double double precision, 18: v_float float, 19: v_integer integer, 20: v_smallint smallint, 21: v_varchar varchar(10000) 22: )"); 23: ibase_commit(); 24: 25: /* should fail, but gracefully */ 26: @ibase_query("insert into test3 (iter) values (?)", null); 27: 28: /* if timefmt is not supported, suppress error here */ 29: ini_set('ibase.timestampformat',"%m/%d/%Y %H:%M:%S"); 30: 31: for($iter = 0; $iter < 10; $iter++){ 32: /* prepare data */ 33: $v_char = rand_str(1000); 34: $v_date = rand_datetime(); 35: $v_decimal4_2 = rand_number(4,2); 36: $v_decimal4_0 = rand_number(4,0); 37: $v_decimal7_2 = rand_number(7,2); 38: $v_decimal7_0 = rand_number(7,0); 39: $v_numeric15_15 = rand_number(15,15); 40: $v_numeric15_0 = $iter ? rand_number(15,0) : 0; 41: $v_double = rand_number(18); 42: $v_float = rand_number(7); 43: $v_integer = rand_number(9,0); 44: $v_smallint = rand_number(5) % 32767; 45: $v_varchar = rand_str(10000); 46: 47: ibase_query( 48: "insert into test3 (iter, v_char,v_date,v_decimal4_2, v_decimal4_0, v_decimal7_2, v_decimal7_0,v_numeric15_15, v_numeric15_0,v_double,v_float,v_integer,v_smallint,v_varchar) 49: values ($iter, '$v_char','$v_date',$v_decimal4_2, $v_decimal4_0, $v_decimal7_2, $v_decimal7_0,$v_numeric15_15, $v_numeric15_0,$v_double,$v_float,$v_integer,$v_smallint,'$v_varchar')"); 50: $sel = ibase_query("select * from test3 where iter = $iter"); 51: $row = ibase_fetch_object($sel); 52: if(substr($row->V_CHAR,0,strlen($v_char)) != $v_char){ 53: echo " CHAR fail:\n"; 54: echo " in: $v_char\n"; 55: echo " out: $row->V_CHAR\n"; 56: } 57: if($row->V_DATE != $v_date){ 58: echo " DATE fail\n"; 59: echo " in: $v_date\n"; 60: echo " out: $row->V_DATE\n"; 61: } 62: if($row->V_DECIMAL4_2 != $v_decimal4_2){ 63: echo " DECIMAL4_2 fail\n"; 64: echo " in: $v_decimal4_2\n"; 65: echo " out: $row->V_DECIMAL4_2\n"; 66: } 67: if($row->V_DECIMAL4_0 != $v_decimal4_0){ 68: echo " DECIMAL4_0 fail\n"; 69: echo " in: $v_decimal4_0\n"; 70: echo " out: $row->V_DECIMAL4_0\n"; 71: } 72: if($row->V_DECIMAL7_2 != $v_decimal7_2){ 73: echo " DECIMAL7_2 fail\n"; 74: echo " in: $v_decimal7_2\n"; 75: echo " out: $row->V_DECIMAL7_2\n"; 76: } 77: if($row->V_DECIMAL7_0 != $v_decimal7_0){ 78: echo " DECIMAL7_0 fail\n"; 79: echo " in: $v_decimal7_0\n"; 80: echo " out: $row->V_DECIMAL7_0\n"; 81: } 82: if($row->V_NUMERIC15_15 != $v_numeric15_15){ 83: echo " NUMERIC15_15 fail\n"; 84: echo " in: $v_numeric15_15\n"; 85: echo " out: $row->V_NUMERIC15_15\n"; 86: } 87: if($row->V_NUMERIC15_0 != (string)$v_numeric15_0){ 88: echo " NUMERIC15_0 fail\n"; 89: echo " in: $v_numeric15_0\n"; 90: echo " out: $row->V_NUMERIC15_0\n"; 91: } 92: 93: if(abs($row->V_DOUBLE - $v_double) > abs($v_double / 1E15)){ 94: echo " DOUBLE fail\n"; 95: echo " in: $v_double\n"; 96: echo " out: $row->V_DOUBLE\n"; 97: } 98: if(abs($row->V_FLOAT - $v_float) > abs($v_float / 1E7)){ 99: echo " FLOAT fail\n"; 100: echo " in: $v_float\n"; 101: echo " out: $row->V_FLOAT\n"; 102: } 103: if($row->V_INTEGER != $v_integer){ 104: echo " INTEGER fail\n"; 105: echo " in: $v_integer\n"; 106: echo " out: $row->V_INTEGER\n"; 107: } 108: if($row->V_SMALLINT != $v_smallint){ 109: echo " SMALLINT fail\n"; 110: echo " in: $v_smallint\n"; 111: echo " out: $row->V_SMALLINT\n"; 112: } 113: 114: if(substr($row->V_VARCHAR,0,strlen($v_varchar)) != $v_varchar){ 115: echo " VARCHAR fail:\n"; 116: echo " in: $v_varchar\n"; 117: echo " out: $row->V_VARCHAR\n"; 118: } 119: 120: ibase_free_result($sel); 121: } /* for($iter) */ 122: 123: /* check for correct handling of duplicate field names */ 124: $q = ibase_query('SELECT 1 AS id, 2 AS id, 3 AS id, 4 AS id, 5 AS id, 6 AS id, 7 AS id, 8 AS id, 9 AS id, 125: 10 AS id, 11 AS id, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 FROM rdb$database'); 126: var_dump(ibase_fetch_assoc($q)); 127: 128: ibase_close(); 129: echo "end of test\n"; 130: ?> 131:
Report
==32507== Conditional jump or move depends on uninitialised value(s)
==32507== at 0x619D0EE: ??? (in /usr/lib64/libfbclient.so.2.5.2)
==32507== by 0x618C433: isc_dsql_execute2 (in /usr/lib64/libfbclient.so.2.5.2)
==32507== by 0x7A108F: _php_ibase_exec (ibase_query.c:982)
==32507== by 0x7A1EFC: zif_ibase_query (ibase_query.c:1177)
==32507== by 0xE70D6B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:543)
==32507== by 0xE7AD7B: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2322)
==32507== by 0xE6E9A8: execute_ex (zend_vm_execute.h:356)
==32507== by 0xE6F53A: zend_execute (zend_vm_execute.h:381)
==32507== by 0xE0CA32: zend_execute_scripts (zend.c:1316)
==32507== by 0xD3043F: php_execute_script (main.c:2479)
==32507== by 0xFF1374: do_cli (php_cli.c:993)
==32507== by 0xFF2B21: main (php_cli.c:1377)
==32507==
==32507== Invalid read of size 4
==32507== at 0x61922F2: ??? (in /usr/lib64/libfbclient.so.2.5.2)
==32507== by 0x6184A89: isc_database_info (in /usr/lib64/libfbclient.so.2.5.2)
==32507== by 0x79D6A9: _php_ibase_free_stmt_handle (ibase_query.c:129)
==32507== by 0x79D7E0: _php_ibase_free_result (ibase_query.c:150)
==32507== by 0xE2B792: list_entry_destructor (zend_list.c:183)
==32507== by 0xE269C2: zend_hash_del_key_or_index (zend_hash.c:531)
==32507== by 0xE2AF1D: _zend_list_delete (zend_list.c:57)
==32507== by 0xE07595: _zval_dtor_func (zend_variables.c:62)
==32507== by 0xDE9A7D: _zval_ptr_dtor (zend_variables.h:35)
==32507== by 0xE2711A: zend_hash_apply_deleter (zend_hash.c:650)
==32507== by 0xE27331: zend_hash_graceful_reverse_destroy (zend_hash.c:687)
==32507== by 0xDE8BF4: shutdown_executor (zend_execute_API.c:247)
==32507== Address 0x15394a80 is 0 bytes inside a block of size 32 free'd
==32507== at 0x4C27350: free (vg_replace_malloc.c:446)
==32507== by 0xDB82BC: _efree (zend_alloc.c:2437)
==32507== by 0x79944C: _php_ibase_close_link (interbase.c:650)
==32507== by 0xE2B792: list_entry_destructor (zend_list.c:183)
==32507== by 0xE269C2: zend_hash_del_key_or_index (zend_hash.c:531)
==32507== by 0xE2AF1D: _zend_list_delete (zend_list.c:57)
==32507== by 0x79B3CF: zif_ibase_close (interbase.c:1076)
==32507== by 0xE70D6B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:543)
==32507== by 0xE7AD7B: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2322)
==32507== by 0xE6E9A8: execute_ex (zend_vm_execute.h:356)
==32507== by 0xE6F53A: zend_execute (zend_vm_execute.h:381)
==32507== by 0xE0CA32: zend_execute_scripts (zend.c:1316)
==32507==
Generated at Wed, 15 May 2013 22:03:26 +0000 (7 days ago)
|