From bbc017746009e30bbac905bbd67dd1c7e1ac384c Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 13 Mar 2017 13:45:29 +0000 Subject: [PATCH] In the OSSFuzz test module, invoke the progress handler much more frequently so that timeouts are detected punctually even if the test script is running opcodes that individually take a long time (for example, an OP_Function opcode that invokes "randomblob(1.5e6)"). FossilOrigin-Name: f3b6959c04c4ef7b8ff03582b867012a869d52b4a90a0d7ab079ee4c21be5464 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/ossfuzz.c | 8 +++++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index fe7c037a95..ba1564ad2c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\spossible\sNULL\spointer\sdereference\sin\sfollowing\san\sOOM\serror\nin\ssqlite3ExprIsInteger().\sProblem\sfound\sby\sOSS-Fuzz. -D 2017-03-12T20:28:44.701 +C In\sthe\sOSSFuzz\stest\smodule,\sinvoke\sthe\sprogress\shandler\smuch\smore\sfrequently\nso\sthat\stimeouts\sare\sdetected\spunctually\seven\sif\sthe\stest\sscript\sis\srunning\nopcodes\sthat\sindividually\stake\sa\slong\stime\s(for\sexample,\san\sOP_Function\sopcode\nthat\sinvokes\s"randomblob(1.5e6)"). +D 2017-03-13T13:45:29.519 F Makefile.in 2dae2a56457c2885425a480e1053de8096aff924 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 9020fa41eb91f657ae0cc44145d0a2f3af520860 @@ -1006,7 +1006,7 @@ F test/orderby7.test 3d1383d52ade5b9eb3a173b3147fdd296f0202da F test/orderby8.test 23ef1a5d72bd3adcc2f65561c654295d1b8047bd F test/orderby9.test 87fb9548debcc2cd141c5299002dd94672fa76a3 F test/oserror.test b32dc34f2363ef18532e3a0a7358e3e7e321974f -F test/ossfuzz.c f04b9f236e51d4db701bdebe8ac01318c83102a8 +F test/ossfuzz.c 6dc75478809cfbd4609409a87179ddc2ffaa092e8adb27c1982c5a944a7dd81f F test/ossshell.c d9f1a6f43e7bab45d6be857a5800f5d4a1861db3 F test/ovfl.test 199c482696defceacee8c8e0e0ef36da62726b2f F test/pager1.test 841868017e9dd3cb459b8d78862091a7d9cff21d @@ -1562,7 +1562,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 18bf6aca2ac86478fd12d5020f3a41cfd2bd2dc3defe2298411f79ad308a6f73 -R ca6b9859462ac91c5f6d6ceb39023c31 +P 5ec655e8e817c1ed3bfb2e576745a7cef441494ad7baf1bf9f8895e98ac19c5a +R 5ec7c17c414d77e4ccd9fef1ac3d681c U drh -Z af1824315a47164e92b4aa40f4d2923c +Z 5b49012ad9ab98ef47d2e1e6f7e9b1e7 diff --git a/manifest.uuid b/manifest.uuid index d832e1d80a..4616ab6ffc 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5ec655e8e817c1ed3bfb2e576745a7cef441494ad7baf1bf9f8895e98ac19c5a \ No newline at end of file +f3b6959c04c4ef7b8ff03582b867012a869d52b4a90a0d7ab079ee4c21be5464 \ No newline at end of file diff --git a/test/ossfuzz.c b/test/ossfuzz.c index 91b3d1141e..97d101e17a 100644 --- a/test/ossfuzz.c +++ b/test/ossfuzz.c @@ -77,11 +77,13 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { if( rc ) return 0; #ifndef SQLITE_OMIT_PROGRESS_CALLBACK - /* Invoke the progress handler every 500 thousand instructions (approximately - ** 20 to 40 times per second) to check to see if we are taking too long. + /* Invoke the progress handler frequently to check to see if we + ** are taking too long. The progress handler will return true + ** (which will block further processing) if more than 10 seconds have + ** elapsed since the start of the test. */ iCutoff = timeOfDay() + 10000; /* Now + 10 seconds */ - sqlite3_progress_handler(db, 500000, progress_handler, (void*)&iCutoff); + sqlite3_progress_handler(db, 10, progress_handler, (void*)&iCutoff); #endif /* Bit 1 of the selector enables foreign key constraints */