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

==15092== Invalid read of size 1
==15092==    at 0x4C2A852: __strlen_sse42 (vg_replace_strmem.c:462)
==15092==    by 0x10EAF90: add_assoc_string_ex (zend_API.c:1414)
==15092==    by 0xAFD860: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092==    by 0x134292D: do_cli (php_cli.c:1011)
==15092==    by 0x13442E1: main (php_cli.c:1404)
==15092==  Address 0x14f6cce0 is 64 bytes inside a block of size 2,048 free'd
==15092==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==15092==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==15092==    by 0xAFD80E: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==15092==    by 0xAFD80E: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092==    by 0x134292D: do_cli (php_cli.c:1011)
==15092==    by 0x13442E1: main (php_cli.c:1404)
==15092==  Block was alloc'd at
==15092==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==15092==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0xAFD6B7: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==15092==    by 0xAFD6B7: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092== 
==15092== Invalid read of size 1
==15092==    at 0x4C2A864: __strlen_sse42 (vg_replace_strmem.c:462)
==15092==    by 0x10EAF90: add_assoc_string_ex (zend_API.c:1414)
==15092==    by 0xAFD860: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092==    by 0x134292D: do_cli (php_cli.c:1011)
==15092==    by 0x13442E1: main (php_cli.c:1404)
==15092==  Address 0x14f6cce1 is 65 bytes inside a block of size 2,048 free'd
==15092==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==15092==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==15092==    by 0xAFD80E: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==15092==    by 0xAFD80E: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092==    by 0x134292D: do_cli (php_cli.c:1011)
==15092==    by 0x13442E1: main (php_cli.c:1404)
==15092==  Block was alloc'd at
==15092==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==15092==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0xAFD6B7: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==15092==    by 0xAFD6B7: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092== 
==15092== Invalid read of size 8
==15092==    at 0x4C2B9E0: memcpy (vg_replace_strmem.c:1023)
==15092==    by 0x10EB0A5: zend_string_init (zend_string.h:172)
==15092==    by 0x10EB0A5: add_assoc_string_ex (zend_API.c:1414)
==15092==    by 0xAFD860: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092==    by 0x134292D: do_cli (php_cli.c:1011)
==15092==    by 0x13442E1: main (php_cli.c:1404)
==15092==  Address 0x14f6cce0 is 64 bytes inside a block of size 2,048 free'd
==15092==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==15092==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==15092==    by 0xAFD80E: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==15092==    by 0xAFD80E: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092==    by 0x134292D: do_cli (php_cli.c:1011)
==15092==    by 0x13442E1: main (php_cli.c:1404)
==15092==  Block was alloc'd at
==15092==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==15092==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0xAFD6B7: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==15092==    by 0xAFD6B7: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092== 
==15092== Invalid read of size 2
==15092==    at 0x4C2BA38: memcpy (vg_replace_strmem.c:1023)
==15092==    by 0x10EB0A5: zend_string_init (zend_string.h:172)
==15092==    by 0x10EB0A5: add_assoc_string_ex (zend_API.c:1414)
==15092==    by 0xAFD860: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092==    by 0x134292D: do_cli (php_cli.c:1011)
==15092==    by 0x13442E1: main (php_cli.c:1404)
==15092==  Address 0x14f6cce8 is 72 bytes inside a block of size 2,048 free'd
==15092==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==15092==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==15092==    by 0xAFD80E: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==15092==    by 0xAFD80E: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092==    by 0x134292D: do_cli (php_cli.c:1011)
==15092==    by 0x13442E1: main (php_cli.c:1404)
==15092==  Block was alloc'd at
==15092==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==15092==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0xAFD6B7: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==15092==    by 0xAFD6B7: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092== 
==15092== Invalid read of size 1
==15092==    at 0x4C2BA70: memcpy (vg_replace_strmem.c:1023)
==15092==    by 0x10EB0A5: zend_string_init (zend_string.h:172)
==15092==    by 0x10EB0A5: add_assoc_string_ex (zend_API.c:1414)
==15092==    by 0xAFD860: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092==    by 0x134292D: do_cli (php_cli.c:1011)
==15092==    by 0x13442E1: main (php_cli.c:1404)
==15092==  Address 0x14f6ccec is 76 bytes inside a block of size 2,048 free'd
==15092==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==15092==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==15092==    by 0xAFD80E: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==15092==    by 0xAFD80E: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092==    by 0x134292D: do_cli (php_cli.c:1011)
==15092==    by 0x13442E1: main (php_cli.c:1404)
==15092==  Block was alloc'd at
==15092==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==15092==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==15092==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==15092==    by 0xAFD6B7: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==15092==    by 0xAFD6B7: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==15092==    by 0xACB7D4: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1811)
==15092==    by 0x11C46F2: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==15092==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==15092==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==15092==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==15092==    by 0xFD3164: php_execute_script (main.c:2590)
==15092== 

 

Generated at Sat, 09 Dec 2017 10:21:20 +0000 (3 days ago)

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