In the fuzzcheck test program, reduce the default expression depth limit

from 1000 to 500 to avoid stack-overflow problems when running stress tests
using clang ASAN.

FossilOrigin-Name: 63d886f4ce3c770498b8bdad45b04143a3f63197d81793bde107450aba4a9c87
This commit is contained in:
drh 2020-01-20 14:42:09 +00:00
parent 4b86e20485
commit be03cc9fcf
3 changed files with 18 additions and 7 deletions

View File

@ -1,5 +1,5 @@
C Enhancement\sto\sthe\sCLI\sto\sallow\sthe\s".parameter\sinit"\scommand\sto\swork\neven\sif\sdefensive\smode\sis\sturned\son.
D 2020-01-19T20:37:26.299
C In\sthe\sfuzzcheck\stest\sprogram,\sreduce\sthe\sdefault\sexpression\sdepth\slimit\nfrom\s1000\sto\s500\sto\savoid\sstack-overflow\sproblems\swhen\srunning\sstress\stests\nusing\sclang\sASAN.
D 2020-01-20T14:42:09.493
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -1013,7 +1013,7 @@ F test/fuzz3.test 9c813e6613b837cb7a277b0383cd66bfa07042b4cf0317157c35852f30043c
F test/fuzz4.test c229bcdb45518a89e1d208a21343e061503460ac69fae1539320a89f572eb634
F test/fuzz_common.tcl b7197de6ed1ee8250a4f82d67876f4561b42ee8cbbfc6160dcb66331bad3f830
F test/fuzz_malloc.test f348276e732e814802e39f042b1f6da6362a610af73a528d8f76898fde6b22f2
F test/fuzzcheck.c 0df68e0df3b93a8c8fc24c9873127c7d78024b51444193545f985dbc90ac024e
F test/fuzzcheck.c a9746aa49843827f960bc875cc70e04b0cfcd3e10e6676e3abc402ad190e165f
F test/fuzzdata1.db d36e88741b4f23bcbaaf55b006290669d03c6c891cf13c7b3a53bc1b097b693f
F test/fuzzdata2.db 128b3feeb78918d075c9b14b48610145a0dd4c8d6f1ca7c2870c7e425f5bf31f
F test/fuzzdata3.db c6586d3e3cef0fbc18108f9bb649aa77bfc38aba
@ -1857,7 +1857,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 535afe150939d06342fbbed4ca1b6a1472fde51ac9edd4b4b583b87d90f509c2
R 1531a276d37927ddd2ce25198eb53af3
P 4d46255096671ae7be33081e81bb25561304e069f459ffa7587f1f19381a1851
R 763d19098498df493f3b146f30ba61d0
U drh
Z 1873164af3e1828813bad7046bad8fa1
Z 3cfea19fe4fc4879265658e2adbc5ee0

View File

@ -1 +1 @@
4d46255096671ae7be33081e81bb25561304e069f459ffa7587f1f19381a1851
63d886f4ce3c770498b8bdad45b04143a3f63197d81793bde107450aba4a9c87

View File

@ -462,6 +462,9 @@ static unsigned int mxProgressCb = 2000;
/* Maximum string length in SQLite */
static int lengthLimit = 1000000;
/* Maximum expression depth */
static int depthLimit = 500;
/* Limit on the amount of heap memory that can be used */
static sqlite3_int64 heapLimit = 1000000000;
@ -789,6 +792,9 @@ int runCombinedDbSqlInput(const uint8_t *aData, size_t nByte){
if( lengthLimit>0 ){
sqlite3_limit(cx.db, SQLITE_LIMIT_LENGTH, lengthLimit);
}
if( depthLimit>0 ){
sqlite3_limit(cx.db, SQLITE_LIMIT_EXPR_DEPTH, depthLimit);
}
sqlite3_hard_heap_limit64(heapLimit);
if( nDb>=20 && aDb[18]==2 && aDb[19]==2 ){
@ -1304,6 +1310,7 @@ static void showHelp(void){
" --export-sql DIR Write SQL to file(s) in DIR. Also works with --sqlid\n"
" --help Show this help text\n"
" --info Show information about SOURCE-DB w/o running tests\n"
" --limit-depth N Limit expression depth to N\n"
" --limit-mem N Limit memory used by test SQLite instance to N bytes\n"
" --limit-vdbe Panic if any test runs for more than 100,000 cycles\n"
" --load-sql ARGS... Load SQL scripts fron files into SOURCE-DB\n"
@ -1406,6 +1413,10 @@ int main(int argc, char **argv){
if( strcmp(z,"info")==0 ){
infoFlag = 1;
}else
if( strcmp(z,"limit-depth")==0 ){
if( i>=argc-1 ) fatalError("missing arguments on %s", argv[i]);
depthLimit = integerValue(argv[++i]);
}else
if( strcmp(z,"limit-mem")==0 ){
if( i>=argc-1 ) fatalError("missing arguments on %s", argv[i]);
nMem = integerValue(argv[++i]);