Commit Graph

63 Commits

Author SHA1 Message Date
drh
f0a2172d1d Fix an integer overflow problem with the dbstat virtual table that comes up
when trying to analyze a corrupt database.

FossilOrigin-Name: 1d64f4a8af81fe1235fffa54884d8f842a48ff6a33d6172f0cd65bf42fe8b2a1
2020-03-19 17:27:52 +00:00
drh
39b3bcf8ef Enhance the fuzzcheck test program so that it is able to simulate OOM errors
in the same way that dbsqlfuzz does.

FossilOrigin-Name: a65c8d4e26b2428ecb8232a4a6a44443aa1701319223397e61a823a5aa1827de
2020-03-02 16:31:21 +00:00
drh
a8781d9d93 Update the fuzzcheck test module so that it avoids inserting text values
that contain embedded NULs in the XSQL table.  Fix some legacy entries in
the test/fuzzdata8.db that had embedded NULs.  Add in new dbsqlfuzz cases
that have accumulated over on the dbsqlfuzz project for a while.

FossilOrigin-Name: 47d4240c4a837e829f593bb2aad7563010838f55345e7a0d8e2ea79462aeeb3c
2020-02-25 20:05:58 +00:00
drh
be03cc9fcf 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
2020-01-20 14:42:09 +00:00
drh
6e1c45ef2e Add the --vdbe-debug option to fuzzcheck.
FossilOrigin-Name: 289158aa24b066c453d2bce4bc2dead1c56fb0b23c3f7c4810b34b13627cef34
2019-12-18 13:42:04 +00:00
drh
a7648f02e0 Enhancements to fuzzcheck on unix so that it captures signals and prints
the current test file and test number prior to terminating.

FossilOrigin-Name: ae7cbb246bff3717c283869ccf27ce83611422f3801176819465a8d96f6481bf
2019-12-18 13:02:18 +00:00
drh
31999c5cac Fix a bug in the hard_heap_limit pragma so that it returns the new value of
the hard_heap_limit, not the soft_heap_limit.  Change SQLITE_MAX_MEMORY so
that it works by setting the default hard_heap_limit value.

FossilOrigin-Name: 33fd0c3abcad5555a150990a22d9c1bab99e79be01143fccb9fafc9b52cf92c8
2019-11-14 17:46:32 +00:00
drh
2e6d83bc49 Give the SQLITE_TESTCTRL_PRNG_SEED two arguments. The second argument if not
NULL is a pointer to a database connection which seeds the connection from
its schema cookie.  In this way, fuzzers can control the PRNG seed.

FossilOrigin-Name: 49aa34480622cce4d7a72c59d9cfa8336886387acec8ee15b72f295ea1a52d8c
2019-08-03 01:39:20 +00:00
drh
e6e96b1b45 Fixes to the PRNG_SEED pragma idea.
FossilOrigin-Name: c71098409c98af8360f8f28b9238a12ec764018a5782e8ff03fdf5db54031d6e
2019-08-02 21:03:24 +00:00
mistachkin
065f3bf4f2 Fix various harmless compiler warnings seen with MSVC.
FossilOrigin-Name: 1c0fe5b5763fe5cbace9773dcdab742e126d0bd035ab13d61f9d134afa0afc0c
2019-03-20 05:45:03 +00:00
drh
af63892337 In the fuzzcheck test program, make sure the isspace() and related routines
are not given values outside the range of -1 to 255.

FossilOrigin-Name: f298328771d5aaba798d05f50c77ac239c7c72422ff35953463d6876a9659f74
2019-02-07 00:17:36 +00:00
drh
e5da9356e0 Update fuzzcheck so that with the --load-dbsql options it screens its
inputs to ensure that they are valid dbsqlfuzz cases.  Add new dbsqlfuzz
finds to the test/fuzzdata8.db database.

FossilOrigin-Name: 004f7d9bbeee049c22a7e1c82c6cc0ea79a237967de3ff57686acea3060d5f45
2019-01-27 01:11:40 +00:00
drh
ed457037c4 Fix harmless compiler warnings in fuzzcheck
FossilOrigin-Name: a82539665718c8183d9d0bb7bcb3adcb1a23294b8c30f364829a982dab89a332
2019-01-25 17:51:06 +00:00
drh
725a9c7f6c In fuzzcheck, activate vdbe_debug for dbsqlfuzz cases when using the -vvvvv
verbosity level or above.

FossilOrigin-Name: 2e6f7c2aced49824a38b3494b796a8ec73aa7a90b51159f670596df15ed1c5ab
2019-01-25 13:03:38 +00:00
drh
df21659a40 Improved automatic detection of dbsqlfuzz cases in fuzzcheck.
FossilOrigin-Name: 1ef24e89c9630fd383ba32f5aefcf9c27907f27f5072f3537a1cfd75a093a8d7
2019-01-25 04:43:26 +00:00
drh
a47e709e89 Add the ability to process dbsqlfuzz cases in fuzzcheck and add an initial
set of interesting dbsqlfuzz cases.

