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 (0 => 'one', 1 => 'two'), 25: array (0 => 'three', 1 => '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
==23040== Syscall param write(buf) points to uninitialised byte(s)
==23040== at 0xCCC4650: __write_nocancel (in /lib64/libc-2.12.so)
==23040== by 0xACDAB7: sqliteOsWrite (os.c:1025)
==23040== by 0xAD0CC5: pager_write_pagelist (pager.c:1262)
==23040== by 0xAD3083: sqlitepager_commit (pager.c:2020)
==23040== by 0xAA8CCD: fileBtreeCommit (btree.c:906)
==23040== by 0xAEDD7A: sqliteVdbeExec (vdbe.c:2228)
==23040== by 0xAE7D68: sqlite_step (vdbe.c:128)
==23040== by 0xACB1CC: sqlite_exec (main.c:654)
==23040== by 0xA9697A: zif_sqlite_query (sqlite.c:2100)
==23040== by 0xDBACEC: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:322)
==23040== by 0xDBB631: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:430)
==23040== by 0xDB9D43: execute (zend_vm_execute.h:107)
==23040== Address 0x14d75ea9 is 201 bytes inside a block of size 1,684 alloc'd
==23040== at 0x4C2794E: malloc (vg_replace_malloc.c:270)
==23040== by 0xAE4E5A: sqliteMallocRaw (util.c:268)
==23040== by 0xAD111C: sqlitepager_get (pager.c:1387)
==23040== by 0xAA8A13: newDatabase (btree.c:840)
==23040== by 0xAA8C1F: fileBtreeBeginTrans (btree.c:887)
==23040== by 0xAED942: sqliteVdbeExec (vdbe.c:2175)
==23040== by 0xAE7D68: sqlite_step (vdbe.c:128)
==23040== by 0xACB1CC: sqlite_exec (main.c:654)
==23040== by 0xA9697A: zif_sqlite_query (sqlite.c:2100)
==23040== by 0xDBACEC: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:322)
==23040== by 0xDBB631: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:430)
==23040== by 0xDB9D43: execute (zend_vm_execute.h:107)
==23040==
Generated at Sun, 16 Jun 2013 17:01:47 +0000 (2 days ago)
|