- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Android: Getting 'IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: path/securidDB'
Customer has updated the RSA SecurID SDK to 2.6.0 for Android. After that, his application started crashing randomly when the 'getOtp' method is called from his code. These crashes happen sporadically from different devices such as Samsung and Huawei devices running on Android 7.x and 8.x versions. He does not have a way to reproduce these two crashes.
He was not having these two crashes running an older RSA SDK version ( He believes version 1.x ).
Caused by java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase:
/data/user/0/com.company/databases/securidDB
at
android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:55)
at
android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1234)
at
android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1110)
at
android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1278)
at com.rsa.securidlib.android.x.jj.n.h(Unknown Source)
at com.rsa.securidlib.android.x.jj.e.g(Unknown Source)
at com.rsa.securidlib.android.g.e.m(Unknown Source)
at com.rsa.securidlib.android.g.e.zz(Unknown Source)
at com.rsa.securidlib.android.g.e.m(Unknown Source)
at com.rsa.securidlib.android.AndroidSecurIDLib.m(Unknown Source)
at com.rsa.securidlib.android.AndroidSecurIDLib.getOtp(Unknown
Source)
at
com.company.authentication.f.h(RsaTokenHelper.java:72)
at
com.company.authentication.f.e(RsaTokenHelper.java:91)
at
com.company.login.a.v(BaseLoginFragment.java:549)
at com.company.login.u.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Method.java)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
Caused by java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed.
at
android.database.sqlite.SQLiteConnectionPool.throwIfClosedLocked(SQLiteConnectionPool.java:1290)
at
android.database.sqlite.SQLiteConnectionPool.waitForConnection(SQLiteConnectionPool.java:882)
at
android.database.sqlite.SQLiteConnectionPool.acquireConnection(SQLiteConnectionPool.java:575)
at
android.database.sqlite.SQLiteSession.acquireConnection(SQLiteSession.java:904)
at
android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:834)
at
android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)
at
android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:152)
at
android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:141)
at com.rsa.securidlib.android.g.t.r(Unknown Source:106)
at com.rsa.securidlib.n.g(Unknown Source:8)
at com.rsa.securidlib.n.m(Unknown Source:14)
at com.rsa.securidlib.android.AndroidSecurIDLib.m(Unknown Source:101)
at com.rsa.securidlib.android.AndroidSecurIDLib.getOtp(Unknown
Source:1)
at
com.company.authentication.f.h(RsaTokenHelper.java:72)
at
com.company.authentication.f.e(RsaTokenHelper.java:91)
at
com.company.login.a.v(BaseLoginFragment.java:549)
at com.company.login.u.run(Unknown Source:2)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:7002)
at java.lang.reflect.Method.invoke(Method.java)
at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
- Tags:
- Android
- Authentication SDK
- crash
- Mobile Authentication SDK
- Mobile SDK
- RSA SecurID
- RSA SecurID Access
- SDK
- SecurID
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
We suspect there may be a classical race condition problem here. Trying to access the getOtp method from two parallel threads from the same object will cause this issue. A possible fix is to synchronize calls to RSA SDK and making usage of RSA SDK API thread safe mechanism.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I doubt thats the case. We use a 'newSingleThreadScheduledExecutor' to get and display the otp and the time remaining. So I don't see a chance of parallel threads or am I missing something?
