A walIndexAppend() crash after calling "PRAGMA journal_mode"
I tracked down a occasional system crash problem of calling "PRAGMA
journal_mode" and found that walIndexRecover()->walIndexAppend() is finally
called before the crash according to my callstack.
In sqlite3.c, walIndexAppend() can be called after walIndexRecover() only
when nSize, the size of WAL-file, is bigger than WAL_HDRSIZE. But I do not
think this could happen when I call "PRAGMA journal_mode" as the DB
connection is first open at that time.
I am not familiar with the operations of upper APPs and this crash makes me
I guess there may be two threads access the same db at the same time and
both of threads find the journal_mode is DELETE and then call PRAGMA. The
crash may happen when the second PRAGMA executes as the first thread may
have written something into the db.
Is it possible? Or, in what other situation could this crash happen?