Skip to content
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

Crash In Android 4.2.1&Android 4.2.2 With Realm 3.0 #4334

Closed
shisu250 opened this issue Mar 16, 2017 · 14 comments
Closed

Crash In Android 4.2.1&Android 4.2.2 With Realm 3.0 #4334

shisu250 opened this issue Mar 16, 2017 · 14 comments

Comments

@shisu250
Copy link

shisu250 commented Mar 16, 2017

please help me.
I use realm 3.0.
and collect crash in android 4.2.1& android 4.2.2 (level 17) . It looks like only crash in level 17.

This is crash log:

main(1)
SIGSEGV(SEGV_ACCERR)
#00 pc 00018b6c /system/lib/libc.so (memcpy+1324) [armeabi-v7a]
java:
io.realm.internal.SharedRealm.long nativeGetTable(long,java.lang.String)(Native Method)
io.realm.internal.SharedRealm.io.realm.internal.Table getTable(java.lang.String)(ProGuard:271)
io.realm.MasteryRealmBeanRealmProxy.io.realm.internal.Table initTable(io.realm.internal.SharedRealm)(ProGuard:149)
io.realm.PersonSchemaMediator.io.realm.internal.Table createTable(java.lang.Class,io.realm.internal.SharedRealm)(ProGuard:58)
io.realm.Realm.void initializeRealm(io.realm.Realm)(ProGuard:347)
io.realm.Realm.io.realm.Realm createAndValidate(io.realm.RealmConfiguration,io.realm.internal.ColumnIndices[])(ProGuard:314)
io.realm.Realm.io.realm.Realm createInstance(io.realm.RealmConfiguration,io.realm.internal.ColumnIndices[])(ProGuard:265)
io.realm.RealmCache.io.realm.BaseRealm createRealmOrGetFromCache(io.realm.RealmConfiguration,java.lang.Class)(ProGuard:143)
io.realm.Realm.io.realm.Realm getInstance(io.realm.RealmConfiguration)(ProGuard:228)
com.shensz.student.service.storage.StorageService.io.realm.Realm getPersonRealm()(ProGuard:120)

This is my code:

private static final String REALM_NAME_PREFIX = "person.";
private static final String REALM = ".realm";
private RealmConfiguration getPersonRealmConfiguration(String uid) {
Check.notNull(uid);
Check.notEmpty(uid);
String realmName;
if (TextUtils.isEmpty(uid)) {
realmName = REALM_NAME_PREFIX + "unknown" + REALM;
} else {
realmName = REALM_NAME_PREFIX + uid + REALM;
}
return new RealmConfiguration.Builder()
.name(realmName)
.deleteRealmIfMigrationNeeded()
.modules(new PersonSchema())
.schemaVersion(USER_REALM_VERSION)
.build();
}

@Zhuinden
Copy link
Contributor

Zhuinden commented Mar 16, 2017

What device is this on? My guess goes that this is the same as #3651 ....

Which isn't good, although at least it's visible that the error is in memcpy.

@kneth ?

@shisu250
Copy link
Author

shisu250 commented Mar 16, 2017

@Zhuinden device is Samsung GT-I9118 and Samsung GT-I8558 and Samsung SM-G3812.
another crash log is:
unknown(23480)
SIGSEGV(SEGV_ACCERR)
#00 pc 00018b7c /system/lib/libc.so (memcpy+1340) [armeabi-v7a]

