We get a strange assertion in the sqlite3 code in our app which is
multithreaded and heavily uses sqlite.
The assertion we get is from within balance_nonroot in btree.c, line
4085:
assert( cntNew[0]>0 );
We use separate database connections from each thread (actually, more
likely, even multiple connections per thread) or they are
synchronized using mutexes where a shared connection has to be used.
We get the assertions at a point where we drop a temporary view, so I
suspect the problem is not that statement, but rather some other
corruption happening before.
However, if we ignore this assertion, we can continue afterwards and
things mostly work in the same database, except for similar
exceptions from the same database connection.
I still suspect that some thread is corrupting the database's
internal management, but could not yet find a place where this would
happen.
Unfortunately, there are many things going on with our sqlite
database due to the multithreaded nature of our app, so it's not
really easy to track this down to a simpler case. If I had any idea
what kind of problem causes this assertion, this might help tracking
down the problem to a simpler problem to find out what's really going
wrong.
This happens on Windows and Mac OS X, we're using sqlite 3.2.2 (but
it also happens when using 3.2.0)
Has anybody else seen this assertion and/or knows what's causing it?
Thanks,
</jum>