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

==3389== Invalid read of size 1
==3389==    at 0x4C2A852: __strlen_sse42 (vg_replace_strmem.c:462)
==3389==    by 0xFCDFBB: add_assoc_string_ex (zend_API.c:1388)
==3389==    by 0xA7C7B0: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389==    by 0x11C7AF5: do_cli (php_cli.c:977)
==3389==    by 0x11C9485: main (php_cli.c:1347)
==3389==  Address 0x14ff44d0 is 64 bytes inside a block of size 2,048 free'd
==3389==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==3389==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==3389==    by 0xA7C75E: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==3389==    by 0xA7C75E: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389==    by 0x11C7AF5: do_cli (php_cli.c:977)
==3389==    by 0x11C9485: main (php_cli.c:1347)
==3389==  Block was alloc'd at
==3389==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==3389==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0xA7C607: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==3389==    by 0xA7C607: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389== 
==3389== Invalid read of size 1
==3389==    at 0x4C2A864: __strlen_sse42 (vg_replace_strmem.c:462)
==3389==    by 0xFCDFBB: add_assoc_string_ex (zend_API.c:1388)
==3389==    by 0xA7C7B0: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389==    by 0x11C7AF5: do_cli (php_cli.c:977)
==3389==    by 0x11C9485: main (php_cli.c:1347)
==3389==  Address 0x14ff44d1 is 65 bytes inside a block of size 2,048 free'd
==3389==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==3389==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==3389==    by 0xA7C75E: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==3389==    by 0xA7C75E: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389==    by 0x11C7AF5: do_cli (php_cli.c:977)
==3389==    by 0x11C9485: main (php_cli.c:1347)
==3389==  Block was alloc'd at
==3389==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==3389==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0xA7C607: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==3389==    by 0xA7C607: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389== 
==3389== Invalid read of size 8
==3389==    at 0x4C2B9E0: memcpy (vg_replace_strmem.c:1023)
==3389==    by 0xFCE0C7: zend_string_init (zend_string.h:159)
==3389==    by 0xFCE0C7: add_assoc_string_ex (zend_API.c:1388)
==3389==    by 0xA7C7B0: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389==    by 0x11C7AF5: do_cli (php_cli.c:977)
==3389==    by 0x11C9485: main (php_cli.c:1347)
==3389==  Address 0x14ff44d0 is 64 bytes inside a block of size 2,048 free'd
==3389==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==3389==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==3389==    by 0xA7C75E: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==3389==    by 0xA7C75E: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389==    by 0x11C7AF5: do_cli (php_cli.c:977)
==3389==    by 0x11C9485: main (php_cli.c:1347)
==3389==  Block was alloc'd at
==3389==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==3389==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0xA7C607: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==3389==    by 0xA7C607: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389== 
==3389== Invalid read of size 2
==3389==    at 0x4C2BA38: memcpy (vg_replace_strmem.c:1023)
==3389==    by 0xFCE0C7: zend_string_init (zend_string.h:159)
==3389==    by 0xFCE0C7: add_assoc_string_ex (zend_API.c:1388)
==3389==    by 0xA7C7B0: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389==    by 0x11C7AF5: do_cli (php_cli.c:977)
==3389==    by 0x11C9485: main (php_cli.c:1347)
==3389==  Address 0x14ff44d8 is 72 bytes inside a block of size 2,048 free'd
==3389==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==3389==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==3389==    by 0xA7C75E: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==3389==    by 0xA7C75E: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389==    by 0x11C7AF5: do_cli (php_cli.c:977)
==3389==    by 0x11C9485: main (php_cli.c:1347)
==3389==  Block was alloc'd at
==3389==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==3389==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0xA7C607: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==3389==    by 0xA7C607: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389== 
==3389== Invalid read of size 1
==3389==    at 0x4C2BA70: memcpy (vg_replace_strmem.c:1023)
==3389==    by 0xFCE0C7: zend_string_init (zend_string.h:159)
==3389==    by 0xFCE0C7: add_assoc_string_ex (zend_API.c:1388)
==3389==    by 0xA7C7B0: pgsql_stmt_get_column_meta (pgsql_statement.c:654)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389==    by 0x11C7AF5: do_cli (php_cli.c:977)
==3389==    by 0x11C9485: main (php_cli.c:1347)
==3389==  Address 0x14ff44dc is 76 bytes inside a block of size 2,048 free'd
==3389==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==3389==    by 0x5CDEB8E: PQclear (in /usr/lib64/libpq.so.5.2)
==3389==    by 0xA7C75E: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:626)
==3389==    by 0xA7C75E: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389==    by 0x11C7AF5: do_cli (php_cli.c:977)
==3389==    by 0x11C9485: main (php_cli.c:1347)
==3389==  Block was alloc'd at
==3389==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==3389==    by 0x5CDE84E: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE9406: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE1487: PQgetResult (in /usr/lib64/libpq.so.5.2)
==3389==    by 0x5CE1757: ??? (in /usr/lib64/libpq.so.5.2)
==3389==    by 0xA7C607: pdo_pgsql_translate_oid_to_table (pgsql_statement.c:612)
==3389==    by 0xA7C607: pgsql_stmt_get_column_meta (pgsql_statement.c:652)
==3389==    by 0xA4AFAC: zim_PDOStatement_getColumnMeta (pdo_stmt.c:1818)
==3389==    by 0x1098105: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:842)
==3389==    by 0x10929C9: execute_ex (zend_vm_execute.h:417)
==3389==    by 0x10935EF: zend_execute (zend_vm_execute.h:458)
==3389==    by 0xFC4B84: zend_execute_scripts (zend.c:1445)
==3389==    by 0xEC20CA: php_execute_script (main.c:2518)
==3389== 

 

Generated at Wed, 08 Nov 2017 19:36:35 +0000 (16 days ago)

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