FossilOrigin-Name: fb9074ff450a67feaa62ca61d19154de26d5c8a8d147409ee6d1fbd667b2914f
2019-01-25 04:00:14 +00:00
drh
e45985b595 Fix a bug in the custom in-memory VFS used by fuzzcheck. This bug masks
other bugs that should have caused some existing fuzzdata7.db entries to
fail, and so this fix is initially on a branch until those other bugs can
be repaired.

FossilOrigin-Name: e0994e99955cf11f23dba029b5ed7f150f467887558848d5f03510e2fb5855f9
2018-12-14 02:29:56 +00:00
drh
8055a3ead4 Improvements to the ossfuzz.c fuzz-testing module so that it works with
-DSQLITE_OMIT_PROGRESS_CALLBACK and with -DSQLITE_OMIT_INIT.

FossilOrigin-Name: d343f7d6b05865c282eb73a0e39dc396f2927982af45b3d045de03ef73715693
2018-11-21 14:27:34 +00:00
drh
5180d683a0 Add the --info option to the fuzzcheck test utility.
FossilOrigin-Name: 1caaaaa70f21fe71fbe0af227eea8d1367870e2575eedf248cc2a0b515783390
2018-08-06 01:39:31 +00:00
drh
f2cf412a0a Fix a harmless compiler warning in fuzzcheck. Add new OSSFuzz test cases
to the test case library.

FossilOrigin-Name: d2619746cb233f4be127a77988548dd1d90eebddf0d0ac9107913b240553e5d0
2018-05-08 13:03:31 +00:00
drh
5ecf9039b0 Fuzz test cases for UPSERT.
FossilOrigin-Name: fd11fbd21893d520de5a2249f825ecb5839fa4943f5c207e9e9bf8b52f4e2695
2018-05-08 12:49:53 +00:00
mistachkin
ac8ba26ecb Fix utility compilation issues with MSVC.
FossilOrigin-Name: 5bd5a79898790bef150b2bc7f275333444b1a723385e595931377ff4d32190bf
2018-03-07 14:42:17 +00:00
drh
174f855306 Add the --native-malloc option to fuzzcheck. Fix ossfuzz.c and fuzzcheck.c
so that they both deallocate the temp_store_directory before closing.

FossilOrigin-Name: 0dd18ec882bb28a87629d6d8dfeb5ea5d82833634b3781a7d14b917272c4dfa0
2017-03-20 22:58:27 +00:00
drh
16f0582c1b Fix the fuzzcheck program so that it can create new databases again.
FossilOrigin-Name: 021e8874a7d1bb94debae3ae04f83056a8573148ffc872cd76a186a2d22d0296
2017-03-20 20:42:21 +00:00
drh
d0d7e13511 Fix a harmless compiler warning in fuzzcheck.c
FossilOrigin-Name: 2842bc60538369f888c7df8365858c910322277d
2016-12-30 12:10:48 +00:00
drh
dfcfff646a During fuzz testing with the fuzzcheck utility program, impose a record
length limit of 100MB and a limit on the length of LIKE strings of 50 bytes.

FossilOrigin-Name: edc9db41f3ee200ba44579a46ed8331bbbbf539e
2016-12-26 12:25:19 +00:00
drh
beaf514e23 Enhance the fuzztest utility with the --prng-seed option. Always reseed the
PRNG prior to each test.

FossilOrigin-Name: 8c5187f69d719b69aa6eaf2dc8f89243e5979222
2016-12-26 00:15:56 +00:00
drh
362b66f051 Enhance fuzzcheck.c to accept database-specific configuration parameters in
the option CONFIG table.  Add the fuzzdata5.db fuzz database containing
test cases from OSS-FUZZ.

FossilOrigin-Name: a71fad4538311ede111815d221d9eb8d9018092b
2016-11-14 18:27:41 +00:00
drh
ea432ba2df Add the test/ossfuzz.c interface adaptor for OSS-FUZZ. Make previsions for
testing the adaptor using fuzzcheck.c.

FossilOrigin-Name: 119d6ef8478ea6ab07dfd0e974d2f5a8dcfce87e
2016-11-11 16:33:47 +00:00
drh
a36e01a772 Fix the --help output on fuzzcheck so that it fix in an 80-character window.
FossilOrigin-Name: b91444b5db8465f09d112455e722c888b3f94329
2016-08-03 13:40:54 +00:00
drh
c5412d533c Avoid calling realloc() with a zero size in fuzzcheck.c.
FossilOrigin-Name: a1fd14694c1adc54e5c443ebfdef38e38637f5c5
2016-03-23 17:54:19 +00:00
drh
b2bddbbc2d Avoid a potential buffer overrun if an SQL statement being parsed ends
with an illegal "!" token.  (This problem was detected by fuzzcheck
running under valgrind. The problem was introduced by check-in [9570b6b43df3].)

