]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add logic to releasetest.tcl that detects -fsanitize=undefined errors.
authordrh <drh@noemail.net>
Thu, 1 Jan 2015 23:02:01 +0000 (23:02 +0000)
committerdrh <drh@noemail.net>
Thu, 1 Jan 2015 23:02:01 +0000 (23:02 +0000)
Fix a few false-positivies that come up when running the sanitize=undefined
test.

FossilOrigin-Name: 2835e79a0afec6e4d449ac9340afec068c2d4c11

ext/misc/fuzzer.c
manifest
manifest.uuid
src/analyze.c
src/test8.c
test/permutations.test
test/releasetest.tcl

index fe41cda8c24ae3dfcd58b01f46fe075fbbcd00f9..dc03161aafae7eb2dc3c01b5f7f12eac263bec08 100644 (file)
@@ -342,7 +342,8 @@ static int fuzzerLoadOneRule(
       rc = SQLITE_NOMEM;
     }else{
       memset(pRule, 0, sizeof(*pRule));
-      pRule->zFrom = &pRule->zTo[nTo+1];
+      pRule->zFrom = pRule->zTo;
+      pRule->zFrom += nTo + 1;
       pRule->nFrom = nFrom;
       memcpy(pRule->zFrom, zFrom, nFrom+1);
       memcpy(pRule->zTo, zTo, nTo+1);
index 13a4c6435b5f8dd3b976ea72757b60c733e8254e..be8e05d98a4ff759737c0888744ab78dfc03290f 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\sthe\sability\sto\sspecify\san\salternative\scompiler\s(clang\sinstead\sof\sgcc)\non\sthe\sdefault\sMakefile.\s\sUse\sthis\sin\sreleasetest.tcl\sto\simplement\san\n-fsanitize=undefined\stest.
-D 2015-01-01T19:53:10.337
+C Add\slogic\sto\sreleasetest.tcl\sthat\sdetects\s-fsanitize=undefined\serrors.\nFix\sa\sfew\sfalse-positivies\sthat\scome\sup\swhen\srunning\sthe\ssanitize=undefined\ntest.
+D 2015-01-01T23:02:01.908
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -111,7 +111,7 @@ F ext/misc/closure.c 636024302cde41b2bf0c542f81c40c624cfb7012
 F ext/misc/compress.c 76e45655f4046e756064ab10c62e18f2eb846b9f
 F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2
 F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f
-F ext/misc/fuzzer.c 136533c53cfce0957f0b48fa11dba27e21c5c01d
+F ext/misc/fuzzer.c e3e18f47252c151b5553d7e806f38e757d37c4cc
 F ext/misc/ieee754.c b0362167289170627659e84173f5d2e8fee8566e
 F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342
 F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63
@@ -167,7 +167,7 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
 F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786
 F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
 F src/alter.c ba266a779bc7ce10e52e59e7d3dc79fa342e8fdb
-F src/analyze.c 7a2986e6ea8247e5f21aca3d0b584598f58d84fe
+F src/analyze.c 91540f835163d5369ccbae78e2e6c74d0dd53c1d
 F src/attach.c 7f6b3fafa2290b407e4a94dcf1afda7ec0fe394b
 F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240
 F src/backup.c 7ddee9c7d505e07e959a575b18498f17c71e53ea
@@ -245,7 +245,7 @@ F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df
 F src/test5.c 5a34feec76d9b3a86aab30fd4f6cc9c48cbab4c1
 F src/test6.c 41cacf3b0dd180823919bf9e1fbab287c9266723
 F src/test7.c 72b732baa5642f795655ba1126ea032af46ecfd2
-F src/test8.c 54ccd7b1df5062f0ecbf50a8f7b618f8b1f13b20
+F src/test8.c bf3bad9a7df2e7c58d3371ea913abeaedb429a38
 F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60
 F src/test_async.c 21e11293a2f72080eda70e1124e9102044531cd8
 F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12
@@ -782,7 +782,7 @@ F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0
 F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d
 F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025
 F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff
-F test/permutations.test 59e2d8aba8c4f5842edba1a10a158b798690d3ba
+F test/permutations.test 3a58611f8b703d385015bbe1710c722ff900f2ee
 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5
 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13
 F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c
@@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df
 F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a
 F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8
 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
-F test/releasetest.tcl dbb2dbbf82fbd05e30abac638c382a5b6f808407
+F test/releasetest.tcl facd103f341b2ecb5b86569b7e657d59027bd9dd
 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a
 F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea
 F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14
@@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P da408d128b4301d9fc7a3a00f219dce7ed48bc60
-R ca09f55008007dc6e5522170a985ac90
+P c55c05fe22b9ddb61de55d473a411a11090d3d68
+R e6aaf3935879f250648e86cbf64d3bdf
 U drh
-Z 2d169330368dfa1bfb6338447f689c29
+Z 20260de80f5f5cb2f8311d6a05cba05e
index 48bbba87a322f8a3ecf7d6c1600b67aa53dc9d33..b69d1dbdb9ba52b3150ac707abfaa60c3637e605 100644 (file)
@@ -1 +1 @@
-c55c05fe22b9ddb61de55d473a411a11090d3d68
\ No newline at end of file
+2835e79a0afec6e4d449ac9340afec068c2d4c11
\ No newline at end of file
index e483807116ab27f3fd4c6aec0dcc068ce4eb141d..fec2bdb39dc279dd0d4341e391adf0b17bd4dd6a 100644 (file)
@@ -448,7 +448,7 @@ static void statInit(
     p->mxSample = mxSample;
     p->nPSample = (tRowcnt)(sqlite3_value_int64(argv[2])/(mxSample/3+1) + 1);
     p->current.anLt = &p->current.anEq[nColUp];
-    p->iPrn = nCol*0x689e962d ^ sqlite3_value_int(argv[2])*0xd0944565;
+    p->iPrn = 0x689e962d*(u32)nCol ^ 0xd0944565*(u32)sqlite3_value_int(argv[2]);
   
     /* Set up the Stat4Accum.a[] and aBest[] arrays */
     p->a = (struct Stat4Sample*)&p->current.anLt[nColUp];
index 8bc835d638c322ce4c0353bdfd2ed46d8d0b69dd..407dd54c790197b1bb992461ab47ef1f621908b5 100644 (file)
@@ -648,12 +648,12 @@ static int echoRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
 ** indeed the hash of the supplied idxStr.
 */
 static int hashString(const char *zString){
-  int val = 0;
+  u32 val = 0;
   int ii;
   for(ii=0; zString[ii]; ii++){
     val = (val << 3) + (int)zString[ii];
   }
-  return val;
+  return (int)(val&0x7fffffff);
 }
 
 /* 
index fea70a60e8c2e3db389e5251b3b686b3dac11d9a..232e8f97043ebc7b146bdb316db3247684d87170 100644 (file)
@@ -118,6 +118,11 @@ set allquicktests [test_set $alltests -exclude {
 if {[info exists ::env(QUICKTEST_INCLUDE)]} {
   set allquicktests [concat $allquicktests $::env(QUICKTEST_INCLUDE)]
 }
+if {[info exists ::env(QUICKTEST_OMIT)]} {
+  foreach x [split $::env(QUICKTEST_OMIT) ,] {
+    regsub -all \\y$x\\y $allquicktests {} allquicktests
+  }
+}
 
 #############################################################################
 # Start of tests
index 772e5e481a27e9a7e3948cfea6e6a0c2dd20444e..342a4069b9f01cd0327b17e841369b70c879e9e6 100644 (file)
@@ -37,10 +37,9 @@ array set ::Configs {
     -DSQLITE_MAX_ATTACHED=125
     -DSQLITE_TCL_DEFAULT_FULLMUTEX=1
   }
-  "Clang-Sanitize" {
+  "Sanitize" {
     CC=clang -fsanitize=undefined
-    -DSQLITE_MAX_ATTACHED=125
-    -DSQLITE_TCL_DEFAULT_FULLMUTEX=1
+    -DSQLITE_ENABLE_STAT4
   }
   "Unlock-Notify" {
     -O2
@@ -72,6 +71,7 @@ array set ::Configs {
     -DSQLITE_ENABLE_ATOMIC_WRITE=1
     -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1
     -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1
+    -DSQLITE_ENABLE_STAT4
   }
   "Debug-One" {
     -O2
@@ -84,6 +84,7 @@ array set ::Configs {
     -DSQLITE_ENABLE_MEMSYS5=1
     -DSQLITE_ENABLE_MEMSYS3=1
     -DSQLITE_ENABLE_COLUMN_METADATA=1
+    -DSQLITE_ENABLE_STAT4
   }
   "Device-One" {
     -O2
@@ -172,7 +173,7 @@ array set ::Platforms {
     "Extra-Robustness"        test
     "Device-Two"              test
     "Ftrapv"                  test
-    "Clang-Sanitize"          test
+    "Sanitize"                {QUICKTEST_OMIT=func4.test,nan.test test}
     "No-lookaside"            test
     "Devkit"                  test
     "Default"                 "threadtest fulltest"
@@ -235,6 +236,13 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} {
         set errmsg $line
       }
     }
+    if {[regexp {runtime error: +(.*)} $line all msg]} {
+      incr ::NERRCASE
+      if {$rc==0} {
+        set rc 1
+        set errmsg $msg
+      }
+    }
   }
   close $fd
   if {!$seen} {