/ Check-in [c58de43b]
Login

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

Overview
Comment:Enable compilation of 'sessionfuzz' tool using MSVC.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c58de43b8f2723d659fc9820caf667e215fdfa9aa2d7337fc82ba5b6f8db2e4c
User & Date: mistachkin 2018-03-07 21:13:49
Context
2018-03-07
21:29
Fix harmless compiler warning in the 'sessionfuzz' tool. check-in: 706800ba user: mistachkin tags: trunk
21:13
Enable compilation of 'sessionfuzz' tool using MSVC. check-in: c58de43b user: mistachkin tags: trunk
20:48
Add the sessionfuzz test program and data obtained from a week of running AFL. Automatically run this test program on any "make test" on unix. check-in: ecaedfe5 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.msc.

  1704   1704   
  1705   1705   fuzzcheck.exe:	$(FUZZCHECK_SRC) $(SQLITE3C) $(SQLITE3H)
  1706   1706   	$(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(FUZZCHECK_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  1707   1707   
  1708   1708   ossshell.exe:	$(OSSSHELL_SRC) $(SQLITE3C) $(SQLITE3H)
  1709   1709   	$(LTLINK) $(NO_WARN) $(FUZZCHECK_COMPILE_OPTS) $(OSSSHELL_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  1710   1710   
         1711  +sessionfuzz.exe:	zlib $(TOP)\test\sessionfuzz.c $(SQLITE3C) $(SQLITE3H)
         1712  +	$(LTLINK) $(NO_WARN) -I$(ZLIBINCDIR) $(TOP)\test\sessionfuzz.c /link $(LDFLAGS) $(LTLINKOPTS) /LIBPATH:$(ZLIBLIBDIR) $(ZLIBLIB)
         1713  +
  1711   1714   mptester.exe:	$(TOP)\mptest\mptest.c $(SQLITE3C) $(SQLITE3H)
  1712   1715   	$(LTLINK) $(NO_WARN) $(MPTESTER_COMPILE_OPTS) $(TOP)\mptest\mptest.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  1713   1716   
  1714   1717   MPTEST1 = mptester mptest.db $(TOP)\mptest\crash01.test --repeat 20
  1715   1718   MPTEST2 = mptester mptest.db $(TOP)\mptest\multiwrite01.test --repeat 20
  1716   1719   
  1717   1720   mptest:	mptester.exe

Changes to test/sessionfuzz.c.

    46     46   **
    47     47   **     ./sessionfuzz run session-cases.db
    48     48   */
    49     49   
    50     50   /*
    51     51   ** We will import the entire SQLite source file to make compiling easier
    52     52   */
           53  +#ifdef SQLITE_DEBUG
           54  +#undef SQLITE_DEBUG
           55  +#endif
           56  +
           57  +#ifdef SQLITE_THREADSAFE
           58  +#undef SQLITE_THREADSAFE
           59  +#endif
           60  +
    53     61   #define SQLITE_DEBUG 1
    54     62   #define SQLITE_THREADSAFE 0
    55     63   #define SQLITE_OMIT_LOAD_EXTENSION 0
    56     64   #define SQLITE_ENABLE_SESSION 1
    57     65   #define SQLITE_ENABLE_PREUPDATE_HOOK 1
    58     66   #define SQLITE_ENABLE_DESERIALIZE 1
    59     67   #include "sqlite3.c"
................................................................................
   798    806     pBuf = sqlite3_malloc64( nIn+1 );
   799    807     if( pBuf==0 ){
   800    808       fprintf(stderr, "Failed to malloc %lld bytes\n", (sqlite3_int64)(nIn+1));
   801    809       exit(1);
   802    810     }
   803    811     nRead = fread(pBuf, 1, nIn, in);
   804    812     fclose(in);
   805         -  if( nRead!=nIn ){
          813  +  if( nRead!=(size_t)nIn ){
   806    814       fprintf(stderr, "Read only %d of %d bytes from %s\n", (int)nRead, (int)nIn,
   807    815                       zName);
   808    816       exit(1);
   809    817     }
   810    818     pBuf[nIn] = 0;
   811    819     *pnData = nIn;
   812    820     *ppData = pBuf;