realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.46k stars 1.75k forks source link

signal 7 (SIGBUS), code 2 (BUS_ADRERR) #3951

Closed SeongUgJung closed 7 years ago

SeongUgJung commented 7 years ago

my application avoid to initiate in multi process like this:

ActivityManager activityManager =
        (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
for (ActivityManager.RunningAppProcessInfo processInfo : activityManager.getRunningAppProcesses()) {
    if (Process.myPid() == processInfo.pid) {
        if (TextUtils.equals(processInfo.processName, BuildConfig.APPLICATION_ID)) {
            Realm.init(context);
            Realm.setDefaultConfiguration(realmConfiguration());
        }
        break;
    }
}
beeender commented 7 years ago

Parsed call stack:

********** Crash dump: **********
Build fingerprint: 'google/hammerhead/hammerhead:6.0.1/M4B30X/3237893:user/release-keys'
pid: 15476, tid: 15615, name: EventThread  >>> com.tosslab.jandi.app <<<
signal 7 (SIGBUS), code 2 (BUS_ADRERR), fault addr 0x94675000
Stack frame #00 pc 0001765a  /system/lib/libc.so (__memcpy_base+81)
Stack frame #01 pc 000e1517  /data/app/com.tosslab.jandi.app-2/lib/arm/librealm-jni.so: Routine realm::ArrayBlob::replace(unsigned int, unsigned int, char const*, unsigned int, bool) at ccFxpFSY.ltrans13.o:?
Stack frame #02 pc 000e14ef  /data/app/com.tosslab.jandi.app-2/lib/arm/librealm-jni.so: Routine realm::ArrayBlob::replace(unsigned int, unsigned int, char const*, unsigned int, bool) at ccFxpFSY.ltrans13.o:?
Stack frame #03 pc 000e2cab  /data/app/com.tosslab.jandi.app-2/lib/arm/librealm-jni.so: Routine realm::ArrayBigBlobs::set(unsigned int, realm::BinaryData, bool) at unwind-c.c:?
Stack frame #04 pc 000df94b  /data/app/com.tosslab.jandi.app-2/lib/arm/librealm-jni.so: Routine realm::StringColumn::set(unsigned int, realm::StringData) at unwind-c.c:?
Stack frame #05 pc 000d78b3  /data/app/com.tosslab.jandi.app-2/lib/arm/librealm-jni.so: Routine realm::Table::set_string(unsigned int, unsigned int, realm::StringData, bool) at unwind-c.c:?
Stack frame #06 pc 0005786d  /data/app/com.tosslab.jandi.app-2/lib/arm/librealm-jni.so (Java_io_realm_internal_UncheckedRow_nativeSetString+76): Routine Java_io_realm_internal_UncheckedRow_nativeSetString at ??:?
Stack frame #07 pc 024e57e5  /data/app/com.tosslab.jandi.app-2/oat/arm/base.odex (offset 0x15b3000)
beeender commented 7 years ago

@ZeroBrain

  1. Can you reproduce this issue?
  2. I can see when it crashed, the app tried to write some string into the database. How big the string is?
SeongUgJung commented 7 years ago

hm...let me do this again.

SeongUgJung commented 7 years ago

@beeender I'm not sure it's same. when I try to reproduce this issue, I've got this error.

io.realm.exceptions.RealmError: Unrecoverable error. Failure when converting short string to UTF-16 error_code = 1; retcode = 0; StringData.size = 26; StringData.data = UD Email的排程和內偁; StringData as hex =  0x55 0x44 0x20 0x45 0x6d 0x61 0x69 0x6c 0xffffffe7 0xffffff9a 0xffffff84 0xffffffe6 0xffffff8e 0xffffff92 0xffffffe7 0xffffffa8 0xffffff8b 0xffffffe5 0xffffff92 0xffffff8c 0xffffffe5 0xffffff85 0xffffffa7 0xffffffe5 0x41 0x41; in_begin = 偁AA; in_end = AA; out_curr = 0xbeab67f2; out_end = 0xbeab6838; in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_UncheckedRow.cpp line 136
    at io.realm.internal.UncheckedRow.nativeGetString(Native Method)
    at io.realm.internal.UncheckedRow.getString(UncheckedRow.java:153)
    at io.realm.TopicRealmProxy.realmGet$description(TopicRealmProxy.java:358)
    at io.realm.TopicRealmProxy.createDetachedCopy(TopicRealmProxy.java:2024)
    at io.realm.InitialInfoRealmProxy.createDetachedCopy(InitialInfoRealmProxy.java:2435)
    at io.realm.DefaultRealmModuleMediator.createDetachedCopy(DefaultRealmModuleMediator.java:702)
    at io.realm.Realm.createDetachedCopy(Realm.java:1459)
    at io.realm.Realm.copyFromRealm(Realm.java:1201)
    at io.realm.Realm.copyFromRealm(Realm.java:1174)
    at com.tosslab.jandi.app.local.orm.repositories.info.InitialInfoRepository.lambda$getInitialInfo$2(InitialInfoRepository.java:34)
    at com.tosslab.jandi.app.local.orm.repositories.info.InitialInfoRepository$$Lambda$2.execute(Unknown Source)
    at com.tosslab.jandi.app.local.orm.repositories.realm.RealmRepository.execute(RealmRepository.java:28)
...

is this relate to CJK charset? My service is targeting to CJK.

beeender commented 7 years ago

They could be the same issue! Is it possible to share your project with us and let us know the steps to reproduce it? It might be an issue that we tried to reproduce for a really long time.

If you can share it, you can send it to help@realm.io . Otherwise can you please share your email address? We can try to contact you to figure out a way to solve it.

Thanks!

beeender commented 7 years ago

cc @dalinaum

SeongUgJung commented 7 years ago

@beeender you mean you need my project's source code? If that, I'm sorry not to share it. but I could contact to @dalinaum . I will contact to him on off-line. Through him, I could share it.

SeongUgJung commented 7 years ago

I've got contact with @dalinaum . I will check it on snapshot-version.

SeongUgJung commented 7 years ago

@beeender @dalinaum on 2.3.0-SNAPSHOT, I tried to reproduce it. but I didn't occur anymore. I think it would be fixed on next version. :)

beeender commented 7 years ago

OK! We will make a release soon. I am closing this issue now, feel free to reopen it if the issue still exist.

SeongUgJung commented 7 years ago

@beeender could you tell me when this patch would be released? my many customers suffer from this.