From dff7ec2cbde46b8ef9ba49e42e9f11eff4d92d98 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 31 Dec 2003 13:21:18 +0000 Subject: [PATCH] Reduce the randomness in the sqliteRandomSeed() routine in order to silence bogus errors from valgrind. Tickets #535 and #536. (CVS 1149) FossilOrigin-Name: cfe0acf9ec6c89f1e77b8be7dcc23029984de1ce --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/os.c | 15 +++++++++++---- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index d6960c4c79..f4b89100e4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C minor\sedits\sfor\snew\sdate.c\swith\smingw/msys\son\sWindows\s(CVS\s1148) -D 2003-12-24T01:41:19 +C Reduce\sthe\srandomness\sin\sthe\ssqliteRandomSeed()\sroutine\sin\sorder\sto\ssilence\r\nbogus\serrors\sfrom\svalgrind.\s\sTickets\s#535\sand\s#536.\s(CVS\s1149) +D 2003-12-31T13:21:18 F Makefile.in 0515ff9218ad8d5a8f6220f0494b8ef94c67013b F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd @@ -38,7 +38,7 @@ F src/hash.h cd0433998bc1a3759d244e1637fe5a3c13b53bf8 F src/insert.c 01f66866f35c986eab4a57373ca689a3255ef2df F src/main.c 3dd3cae00bade294011da5a3cf9ff660a610c545 F src/md5.c fe4f9c9c6f71dfc26af8da63e4d04489b1430565 -F src/os.c 3460bc83541eb276a69723d8babb533559b09344 +F src/os.c b8e16216618ae5509dad86c0ed134070dc10b3fd F src/os.h 4101ce267c2f5c8a34914e6af122e97907fcb205 F src/pager.c ca24fced1ca4c2b8ea519d5fe8ec69a2d846276f F src/pager.h 5da62c83443f26b1792cfd72c96c422f91aadd31 @@ -179,7 +179,7 @@ F www/speed.tcl 2f6b1155b99d39adb185f900456d1d592c4832b3 F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604 F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1 -P a5a5fbd60153dd068ec2559455146e84da075b90 -R bc2f40a9da05043940347dcae40bd046 -U dougcurrie -Z 5bdb9f56b8fd2120ef569c47f01fd9a4 +P 9392c514501be333a3c22b552dc036e083eb22b4 +R ff58e113a9959802e5ad1974f1699fc1 +U drh +Z 4c7ee21cd76b2c28c8264da0d2b1edcb diff --git a/manifest.uuid b/manifest.uuid index 5947f5b3f3..1a3fb3f7ee 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9392c514501be333a3c22b552dc036e083eb22b4 \ No newline at end of file +cfe0acf9ec6c89f1e77b8be7dcc23029984de1ce \ No newline at end of file diff --git a/src/os.c b/src/os.c index d68a12f156..5b9f3a574f 100644 --- a/src/os.c +++ b/src/os.c @@ -1441,12 +1441,19 @@ int sqliteOsUnlock(OsFile *id){ ** supply a sufficiently large buffer. */ int sqliteOsRandomSeed(char *zBuf){ -#ifdef SQLITE_TEST - /* When testing, always use the same random number sequence. - ** This makes the tests repeatable. + /* We have to initialize zBuf to prevent valgrind from reporting + ** errors. The reports issued by valgrind are incorrect - we would + ** prefer that the randomness be increased by making use of the + ** uninitialized space in zBuf - but valgrind errors tend to worry + ** some users. Rather than argue, it seems easier just to initialize + ** the whole array and silence valgrind, even if that means less randomness + ** in the random seed. + ** + ** When testing, initializing zBuf[] to zero is all we do. That means + ** that we always use the same random number sequence.* This makes the + ** tests repeatable. */ memset(zBuf, 0, 256); -#endif #if OS_UNIX && !defined(SQLITE_TEST) int pid; time((time_t*)zBuf);