Error SQLiteConnection: open, nativeOpen on HP Slate 7 Voice Tab HSTNH-820C Android 4.4.2


#1

E/SQLiteConnection: open, nativeOpen
on tablet HP Slate 7 Voice Tab HSTNH-820C
(on 5 other devices the projects are running OK)
Android 4.4.2 (update check today 14-jan-2016)
compile ‘com.couchbase.lite:couchbase-lite-android:1.1.0’

error on line
database = manager.getDatabase(DATABASE_NAME);
is E/SQLiteConnection: open, nativeOpen

full Android Studio project is here (reproduced on couchbase own example without any modification except for import gradle project into Android Studio)
https://github.com/couchbaselabs/GrocerySync-Android/files/90069/GrocerySync-Android-master-AndroidStudio.zip
(all my projects have the same error on this device - I just reproduced here the error on a public couchbase example)

logcat is
01-14 09:11:40.157 22705-22705/com.couchbase.grocerysync D/dalvikvm: Late-enabling CheckJNI
01-14 09:11:41.889 22705-22705/com.couchbase.grocerysync D/dalvikvm: GC_FOR_ALLOC freed 207K, 9% free 2933K/3200K, paused 11ms, total 11ms
01-14 09:11:41.899 22705-22705/com.couchbase.grocerysync I/dalvikvm-heap: Grow heap (frag case) to 3.397MB for 500416-byte allocation
01-14 09:11:41.899 22705-22714/com.couchbase.grocerysync D/dalvikvm: GC_FOR_ALLOC freed 3K, 8% free 3418K/3692K, paused 9ms, total 9ms
01-14 09:11:41.989 22705-22705/com.couchbase.grocerysync D/dalvikvm: GC_FOR_ALLOC freed 120K, 7% free 3467K/3692K, paused 9ms, total 9ms
01-14 09:11:41.989 22705-22705/com.couchbase.grocerysync I/dalvikvm-heap: Grow heap (frag case) to 4.436MB for 1042864-byte allocation
01-14 09:11:41.999 22705-22714/com.couchbase.grocerysync D/dalvikvm: GC_FOR_ALLOC freed 1K, 5% free 4483K/4712K, paused 14ms, total 14ms
01-14 09:11:42.069 22705-22705/com.couchbase.grocerysync I/CBLite: Starting Manager version: 1.1.0-null
01-14 09:11:42.079 22705-22705/com.couchbase.grocerysync E/SQLiteConnection: open, nativeOpen
01-14 09:11:42.309 22705-22705/com.couchbase.grocerysync V/Database: AndroidSQLiteStorageEngine{database=41b5adb8}: Opened Android sqlite db
01-14 09:11:42.309 22705-22705/com.couchbase.grocerysync D/dalvikvm: Trying to load lib /data/app-lib/com.couchbase.grocerysync-1/libcom_couchbase_touchdb_TDCollateJSON.so 0x41988a88
01-14 09:11:42.309 22705-22705/com.couchbase.grocerysync D/dalvikvm: Added shared lib /data/app-lib/com.couchbase.grocerysync-1/libcom_couchbase_touchdb_TDCollateJSON.so 0x41988a88
01-14 09:11:42.319 22705-22705/com.couchbase.grocerysync V/TDCollateJSON: SQLite3 handle is 1599981936
01-14 09:11:42.319 22705-22705/com.couchbase.grocerysync A/libc: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 22705 (ase.grocerysync)


#2

Hi @terenul,

Thank you very much for reporting the problem.

I run the project you provided on Android 4.4.2 ARM emulator, but I could not reproduce the problem. I believe this is device specific problem. From log message you provide, it is not able to identify what module cause SIGSEGV. Is it possible to obtain backtrace from your console?

Thanks!
Hideki


#3

Hello

I Steped Into the bug until the Debugger dies, and I attached the final screenshots of the debugger (alive and after death)
share link for photos

The final breakpoint lines are
app killing lines are from top to bottom (final command is createSession)

