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

Valgrind Report for ext/pdo_pgsql/tests/bug62498.phpt ('PDO PgSQL Bug #62498 (pdo_pgsql inefficient when getColumnMeta() is used), 64-bit')

Script

1: <?php
2:
echo "Begin test...\n";
3:
4: require 
dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
5:
$db PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
6:
$db->setAttribute (\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
7:
8:
// create the table
9:
$db->exec("CREATE TEMPORARY TABLE bugtest_62498 (int2col INT2, int4col INT4, int8col INT8, stringcol VARCHAR(255), boolcol BOOLEAN, datecol DATE, textcol TEXT, tscol TIMESTAMP, byteacol BYTEA)");
10:
11:
// insert some data
12:
$statement $db->prepare("INSERT INTO bugtest_62498 (int2col, int4col, int8col, stringcol, boolcol, datecol, textcol, tscol, byteacol) VALUES (:int2val, :int4val, :int8val, :stringval, :boolval, :dateval, :textval, :tsval, :byteaval)");
13:
$vals = array(
14:     
"int2val" => "42",
15:     
"int4val" => "42",
16:     
"int8val" => "42",
17:     
"stringval" => "The Answer",
18:     
"boolval" => true,
19:     
"dateval" => '2015-12-14',
20:     
"textval" => "some text",
21:     
"tsval"   => 19990108,
22:     
"byteaval" => 0,
23: );
24:
$statement->execute($vals);
25:
26:
$select $db->query('SELECT int2col, int4col, int8col, stringcol, boolcol, datecol, textcol, tscol, byteacol FROM bugtest_62498');
27:
$meta = [];
28: for (
$i=0$i count($vals); $i++) {
29:   
$meta[] = $select->getColumnMeta($i);
30: }
31:
var_dump($meta);
32:
33:
?>
34:
Done
35:

Report

==22885== Invalid read of size 1
==22885==    at 0x4C2A852: __strlen_sse42 (vg_replace_strmem.c:462)
==22885==    by 0xFF54FE: add_assoc_string_ex (zend_API.c:1384)
==22885==    by 0xA965DC: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885==    by 0x1232EF5: do_cli (php_cli.c:993)
==22885==    by 0x123489C: main (php_cli.c:1381)
==22885==  Address 0x150aff20 is 64 bytes inside a block of size 2,048 free'd
==22885==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==22885==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==22885==    by 0xA9658A: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==22885==    by 0xA9658A: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885==    by 0x1232EF5: do_cli (php_cli.c:993)
==22885==    by 0x123489C: main (php_cli.c:1381)
==22885==  Block was alloc'd at
==22885==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==22885==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0xA96433: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==22885==    by 0xA96433: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885== 
==22885== Invalid read of size 1
==22885==    at 0x4C2A864: __strlen_sse42 (vg_replace_strmem.c:462)
==22885==    by 0xFF54FE: add_assoc_string_ex (zend_API.c:1384)
==22885==    by 0xA965DC: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885==    by 0x1232EF5: do_cli (php_cli.c:993)
==22885==    by 0x123489C: main (php_cli.c:1381)
==22885==  Address 0x150aff21 is 65 bytes inside a block of size 2,048 free'd
==22885==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==22885==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==22885==    by 0xA9658A: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==22885==    by 0xA9658A: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885==    by 0x1232EF5: do_cli (php_cli.c:993)
==22885==    by 0x123489C: main (php_cli.c:1381)
==22885==  Block was alloc'd at
==22885==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==22885==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0xA96433: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==22885==    by 0xA96433: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885== 
==22885== Invalid read of size 8
==22885==    at 0x4C2B9E0: memcpy (vg_replace_strmem.c:1023)
==22885==    by 0xFF5613: zend_string_init (zend_string.h:160)
==22885==    by 0xFF5613: add_assoc_string_ex (zend_API.c:1384)
==22885==    by 0xA965DC: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885==    by 0x1232EF5: do_cli (php_cli.c:993)
==22885==    by 0x123489C: main (php_cli.c:1381)
==22885==  Address 0x150aff20 is 64 bytes inside a block of size 2,048 free'd
==22885==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==22885==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==22885==    by 0xA9658A: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==22885==    by 0xA9658A: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885==    by 0x1232EF5: do_cli (php_cli.c:993)
==22885==    by 0x123489C: main (php_cli.c:1381)
==22885==  Block was alloc'd at
==22885==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==22885==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0xA96433: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==22885==    by 0xA96433: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885== 
==22885== Invalid read of size 2
==22885==    at 0x4C2BA38: memcpy (vg_replace_strmem.c:1023)
==22885==    by 0xFF5613: zend_string_init (zend_string.h:160)
==22885==    by 0xFF5613: add_assoc_string_ex (zend_API.c:1384)
==22885==    by 0xA965DC: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885==    by 0x1232EF5: do_cli (php_cli.c:993)
==22885==    by 0x123489C: main (php_cli.c:1381)
==22885==  Address 0x150aff28 is 72 bytes inside a block of size 2,048 free'd
==22885==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==22885==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==22885==    by 0xA9658A: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==22885==    by 0xA9658A: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885==    by 0x1232EF5: do_cli (php_cli.c:993)
==22885==    by 0x123489C: main (php_cli.c:1381)
==22885==  Block was alloc'd at
==22885==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==22885==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0xA96433: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==22885==    by 0xA96433: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885== 
==22885== Invalid read of size 1
==22885==    at 0x4C2BA70: memcpy (vg_replace_strmem.c:1023)
==22885==    by 0xFF5613: zend_string_init (zend_string.h:160)
==22885==    by 0xFF5613: add_assoc_string_ex (zend_API.c:1384)
==22885==    by 0xA965DC: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885==    by 0x1232EF5: do_cli (php_cli.c:993)
==22885==    by 0x123489C: main (php_cli.c:1381)
==22885==  Address 0x150aff2c is 76 bytes inside a block of size 2,048 free'd
==22885==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==22885==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==22885==    by 0xA9658A: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==22885==    by 0xA9658A: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885==    by 0x1232EF5: do_cli (php_cli.c:993)
==22885==    by 0x123489C: main (php_cli.c:1381)
==22885==  Block was alloc'd at
==22885==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==22885==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==22885==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==22885==    by 0xA96433: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==22885==    by 0xA96433: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==22885==    by 0xA64DE8: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==22885==    by 0x10CFE00: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==22885==    by 0x10C92C6: execute_ex (zend_vm_execute.h:432)
==22885==    by 0x10C9F13: zend_execute (zend_vm_execute.h:474)
==22885==    by 0xFEC038: zend_execute_scripts (zend.c:1482)
==22885==    by 0xEE0014: php_execute_script (main.c:2577)
==22885== 

 

Generated at Mon, 12 Feb 2018 03:40:49 +0000 (8 days ago)

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