another Native crash:
#00 pc 000dbd9e /mnt/asec/com.shensz.student-2/lib/librealm-jni.so [armeabi-v7a]
#1 pc 000e88cb /mnt/asec/com.shensz.student-2/lib/librealm-jni.so [armeabi-v7a]
#2 pc 000e89a7 /mnt/asec/com.shensz.student-2/lib/librealm-jni.so [armeabi-v7a]
#3 pc 000e8a05 /mnt/asec/com.shensz.student-2/lib/librealm-jni.so [armeabi-v7a]
#4 pc 0002d311 /mnt/asec/com.shensz.student-2/lib/librealm-jni.so (Java_io_realm_internal_SharedRealm_nativeGetTable+172) [armeabi-v7a]
#5 pc 0001e290 /system/lib/libdvm.so (dvmPlatformInvoke+112) [armeabi-v7a]
#6 pc 0004d419 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+396) [armeabi-v7a]
#7 pc 0004f57b /system/lib/libdvm.so (dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*)+174) [armeabi-v7a]
#8 pc 000276a0 /system/lib/libdvm.so [armeabi-v7a]
#9 pc 0002b57c /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184) [armeabi-v7a]
#10 pc 0005ff1b /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+374) [armeabi-v7a]
#11 pc 0006780d /system/lib/libdvm.so [armeabi-v7a]
#12 pc 000276a0 /system/lib/libdvm.so [armeabi-v7a]
#13 pc 0002b57c /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184) [armeabi-v7a]
#14 pc 0005fc45 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272) [armeabi-v7a]
#15 pc 00049a03 /system/lib/libdvm.so [armeabi-v7a]
#16 pc 00046dd9 /system/lib/libandroid_runtime.so [armeabi-v7a]
#17 pc 00047a9b /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, char const*)+390) [armeabi-v7a]
#18 pc 00001041 /system/bin/app_process [armeabi-v7a]
#19 pc 0001275f /system/lib/libc.so (__libc_init+38) [armeabi-v7a]
#20 pc 00000cbc /system/bin/app_process [armeabi-v7a]

@Zhuinden
Copy link
Contributor

@shisu250 if you have one of these devices at hand, you can try adding RealmLog.setLevel(LogLevel.ALL) and obtain more information on the crash itself

@shisu250
Copy link
Author

@Zhuinden Sorry,I have no devices. I collect crash log from user through the website. Can I use the old version.such as 1.2.0 .

@Zhuinden
Copy link
Contributor

@shisu250 Realm 1.2.0 cannot open files created by Realm 2.x+, but technically Realm 1.2.0 did not have this problem yet.

@shisu250
Copy link
Author

shisu250 commented Mar 17, 2017

@Zhuinden Have some way to clear before files(2.x created) ? when I use 1.2.0 realm app cover installation 3.0.0 realm.

@kneth
Copy link
Contributor

kneth commented Mar 17, 2017

It looks a bit like #3651. And it indicates an issue with memcpy - a hypothesis I haven't been able to verify 100 % yet.

@shisu250 I don't have access to any of the devices, you mention. But I have at least one other device (SM-T111) where I have seen similar crashes. If possible, please send an APK to help@realm.io so I can see if I can reproduce it on my test device.

@shisu250
Copy link
Author

@kneth I am have send apk to help@realm.io , Thank you for your help.

@kneth
Copy link
Contributor

kneth commented Mar 17, 2017

@shisu250 The app didn't crash on my test device. But as @Zhuinden pointed out, your crash is likely the same as we have seen in #3651. I close this issue and ask you to follow than instead.

@shisu250
Copy link
Author

shisu250 commented Mar 17, 2017

@kneth ok,thx. I use the old version.such as 1.2.0 . To avoid this problem for the time being.

@Zhuinden
Copy link
Contributor

@shisu250 good news is that thanks to your stack trace, Realm has finally been able to identify the root cause of the error: memmove() native method is broken on old Samsung devices.

While the fix in #4402 is being worked on (not yet merged), soon this error will be fixed! 😄

@shisu250
Copy link
Author

shisu250 commented Apr 7, 2017

@Zhuinden thx very much,I will update my app's realm on later version. thanks again.

@kneth
Copy link
Contributor

kneth commented Apr 7, 2017

@shisu250 version 3.1.1 is out with a fix - enjoy!

@shisu250
Copy link
Author

shisu250 commented Apr 8, 2017

@kneth 😁

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants