Bug 71523

Summary: valgrind reports wrongfully, unaddressable byte and uninitialised value in sqlite
Product: [Developer tools] valgrind Reporter: zzzzzzz <valgrind>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description zzzzzzz 2003-12-30 23:22:06 UTC
Version:            (using KDE KDE 3.1)

See the following for reproducing and explanation:

http://www.sqlite.org/cvstrac/tktview?tn=535,3
and http://www.sqlite.org/cvstrac/tktview?tn=536,3
Comment 1 Julian Seward 2003-12-31 00:52:43 UTC
Subject: Re:  New: valgrind reports wrongfully, unaddressable byte and uninitialised value in sqlite

> http://www.sqlite.org/cvstrac/tktview?tn=535,3

==3746== Use of uninitialised value of size 4
==3746==    at 0x804EE3D: randomByte (./src/random.c:70)

The obvious conclusion from this is that k[i] is not initialised.
Are you sure sqliteOsRandomSeed(k)  (line 63) fills it in 
correctly?


> and http://www.sqlite.org/cvstrac/tktview?tn=536,3
> Wrong memory access. This is a general library problem. 

Read Valgrind's message more carefully.  
==10597== Syscall param write(buf) contains uninitialised or unaddressable 
byte(s)
                                            ^^^^^^^^^^^^^

Most probably you are putting uninitialised data in that buffer and
then doing sqliteOsWrite on it.

Comment 2 zzzzzzz 2003-12-31 04:17:44 UTC
I checked the code in sqlite and you are right about that k[i] was not properly initialised. Thank you! Valgrind is likely right about the unaddressable
byte(s) problem as well.  

Closing this bug..