/ Check-in [cfe0acf9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Reduce the randomness in the sqliteRandomSeed() routine in order to silence bogus errors from valgrind. Tickets #535 and #536. (CVS 1149)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: cfe0acf9ec6c89f1e77b8be7dcc23029984de1ce
User & Date: drh 2003-12-31 13:21:18
Context
2003-12-31
16:00
Fix a bug (ticket #541) introduced by the previous check-in ((1149)). (CVS 1150) check-in: 64624400 user: drh tags: trunk
13:21
Reduce the randomness in the sqliteRandomSeed() routine in order to silence bogus errors from valgrind. Tickets #535 and #536. (CVS 1149) check-in: cfe0acf9 user: drh tags: trunk
2003-12-24
01:41
minor edits for new date.c with mingw/msys on Windows (CVS 1148) check-in: 9392c514 user: dougcurrie tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os.c.

  1437   1437   
  1438   1438   /*
  1439   1439   ** Get information to seed the random number generator.  The seed
  1440   1440   ** is written into the buffer zBuf[256].  The calling function must
  1441   1441   ** supply a sufficiently large buffer.
  1442   1442   */
  1443   1443   int sqliteOsRandomSeed(char *zBuf){
  1444         -#ifdef SQLITE_TEST
  1445         -  /* When testing, always use the same random number sequence.
  1446         -  ** This makes the tests repeatable.
         1444  +  /* We have to initialize zBuf to prevent valgrind from reporting
         1445  +  ** errors.  The reports issued by valgrind are incorrect - we would
         1446  +  ** prefer that the randomness be increased by making use of the
         1447  +  ** uninitialized space in zBuf - but valgrind errors tend to worry
         1448  +  ** some users.  Rather than argue, it seems easier just to initialize
         1449  +  ** the whole array and silence valgrind, even if that means less randomness
         1450  +  ** in the random seed.
         1451  +  **
         1452  +  ** When testing, initializing zBuf[] to zero is all we do.  That means
         1453  +  ** that we always use the same random number sequence.* This makes the
         1454  +  ** tests repeatable.
  1447   1455     */
  1448   1456     memset(zBuf, 0, 256);
  1449         -#endif
  1450   1457   #if OS_UNIX && !defined(SQLITE_TEST)
  1451   1458     int pid;
  1452   1459     time((time_t*)zBuf);
  1453   1460     pid = getpid();
  1454   1461     memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid));
  1455   1462   #endif
  1456   1463   #if OS_WIN && !defined(SQLITE_TEST)