sqlcipher / android-database-sqlcipher

Android SQLite API based on SQLCipher
https://www.zetetic.net/sqlcipher/sqlcipher-for-android/
Other
2.73k stars 564 forks source link

net.sqlcipher.database.SQLiteCursor.finalize() timed out after 10 seconds #313

Closed wongk closed 7 years ago

wongk commented 7 years ago

Our cursors are all closed through normal application flow prior to finalize. We have verified this using strict mode.

A pull request has been opened to address this issue: https://github.com/sqlcipher/android-database-sqlcipher/pull/311.

Fatal Exception: java.util.concurrent.TimeoutException: net.sqlcipher.database.SQLiteCursor.finalize() timed out after 10 seconds
       at java.lang.Object.wait(Object.java)
       at java.lang.Thread.parkFor$(Thread.java:1220)
       at sun.misc.Unsafe.park(Unsafe.java:299)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:810)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:843)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1172)
       at java.util.concurrent.locks.ReentrantLock$FairSync.lock(ReentrantLock.java:196)
       at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:257)
       at net.sqlcipher.database.SQLiteDatabase.lock(SQLiteDatabase.java:505)
       at net.sqlcipher.database.SQLiteProgram.close(SQLiteProgram.java:294)
       at net.sqlcipher.database.SQLiteQuery.close(SQLiteQuery.java:136)
       at net.sqlcipher.database.SQLiteCursor.close(SQLiteCursor.java:510)
       at net.sqlcipher.database.SQLiteCursor.finalize(SQLiteCursor.java:595)
       at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:217)
       at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:200)
       at java.lang.Thread.run(Thread.java:818)
developernotes commented 7 years ago

Hello @wongk,

Thank you for this report, we have reached out in #311 with additional follow up.

g123k commented 7 years ago

With the 3.5.7 version, I have many reports of this crash. The lines are a bit different, but the consequence is exactly the same.

Fatal Exception: java.util.concurrent.TimeoutException: net.sqlcipher.database.SQLiteCursor.finalize() timed out after 10 seconds
       at java.lang.Object.wait(Object.java)
       at java.lang.Thread.parkFor(Thread.java:1205)
       at sun.misc.Unsafe.park(Unsafe.java:325)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:813)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:846)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1175)
       at java.util.concurrent.locks.ReentrantLock$FairSync.lock(ReentrantLock.java:195)
       at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:256)
       at net.sqlcipher.database.SQLiteDatabase.lock(SQLiteDatabase.java:553)
       at net.sqlcipher.database.SQLiteProgram.close(SQLiteProgram.java:321)
       at net.sqlcipher.database.SQLiteCursor.close(SQLiteCursor.java:519)
       at net.sqlcipher.database.SQLiteCursor.finalize(SQLiteCursor.java:604)
       at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:187)
       at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:170)
       at java.lang.Thread.run(Thread.java:841)
wongk commented 7 years ago

@g123k have you verified that you are closing all cursors when you are done with them? This could happen if you don't close them in a finally block.

melikeey commented 8 months ago

Still same error? Is there any new update about it? How can I reproduce I do not know.

version 4.5.3..

developernotes commented 8 months ago

@melikeey the latest release of android-database-sqlcipher was 4.5.4, however, the project has been deprecated in favor sqlcipher-android, the long-term supported replacement.