Skip to content

Fuzztest fails to build after 4.7.0 #555

@IrfanMusa

Description

@IrfanMusa

In v4.7.0, we have new instruction to configure sqlcipher. To run SQLCipher specific tests, configure as described in README and run the following to execute the tests

$ ./configure --with-tempstore=yes --enable-fts5 CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_EXTRA_INIT=sqlcipher_extra_init -DSQLITE_EXTRA_SHUTDOWN=sqlcipher_extra_shutdown -DSQLCIPHER_TEST" \
	LDFLAGS="-lcrypto"
$ make fuzztest

This shows an following error:

#error "SQLCipher must be compiled with -DSQLITE_THREADSAFE=<1 or 2>"

Let's fix this by adding -DSQLITE_THREADSAFE:

$ ./configure --with-tempstore=yes --enable-fts5 CFLAGS="-DSQLITE_THREADSAFE=1 -DSQLITE_HAS_CODEC -DSQLITE_EXTRA_INIT=sqlcipher_extra_init -DSQLITE_EXTRA_SHUTDOWN=sqlcipher_extra_shutdown -DSQLCIPHER_TEST" \
	LDFLAGS="-lcrypto"
$ make fuzztest

We still have error:

#error "SQLCipher must be compiled with -DSQLITE_THREADSAFE=<1 or 2>"

This is because sessionfuzz.c has following define hardcoded in the code

#define SQLITE_THREADSAFE 0

Now let's remove this define so that the configured flag takes effect, and running the configure produces following error:

./fuzzcheck fuzzdata1.db: SQLite has memory in use before the start of testing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions