From: drh Date: Fri, 25 Jan 2019 04:43:26 +0000 (+0000) Subject: Improved automatic detection of dbsqlfuzz cases in fuzzcheck. X-Git-Tag: version-3.27.0~84^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=df21659a40e9dcaaeb4faecb0d13704e359296f2;p=thirdparty%2Fsqlite.git Improved automatic detection of dbsqlfuzz cases in fuzzcheck. FossilOrigin-Name: 1ef24e89c9630fd383ba32f5aefcf9c27907f27f5072f3537a1cfd75a093a8d7 --- diff --git a/manifest b/manifest index 1a0ca0401f..fb82c3f1fa 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\sability\sto\sprocess\sdbsqlfuzz\scases\sin\sfuzzcheck\sand\sadd\san\sinitial\nset\sof\sinteresting\sdbsqlfuzz\scases. -D 2019-01-25T04:00:14.721 +C Improved\sautomatic\sdetection\sof\sdbsqlfuzz\scases\sin\sfuzzcheck. +D 2019-01-25T04:43:26.372 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F Makefile.in 9947eae873c07ae894d4c8633b76c0a0daca7b9fd54401096a77d1a6c7b74359 @@ -984,7 +984,7 @@ F test/fuzz3.test 9c813e6613b837cb7a277b0383cd66bfa07042b4cf0317157c35852f30043c F test/fuzz4.test c229bcdb45518a89e1d208a21343e061503460ac69fae1539320a89f572eb634 F test/fuzz_common.tcl a87dfbb88c2a6b08a38e9a070dabd129e617b45b F test/fuzz_malloc.test f348276e732e814802e39f042b1f6da6362a610af73a528d8f76898fde6b22f2 -F test/fuzzcheck.c 4082901a0665a5135b295fe81aa0ee325d42e1e28a0e3058a4082d249a321899 +F test/fuzzcheck.c 1a65151681ada94f8543ccfe07fbd2d5ba509efdc74bd144569f8d61f242e707 F test/fuzzdata1.db 7ee3227bad0e7ccdeb08a9e6822916777073c664 F test/fuzzdata2.db 128b3feeb78918d075c9b14b48610145a0dd4c8d6f1ca7c2870c7e425f5bf31f F test/fuzzdata3.db c6586d3e3cef0fbc18108f9bb649aa77bfc38aba @@ -1803,10 +1803,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P d0d5689371577b2861d4a9464443d055f3256f3f51d89e0388233a4cbe2601ee -R a483eb7b902b414248e92f9e64472126 -T *branch * dbsqlfuzz-in-fuzzcheck -T *sym-dbsqlfuzz-in-fuzzcheck * -T -sym-trunk * +P fb9074ff450a67feaa62ca61d19154de26d5c8a8d147409ee6d1fbd667b2914f +R 1a930dbefe744ebdcb05eea9b0188b90 U drh -Z 174f299274057b1d40bc6ac9348469f7 +Z c5c751ac97a3bb1a31a35d47c24bdd62 diff --git a/manifest.uuid b/manifest.uuid index 71191813f9..698172e5dd 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -fb9074ff450a67feaa62ca61d19154de26d5c8a8d147409ee6d1fbd667b2914f \ No newline at end of file +1ef24e89c9630fd383ba32f5aefcf9c27907f27f5072f3537a1cfd75a093a8d7 \ No newline at end of file diff --git a/test/fuzzcheck.c b/test/fuzzcheck.c index 3175bf33e7..3fac76d9a2 100644 --- a/test/fuzzcheck.c +++ b/test/fuzzcheck.c @@ -604,7 +604,7 @@ static int progress_handler(void *pClientData) { if( iDiff > p->mxInterval ) p->mxInterval = iDiff; p->nCb++; if( rc==0 && p->mxCb>0 && p->mxCb<=p->nCb ) rc = 1; - if( rc && !p->timeoutHit && eVerbosity ){ + if( rc && !p->timeoutHit && eVerbosity>=2 ){ printf("Timeout on progress callback %d\n", p->nCb); fflush(stdout); p->timeoutHit = 1; @@ -653,14 +653,14 @@ static int runDbSql(sqlite3 *db, const char *zSql){ sqlite3_stmt *pStmt; while( isspace(zSql[0]) ) zSql++; if( zSql[0]==0 ) return SQLITE_OK; - if( eVerbosity>=3 ){ + if( eVerbosity>=4 ){ printf("RUNNING-SQL: [%s]\n", zSql); fflush(stdout); } rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc==SQLITE_OK ){ while( (rc = sqlite3_step(pStmt))==SQLITE_ROW ){ - if( eVerbosity>=4 ){ + if( eVerbosity>=5 ){ int j; for(j=0; j=4 ) */ + } /* End if( eVerbosity>=5 ) */ } /* End while( SQLITE_ROW */ - if( rc!=SQLITE_DONE && eVerbosity>=3 ){ + if( rc!=SQLITE_DONE && eVerbosity>=4 ){ printf("SQL-ERROR: (%d) %s\n", rc, sqlite3_errmsg(db)); fflush(stdout); } - }else if( eVerbosity>=3 ){ + }else if( eVerbosity>=4 ){ printf("SQL-ERROR (%d): %s\n", rc, sqlite3_errmsg(db)); fflush(stdout); } /* End if( SQLITE_OK ) */ @@ -745,7 +745,7 @@ int runCombinedDbSqlInput(const uint8_t *aData, size_t nByte){ iSql = decodeDatabase((unsigned char*)aData, (int)nByte, &aDb, &nDb); if( iSql<0 ) return 0; nSql = nByte - iSql; - if( eVerbosity>=2 ){ + if( eVerbosity>=3 ){ printf( "****** %d-byte input, %d-byte database, %d-byte script " "******\n", (int)nByte, nDb, nSql); @@ -830,7 +830,7 @@ testrun_finished: if( rc!=SQLITE_OK ){ fprintf(stdout, "sqlite3_close() returns %d\n", rc); } - if( eVerbosity ){ + if( eVerbosity>=2 ){ fprintf(stdout, "Peak memory usages: %f MB\n", sqlite3_memory_highwater(1) / 1000000.0); } @@ -854,9 +854,14 @@ testrun_finished: ** true if this does appear to be a dbsqlfuzz test case and false otherwise. */ static int isDbSql(unsigned char *a, int n){ + unsigned char buf[12]; + int i; if( n>4 && memcmp(a,"\n--\n",4)==0 ) return 1; while( n>0 && isspace(a[0]) ){ a++; n--; } - if( n>8 && memcmp(a,"53514c69",8)==0 ) return 1; + for(i=0; n>0 && i<8; n--, a++){ + if( isxdigit(a[0]) ) buf[i++] = a[0]; + } + if( i==8 && memcmp(buf,"53514c69",8)==0 ) return 1; return 0; }