SQLIte crash in sqlite3_db_release_memory

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SQLIte crash in sqlite3_db_release_memory

Anthrathodiyil, Sabeel (S.)
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.

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?

Thanks,
Sabeel



_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLIte crash in sqlite3_db_release_memory

Simon Slavin-3

On 10 Mar 2017, at 2:05pm, Anthrathodiyil, Sabeel (S.) <[hidden email]> 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
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLIte crash in sqlite3_db_release_memory

Richard Hipp-3
In reply to this post by Anthrathodiyil, Sabeel (S.)
On 3/10/17, Anthrathodiyil, Sabeel (S.) <[hidden email]> 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
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users