startCBLite():121, MainActivity (com.couchbase.grocerysync)

  • Manager.java --> boolean opened = db.open();

  • –> Database.java -->
    if (database == null || !database.open(path)) {

  • –>--> AndroidSQLiteStorageEngine --> TDCollateJSON.registerCustomCollators(database);

  • –>-->–> TDCollateJSON.java
    public static void registerCustomCollators(SQLiteDatabase database) {
    nativeRegisterCustomCollators(database, Build.VERSION.SDK_INT);
    }

  • –>-->–>--> SQLiteDatabase.java
    private final ThreadLocal mThreadSession = new ThreadLocal() {
    @Override
    protected SQLiteSession initialValue() {
    return createSession();
    }
    };

Thank you
Dorin


#4

Hi @terenul,
Thank you for additional information.
It seems error occurs when registering the custom collator to SQLite. This issue might be caused by the problem that Android could load wrong architecture JNI library.

Potential fix for https://github.com/couchbase/couchbase-lite-android/issues/434 might address this issue. If you have time, could you please try 1.1.0-536 build?
https://github.com/couchbase/couchbase-lite-android/issues/434#issuecomment-130132380

Thanks!
Hideki


#5

Hello

A. Still the same error

01-17 08:16:47.935 21751-21751/com.couchbase.grocerysync E/SQLiteConnection: open, nativeOpen

01-17 08:16:47.945 21751-21751/com.couchbase.grocerysync A/libc: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 21751 (ase.grocerysync)

I changed the following lines
build.gradle main file
allprojects {
repositories {
maven { url ‘http://files.couchbase.com/maven2/’ }
jcenter()
}
}
build.gradle app file
compile group:‘com.couchbase.lite’, name:‘couchbase-lite-android’, version: ‘1.1.0-536’

the whole new project is here
GrocerySync-Android-536.zip
at link public folder for this error

01-17 08:16:46.894 21751-21751/? D/dalvikvm: Late-enabling CheckJNI
01-17 08:16:47.645 21751-21751/com.couchbase.grocerysync D/dalvikvm: GC_FOR_ALLOC freed 184K, 8% free 2932K/3180K, paused 14ms, total 14ms
01-17 08:16:47.645 21751-21751/com.couchbase.grocerysync I/dalvikvm-heap: Grow heap (frag case) to 3.401MB for 500416-byte allocation
01-17 08:16:47.655 21751-21760/com.couchbase.grocerysync D/dalvikvm: GC_FOR_ALLOC freed 3K, 7% free 3418K/3672K, paused 13ms, total 13ms
01-17 08:16:47.755 21751-21751/com.couchbase.grocerysync D/dalvikvm: GC_FOR_ALLOC freed 120K, 7% free 3467K/3692K, paused 11ms, total 11ms
01-17 08:16:47.755 21751-21751/com.couchbase.grocerysync I/dalvikvm-heap: Grow heap (frag case) to 4.440MB for 1042864-byte allocation
01-17 08:16:47.765 21751-21760/com.couchbase.grocerysync D/dalvikvm: GC_FOR_ALLOC freed 1K, 5% free 4483K/4712K, paused 12ms, total 12ms
01-17 08:16:47.925 21751-21751/com.couchbase.grocerysync I/CBLite: Starting Manager version: 1.1.0-null
01-17 08:16:47.935 21751-21751/com.couchbase.grocerysync E/SQLiteConnection: open, nativeOpen
01-17 08:16:47.945 21751-21751/com.couchbase.grocerysync V/Database: AndroidSQLiteStorageEngine{database=41ddec80}: Opened Android sqlite db
01-17 08:16:47.945 21751-21751/com.couchbase.grocerysync D/dalvikvm: Trying to load lib /data/app-lib/com.couchbase.grocerysync-1/libcom_couchbase_touchdb_TDCollateJSON_util.so 0x41c06a00
01-17 08:16:47.945 21751-21751/com.couchbase.grocerysync D/dalvikvm: Added shared lib /data/app-lib/com.couchbase.grocerysync-1/libcom_couchbase_touchdb_TDCollateJSON_util.so 0x41c06a00
01-17 08:16:47.945 21751-21751/com.couchbase.grocerysync D/dalvikvm: No JNI_OnLoad found in /data/app-lib/com.couchbase.grocerysync-1/libcom_couchbase_touchdb_TDCollateJSON_util.so 0x41c06a00, skipping init
01-17 08:16:47.945 21751-21751/com.couchbase.grocerysync D/dalvikvm: Trying to load lib /data/app-lib/com.couchbase.grocerysync-1/libcom_couchbase_touchdb_TDCollateJSON-v7a.so 0x41c06a00
01-17 08:16:47.945 21751-21751/com.couchbase.grocerysync D/dalvikvm: Added shared lib /data/app-lib/com.couchbase.grocerysync-1/libcom_couchbase_touchdb_TDCollateJSON-v7a.so 0x41c06a00
01-17 08:16:47.945 21751-21751/com.couchbase.grocerysync A/libc: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 21751 (ase.grocerysync)

B. I am also frozen at download or compilation of higher versions

with 1.2.0 downloaded from github I can not pass compilation of "gradle assembleRelease"
error message is
Execution failed for task ‘:libraries:couchbase-lite-java-forestdb:generateCBForestJniHeaders’.

Process ‘command ‘javah’’ finished with non-zero exit value 1

sources for 1.2.0 are from




Thank you

Dorin


#6

Hi @terenul,

Thank you for test result with using 1.1.0-536. And it revealed HP tablet issue is not related with https://github.com/couchbase/couchbase-lite-android/issues/434.

B. I am also frozen at download or compilation of higher versions

I assume build problem is caused by missing submodules. Please try following at root directory of project?

git submodule update --init --recursive

Or you can use release candidate build http://files.couchbase.com/maven2/com/couchbase/lite/couchbase-lite-android/1.2.0-4/

Thanks,
Hideki