1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

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
This commit is contained in:
drh
2017-03-13 13:45:29 +00:00
parent ba28b5ab0a
commit bbc0177460
3 changed files with 12 additions and 10 deletions

View File

@ -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 */