Re: [sqlite] SQLIte crash in sqlite3_db_release_memory

2017-03-10 Thread Richard Hipp
On 3/10/17, Anthrathodiyil, Sabeel (S.)  wrote:
> Hi,
> I am facing a crash while invoking "sqlite3_db_release_memory" the crash is
> from pcache1RemoveFromHash.  SQLite 3.7.10 is running on ARM A5 with
> Freescale MQX as OS.
>
> Any probable reasons in term of the SQLite operations that are done wrong or
> out of order?

The usual reason for this is that some other part of your application
has corrupted the heap and SQLite has stumbled over the damage.

I also observe the SQLite 3.7.10 is over 5 years old.  There have been
67 subsequent releases.  Version 3.17.0 use less than half the CPU
cycles as 3.7.10 and is completely backwards compatible.
-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLIte crash in sqlite3_db_release_memory

2017-03-10 Thread Simon Slavin

On 10 Mar 2017, at 2:05pm, Anthrathodiyil, Sabeel (S.)  
wrote:

> Stack trace is as below
> --
> pcache1RemoveFromHash
> pcache1EnforceMaxPage
> pcache1Shrink
> sqlite3PcacheShrink
> 
> The sequence of SQLite operations being followed which lead to crash is in 
> the following order
> prepare_sql
> step_sql
> sqlite3_db_release_memory
> sqlite3_finalize
> 
> Any probable reasons in term of the SQLite operations that are done wrong or 
> out of order?

Please check to see that the parameter you’re passing to 
sqlite3_db_release_memory() is the connection, not the statement.

If that’s not the problem, then for debugging purposes can you try reversing 
the order of the last two steps ?  Finalize the statement before you release 
memory for the connection.

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users