FossilOrigin-Name: 2a8d97e7c8976df0312e1294e8c1da8b15686654
2016-02-18 14:49:28 +00:00
drh
4c9d22819f Improved handling of the -v option on the fuzzcheck test program.
FossilOrigin-Name: c8cd7804dc905b2b20cd7c0192bcfaceaaa7e2a8
2016-02-18 14:03:15 +00:00
drh
e683b89880 Fix harmless compiler warnings previously seen in 64-bit MSVC builds.
FossilOrigin-Name: 7026246300392a83cc23817dbc54c2c66bf1f2b3
2016-02-15 18:47:26 +00:00
drh
8d52c3b767 Disable the --limit-mem option on fuzzcheck unless the SQLITE_ENABLE_MEMSYS5 or
SQLITE_ENABLE_MEMSYS3 compile-time options are used.

FossilOrigin-Name: 55a11fd627eaf046b3783622b2925399a50a65b4
2016-01-06 15:54:53 +00:00
drh
5337dacbad Remove unused methods from the unix VFS.
FossilOrigin-Name: 228bd15bbb7a1e6e3e0d03832e7f39ba169356a8
2015-11-25 15:15:03 +00:00
drh
6653fbe91f Fix a memory leak in the fuzzcheck utility.
FossilOrigin-Name: dfd6d9f4fbe902086f9158dfa5f37e781765a683
2015-11-13 20:52:49 +00:00
drh
c56fac7483 Fix uses of ctype functions (ex: isspace()) on signed characters in test
programs and in some obscure extensions.  No changes to the core.

FossilOrigin-Name: 34eb6911afee09e779318b79baf953f616200128
2015-10-29 13:48:15 +00:00
drh
021643560b Fix fuzzcheck.c so that it assumes that JSON1 is already compiled in and
does not need to be initialized further.

FossilOrigin-Name: ec003958359d6b69b1b1a75be2a988796268e063
2015-10-14 19:44:42 +00:00
mistachkin
f2c26ed17b Fix a couple harmless compiler warnings.
FossilOrigin-Name: 7f896a971c5953d5370215ecd834d1fb711b4263
2015-10-12 22:20:29 +00:00
drh
40e0e0dbe7 Add the --export-sql and --export-db options to the fuzzcheck utility program.
FossilOrigin-Name: 760af4455115669b934c3115d45cffe89c085faf
2015-09-22 18:51:17 +00:00
drh
9cdd1029e5 Fix a typo in the --help screen of the fuzzcheck utility.
FossilOrigin-Name: b6ae61fe3b3de3aa296b3e56cd2ec425a5141c73
2015-09-22 17:46:11 +00:00
drh
d7f2beab86 Include json1.c in fuzzcheck and fuzzershell.
FossilOrigin-Name: c4b68eff7f8f5402a9abf378157767b1c96a6101
2015-09-19 14:32:51 +00:00
drh
53e66c3cda More robust handling of zeroblob() with oversized arguments. Fix fuzzcheck
so that it can be run with limited heap memory.

FossilOrigin-Name: 4e3e516a42059c97f42a7eb59bdf5cded0ff843a
2015-07-24 15:49:23 +00:00
drh
d4ddcbc121 Increase the default timeout on fuzzcheck to 120 seconds - sufficient for
running under valgrind on a slow workstation.

FossilOrigin-Name: fad0eacc64b1810f60cab73bc88ba380f99e4b2d
2015-06-25 02:25:28 +00:00
drh
92298637ca Add the --timeout option to fuzzcheck.
FossilOrigin-Name: a8f4f7fa99e5e4131c1b59c0ac0597d62cedc0cd
2015-06-24 23:44:30 +00:00
drh
780573510b Fix fuzzcheck so that it works with SQLITE_OMIT_PROGRESS_CALLBACK.
FossilOrigin-Name: 7a9c4eb30e6a834da20931b535c2894837d7d5d7
2015-06-24 23:17:35 +00:00
drh
d83e2831b7 In the fuzzcheck test program, use the progress handler to limit the number
of VDBE cycles to avoid getting stuck if the SQL under test contains an
infinite CTE loop.  Add the --limit-vdbe command-line option.

FossilOrigin-Name: fbf9c4325e98120914bb03bdf351b57643f7a8c8
2015-06-24 14:45:44 +00:00
drh
94701b048a Rig the fuzzcheck test program so that it times out after 10 seconds in case
of an infinite loop in the test case.

FossilOrigin-Name: 659cfc9d1e9db83db171d621f248a7c2a5b183f6
2015-06-24 13:25:34 +00:00
drh
9a64586864 Add the --rebuild object to fuzzcheck.
FossilOrigin-Name: db87664a224f44e01b85570a3f3b6ec1c81d6e0a
2015-06-24 12:44:42 +00:00