-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/23/2015 03:31 AM, Jeff M wrote:
> sqlite3_step();   // occasionally crashes here (showing
> ESC_BAD_ACCESS on main thread)

That has three very likely causes.  The first is that your internal
state gets messed up, and the statement has actually been
finalized/freed.  ie it is junk memory.  You can add assertions that
check it is still a known statement pointer by checking this returns it:

  http://sqlite.org/c3ref/next_stmt.html

The second is that the memory where you stored the statement pointer
is what is trashed.

The final cause is that some other code has memory bugs, causing
damage to SQLite's data structures.

> It's not a zombie object issue (tested with NSZombieEnabled).

Sadly that only checks Objective C objects, and not all memory.

> Any ideas on how to debug this?

I used valgrind running the app in the simulator.  (I also configure
valgrind to never actually reuse memory.)

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlXaXpEACgkQmOOfHg372QRKZACfWyT6pEyNQ9sEKPbhFQ4pI/5G
Nh0AniO5ESx9CIbB484/gYqjtfCsGUrM
=Op+8
-----END PGP SIGNATURE-----

Reply via email to