-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Native Crash on RealmObject Update #5808
Comments
Went through and incrementally updated Realm and it looks like everything works up until version 4.1.1 |
Does this still happen if you remove the change listener in |
Yes the removal of change listeners is in the onDestroy callback and it is still happening. I was moving around the change listener code and oddly enough what I have found is that if I add the change listener in the onCreate it will crash but if it is added in the onStart method it will not. This does not make much sense to me. |
I doubt it is related to your model class. Can you try to increase the log level and report the result: |
One observation though: |
Sorry for the incomplete code, I was trying not to make my code example so unwieldy. public class SportRealmConfiguration {
private static final String realmName = "sport.realm";
public static Realm getSportRealmInstance() {
return Realm.getInstance(getInstance());
}
public static synchronized RealmConfiguration getInstance() {
if (config == null) {
config = new RealmConfiguration.Builder()
.name(realmName).modules(new MainModule())
.schemaVersion(8)
.migration(new BaseMigration()).build();
}
return config;
}
} And as for the leaking for realm versions, I left out the important part when trimming out the other service error handling logic. Every instance that I am acquiring a reference to a realm on a none UI thread I am wrapping in a try finally block. for the UI thread this is handled via the lifecycle destroy methods. Realm realm = null;
try {
realm = SportRealmConfiguration.getSportRealmInstance();
} finally {
if (realm != null) {
realm.close();
}
} Attached debugging logs. |
Does the previous attached log file have the needed information? |
Goal
Update a saved object with a new version from service
Expected Results
Update the current object
Actual Results
03-06 18:59:29.626 10104-10104/com.armssoftware.android A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 10104 (oftware.android)
03-06 18:59:29.784 10416-10416/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-06 18:59:29.784 10416-10416/? A/DEBUG: Build fingerprint: 'google/sdk_gphone_x86/generic_x86:8.0.0/OSR1.170901.056/4497355:userdebug/dev-keys'
03-06 18:59:29.784 10416-10416/? A/DEBUG: Revision: '0'
03-06 18:59:29.784 10416-10416/? A/DEBUG: ABI: 'x86'
03-06 18:59:29.784 10416-10416/? A/DEBUG: pid: 10104, tid: 10104, name: oftware.android >>> com.armssoftware.android <<<
03-06 18:59:29.784 10416-10416/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
03-06 18:59:29.784 10416-10416/? A/DEBUG: Cause: null pointer dereference
03-06 18:59:29.784 10416-10416/? A/DEBUG: eax 00000000 ebx 922f5de4 ecx bfcef948 edx 00000001
03-06 18:59:29.785 10416-10416/? A/DEBUG: esi 00000000 edi 00000000
03-06 18:59:29.785 10416-10416/? A/DEBUG: xcs 00000073 xds 0000007b xes 0000007b xfs 0000003b xss 0000007b
03-06 18:59:29.785 10416-10416/? A/DEBUG: eip 920a4c19 ebp 912b8c0c esp bfcef900 flags 00010297
03-06 18:59:30.027 10416-10416/? A/DEBUG: backtrace:
03-06 18:59:30.027 10416-10416/? A/DEBUG: #00 pc 000e4c19 /data/app/com.armssoftware.android-eOMGXnD93VYA658DwCiaqg==/lib/x86/librealm-jni.so
03-06 18:59:30.027 10416-10416/? A/DEBUG: #1 pc 000e4eb7 /data/app/com.armssoftware.android-eOMGXnD93VYA658DwCiaqg==/lib/x86/librealm-jni.so
03-06 18:59:30.027 10416-10416/? A/DEBUG: #2 pc 001114a7 /data/app/com.armssoftware.android-eOMGXnD93VYA658DwCiaqg==/lib/x86/librealm-jni.so
03-06 18:59:30.027 10416-10416/? A/DEBUG: #3 pc 00111a47 /data/app/com.armssoftware.android-eOMGXnD93VYA658DwCiaqg==/lib/x86/librealm-jni.so
03-06 18:59:30.027 10416-10416/? A/DEBUG: #4 pc 000f69d8 /data/app/com.armssoftware.android-eOMGXnD93VYA658DwCiaqg==/lib/x86/librealm-jni.so
03-06 18:59:30.027 10416-10416/? A/DEBUG: #5 pc 000d6658 /data/app/com.armssoftware.android-eOMGXnD93VYA658DwCiaqg==/lib/x86/librealm-jni.so
03-06 18:59:30.027 10416-10416/? A/DEBUG: #6 pc 00112d49 /data/app/com.armssoftware.android-eOMGXnD93VYA658DwCiaqg==/lib/x86/librealm-jni.so
03-06 18:59:30.027 10416-10416/? A/DEBUG: #7 pc 00112fd6 /data/app/com.armssoftware.android-eOMGXnD93VYA658DwCiaqg==/lib/x86/librealm-jni.so
03-06 18:59:30.027 10416-10416/? A/DEBUG: #8 pc 00014a37 /system/lib/libutils.so (_ZN7android20SimpleLooperCallback11handleEventEiiPv+39)
03-06 18:59:30.027 10416-10416/? A/DEBUG: #9 pc 0001586c /system/lib/libutils.so (_ZN7android6Looper9pollInnerEi+988)
03-06 18:59:30.027 10416-10416/? A/DEBUG: #10 pc 00015406 /system/lib/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+118)
03-06 18:59:30.027 10416-10416/? A/DEBUG: #11 pc 000e4cbb /system/lib/libandroid_runtime.so (_ZN7androidL38android_os_MessageQueue_nativePollOnceEP7_JNIEnvP8_jobjectxi+59)
03-06 18:59:30.027 10416-10416/? A/DEBUG: #12 pc 007b4198 /system/framework/x86/boot-framework.oat (offset 0x5e6000) (android.app.NativeActivity.onWindowFocusChangedNative [DEDUPED]+136)
03-06 18:59:30.027 10416-10416/? A/DEBUG: #13 pc 000756a0 /dev/ashmem/dalvik-jit-code-cache (deleted)
03-06 18:59:30.027 10416-10416/? A/DEBUG: #14 pc 4a292753
03-06 18:59:30.027 10416-10416/? A/DEBUG: #15 pc 0d3fffff /dev/ashmem/dalvik-main space (region space) (deleted)
03-06 18:59:30.027 10416-10416/? A/DEBUG: #16 pc 00d25f9a /system/framework/x86/boot-framework.vdex
Steps & Code to Reproduce
Currently in process of upgrading from version 3.3.2 to 4.3.4
This pattern is in place for many other models and all seem to work without issue so my assumption is that there is something wrong with the model.
Insert the model with some of the properties missing, summary level, then come back and get the full detail of the model and try to update.
Cleared the database and started from scratch.
Modified model to remove list and index.
Tried beginning and then committing a transaction on the realm instance as am currently executing a Realm.Transaction synchronously.
Code Sample
Version of Realm and tooling
Realm version(s): 4.3.4
Realm sync feature enabled: no
Android Studio version: 3.0.1
Which Android version and device: on a few different devices, currently troubleshooting on API 26 emulator
The text was updated successfully, but these errors were encountered: