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

Valgrind Report for ext/sqlite/tests/sqlite_oo_020.phpt ('sqlite-oo: factory and exception')

Script

1: <?php 
2: $dbname 
tempnam(dirname(__FILE__), "phpsql");
3: function 
cleanup() {
4:     global 
$db$dbname;
5:
6:     
$db NULL;
7:     
unlink($dbname);
8: }
9:
register_shutdown_function("cleanup");
10:
11: try {
12:     
$db sqlite_factory();
13: } catch(
SQLiteException $err) {
14:     echo 
"Message: ".$err->getMessage()."\n";
15:     echo 
"File: ".$err->getFile()."\n";
16:     
//echo "Line: ".$err->getLine()."\n";
17:     //print_r($err->getTrace());
18:     //echo "BackTrace: ".$err->getTraceAsString()."\n";
19:
}
20:
21:
$db sqlite_factory($dbname);
22:
23:
$data = array(
24:     array (
=> 'one'=> 'two'),
25:     array (
=> 'three'=> 'four')
26:     );
27:
28:
$db->query("CREATE TABLE strings(a VARCHAR, b VARCHAR)");
29:
30: foreach (
$data as $str) {
31:     
$db->query("INSERT INTO strings VALUES('${str[0]}','${str[1]}')");
32: }
33:
34:
$r $db->unbufferedQuery("SELECT a, b from strings");
35: while (
$r->valid()) {
36:     
var_dump($r->current(SQLITE_NUM));
37:     
$r->next();
38: }
39:
$r null;
40:
$db null;
41: echo 
"DONE!\n";
42:
?>
43:

Report

==22301== Syscall param write(buf) points to uninitialised byte(s)
==22301==    at 0xCD1C780: __write_nocancel (in /lib64/libc-2.12.so)
==22301==    by 0xACE40F: sqliteOsWrite (os.c:1025)
==22301==    by 0xAD161D: pager_write_pagelist (pager.c:1262)
==22301==    by 0xAD39DB: sqlitepager_commit (pager.c:2020)
==22301==    by 0xAA9625: fileBtreeCommit (btree.c:906)
==22301==    by 0xAEE6D2: sqliteVdbeExec (vdbe.c:2228)
==22301==    by 0xAE86C0: sqlite_step (vdbe.c:128)
==22301==    by 0xACBB24: sqlite_exec (main.c:654)
==22301==    by 0xA972D2: zif_sqlite_query (sqlite.c:2100)
==22301==    by 0xDBB770: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:322)
==22301==    by 0xDBC0B5: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:430)
==22301==    by 0xDBA7C7: execute (zend_vm_execute.h:107)
==22301==  Address 0x14e28189 is 201 bytes inside a block of size 1,684 alloc'd
==22301==    at 0x4C27AFA: malloc (vg_replace_malloc.c:291)
==22301==    by 0xAE57B2: sqliteMallocRaw (util.c:268)
==22301==    by 0xAD1A74: sqlitepager_get (pager.c:1387)
==22301==    by 0xAA936B: newDatabase (btree.c:840)
==22301==    by 0xAA9577: fileBtreeBeginTrans (btree.c:887)
==22301==    by 0xAEE29A: sqliteVdbeExec (vdbe.c:2175)
==22301==    by 0xAE86C0: sqlite_step (vdbe.c:128)
==22301==    by 0xACBB24: sqlite_exec (main.c:654)
==22301==    by 0xA972D2: zif_sqlite_query (sqlite.c:2100)
==22301==    by 0xDBB770: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:322)
==22301==    by 0xDBC0B5: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:430)
==22301==    by 0xDBA7C7: execute (zend_vm_execute.h:107)
==22301== 

 

Generated at Sun, 27 Jul 2014 12:58:43 +0000 (2 days ago)

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