Skip to content

IllegalStateException: UNKNOWN type 5 running query on Android 3.1 #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sfell opened this issue Sep 23, 2011 · 7 comments
Closed

IllegalStateException: UNKNOWN type 5 running query on Android 3.1 #16

sfell opened this issue Sep 23, 2011 · 7 comments

Comments

@sfell
Copy link

sfell commented Sep 23, 2011

I'm using the beta release, my app runs fine on Android 2.2 & 2.3, but on 3.1 (on a galaxy tab) i see this "IllegalStateException: UNKNOWN type 5" error running a query.

E/AndroidRuntime( 1311): FATAL EXCEPTION: AsyncTask #1
E/AndroidRuntime( 1311): java.lang.RuntimeException: An error occured while executing doInBackground()
E/AndroidRuntime( 1311): at android.os.AsyncTask$3.done(AsyncTask.java:266)
E/AndroidRuntime( 1311): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
E/AndroidRuntime( 1311): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
E/AndroidRuntime( 1311): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
E/AndroidRuntime( 1311): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
E/AndroidRuntime( 1311): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
E/AndroidRuntime( 1311): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
E/AndroidRuntime( 1311): at java.lang.Thread.run(Thread.java:1020)
E/AndroidRuntime( 1311): Caused by: java.lang.IllegalStateException: UNKNOWN type 5
E/AndroidRuntime( 1311): at android.database.CursorWindow.getString_native(Native Method)
E/AndroidRuntime( 1311): at android.database.CursorWindow.getString(CursorWindow.java:372)
E/AndroidRuntime( 1311): at info.guardianproject.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:52)
E/AndroidRuntime( 1311): at com.salesforce.crm.db.CursorHelper.getString(CursorHelper.java:40)
E/AndroidRuntime( 1311): at com.salesforce.crm.datastore.SCTab.(SCTab.java:23)
E/AndroidRuntime( 1311): at com.salesforce.crm.datastore.SCFactory.getAllTabs(SCFactory.java:90)
E/AndroidRuntime( 1311): at com.salesforce.crm.HomeScreenMenuFragment$TabLoader.loadInBackground(HomeScreenMenuFragment.java:103)
E/AndroidRuntime( 1311): at com.salesforce.crm.HomeScreenMenuFragment$TabLoader.loadInBackground(HomeScreenMenuFragment.java:88)
E/AndroidRuntime( 1311): at android.support.v4.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:243)
E/AndroidRuntime( 1311): at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:52)
E/AndroidRuntime( 1311): at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:41)
E/AndroidRuntime( 1311): at android.os.AsyncTask$2.call(AsyncTask.java:252)
E/AndroidRuntime( 1311): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
E/AndroidRuntime( 1311): ... 4 more

@n8fr8
Copy link
Collaborator

n8fr8 commented Sep 23, 2011

We are currently debugging some issue on Samsung devices. Thank for providing more data to test.

Can you install the NoteCipher app from the Android Market, and let me know if that works for you?

@sfell
Copy link
Author

sfell commented Sep 23, 2011

NoteCipher seems to work fine, I'll see if i can get a simple repo case for you.

@superfell
Copy link
Contributor

Here's a reproducible test case, works fine on 2.2, crashes with the stack trace below on a 3.1 Galaxy Tab

    File dbFile = this.getDatabasePath("query.db");
    dbFile.mkdirs();
    dbFile.delete();

    SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(dbFile, "hello", null);
    db.execSQL("create table if not exists myTable ( _id integer, name text)");
    db.execSQL("insert into myTable values (?,?)", new Object [] { 3, null });
    Cursor c = db.rawQuery("select name from myTable", null);
    try {
        while (c.moveToNext()) {
            Log.i("Db", "name:" + c.getString(0));
        }
    } finally {
        c.close();
    }

E/AndroidRuntime(11755): Caused by: java.lang.IllegalStateException: UNKNOWN type 5
E/AndroidRuntime(11755): at android.database.CursorWindow.getString_native(Native Method)
E/AndroidRuntime(11755): at android.database.CursorWindow.getString(CursorWindow.java:372)
E/AndroidRuntime(11755): at info.guardianproject.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:52)
E/AndroidRuntime(11755): at com.superfell.SqlCipher31TestActivity.queryDb(SqlCipher31TestActivity.java:32)
E/AndroidRuntime(11755): ... 14 more

@n8fr8
Copy link
Collaborator

n8fr8 commented Sep 26, 2011

Perfect thanks.

Simon Fell [email protected] wrote:

Here's a reproducible test case, works fine on 2.2, crashes with the stack trace below on a 3.1 Galaxy Tab

File dbFile = this.getDatabasePath("query.db");
dbFile.mkdirs();
dbFile.delete();

SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(dbFile, "hello", null);
db.execSQL("create table if not exists myTable ( _id integer, name text)");
db.execSQL("insert into myTable values (?,?)", new Object [] { 3, null });
Cursor c = db.rawQuery("select name from myTable", null);
try {
    while (c.moveToNext()) {
        Log.i("Db", "name:" + c.getString(0));
    }
} finally {
    c.close();
}

E/AndroidRuntime(11755): Caused by: java.lang.IllegalStateException: UNKNOWN type 5
E/AndroidRuntime(11755): at android.database.CursorWindow.getString_native(Native Method)
E/AndroidRuntime(11755): at android.database.CursorWindow.getString(CursorWindow.java:372)
E/AndroidRuntime(11755): at info.guardianproject.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:52)
E/AndroidRuntime(11755): at com.superfell.SqlCipher31TestActivity.queryDb(SqlCipher31TestActivity.java:32)
E/AndroidRuntime(11755): ... 14 more

Reply to this email directly or view it on GitHub:
https://github.com/guardianproject/android-database-sqlcipher/issues/16#issuecomment-2201794

@n8fr8
Copy link
Collaborator

n8fr8 commented Oct 31, 2011

@superfell
Copy link
Contributor

Yes, the new build fixes this, thanks!

@songliao-branch
Copy link

@n8fr8 how did the new DP3 fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants