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

==2773== Invalid read of size 1
==2773==    at 0x4C2A852: __strlen_sse42 (vg_replace_strmem.c:462)
==2773==    by 0xFF4E76: add_assoc_string_ex (zend_API.c:1384)
==2773==    by 0xA96544: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773==    by 0x123291D: do_cli (php_cli.c:993)
==2773==    by 0x12342C4: main (php_cli.c:1381)
==2773==  Address 0x150aeeb0 is 64 bytes inside a block of size 2,048 free'd
==2773==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==2773==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==2773==    by 0xA964F2: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==2773==    by 0xA964F2: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773==    by 0x123291D: do_cli (php_cli.c:993)
==2773==    by 0x12342C4: main (php_cli.c:1381)
==2773==  Block was alloc'd at
==2773==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==2773==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0xA9639B: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==2773==    by 0xA9639B: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773== 
==2773== Invalid read of size 1
==2773==    at 0x4C2A864: __strlen_sse42 (vg_replace_strmem.c:462)
==2773==    by 0xFF4E76: add_assoc_string_ex (zend_API.c:1384)
==2773==    by 0xA96544: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773==    by 0x123291D: do_cli (php_cli.c:993)
==2773==    by 0x12342C4: main (php_cli.c:1381)
==2773==  Address 0x150aeeb1 is 65 bytes inside a block of size 2,048 free'd
==2773==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==2773==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==2773==    by 0xA964F2: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==2773==    by 0xA964F2: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773==    by 0x123291D: do_cli (php_cli.c:993)
==2773==    by 0x12342C4: main (php_cli.c:1381)
==2773==  Block was alloc'd at
==2773==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==2773==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0xA9639B: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==2773==    by 0xA9639B: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773== 
==2773== Invalid read of size 8
==2773==    at 0x4C2B9E0: memcpy (vg_replace_strmem.c:1023)
==2773==    by 0xFF4F8B: zend_string_init (zend_string.h:160)
==2773==    by 0xFF4F8B: add_assoc_string_ex (zend_API.c:1384)
==2773==    by 0xA96544: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773==    by 0x123291D: do_cli (php_cli.c:993)
==2773==    by 0x12342C4: main (php_cli.c:1381)
==2773==  Address 0x150aeeb0 is 64 bytes inside a block of size 2,048 free'd
==2773==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==2773==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==2773==    by 0xA964F2: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==2773==    by 0xA964F2: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773==    by 0x123291D: do_cli (php_cli.c:993)
==2773==    by 0x12342C4: main (php_cli.c:1381)
==2773==  Block was alloc'd at
==2773==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==2773==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0xA9639B: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==2773==    by 0xA9639B: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773== 
==2773== Invalid read of size 2
==2773==    at 0x4C2BA38: memcpy (vg_replace_strmem.c:1023)
==2773==    by 0xFF4F8B: zend_string_init (zend_string.h:160)
==2773==    by 0xFF4F8B: add_assoc_string_ex (zend_API.c:1384)
==2773==    by 0xA96544: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773==    by 0x123291D: do_cli (php_cli.c:993)
==2773==    by 0x12342C4: main (php_cli.c:1381)
==2773==  Address 0x150aeeb8 is 72 bytes inside a block of size 2,048 free'd
==2773==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==2773==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==2773==    by 0xA964F2: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==2773==    by 0xA964F2: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773==    by 0x123291D: do_cli (php_cli.c:993)
==2773==    by 0x12342C4: main (php_cli.c:1381)
==2773==  Block was alloc'd at
==2773==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==2773==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0xA9639B: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==2773==    by 0xA9639B: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773== 
==2773== Invalid read of size 1
==2773==    at 0x4C2BA70: memcpy (vg_replace_strmem.c:1023)
==2773==    by 0xFF4F8B: zend_string_init (zend_string.h:160)
==2773==    by 0xFF4F8B: add_assoc_string_ex (zend_API.c:1384)
==2773==    by 0xA96544: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773==    by 0x123291D: do_cli (php_cli.c:993)
==2773==    by 0x12342C4: main (php_cli.c:1381)
==2773==  Address 0x150aeebc is 76 bytes inside a block of size 2,048 free'd
==2773==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==2773==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==2773==    by 0xA964F2: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==2773==    by 0xA964F2: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773==    by 0x123291D: do_cli (php_cli.c:993)
==2773==    by 0x12342C4: main (php_cli.c:1381)
==2773==  Block was alloc'd at
==2773==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==2773==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==2773==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==2773==    by 0xA9639B: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==2773==    by 0xA9639B: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==2773==    by 0xA64D60: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1812)
==2773==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2773==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2773==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2773==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2773==    by 0xEDF990: php_execute_script (main.c:2577)
==2773== 

 

Generated at Fri, 01 Dec 2017 18:56:15 +0000 (12 days ago)

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