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

Realm corrupted the database (Fatal signal 11 (SIGSEGV), code 1, fault addr 0x28 in tid 6777) #3843

Closed
timmygap opened this issue Nov 25, 2016 · 10 comments

Comments

@timmygap
Copy link

timmygap commented Nov 25, 2016

Hi,

I had the same error like here posted, but this issue ticket was closed. So I opened a new one.
Bug:
#3765

Information:
I use realm version 2.1.1, updating to 2.2.0 don´t solve the problem.

The realm database is corrupted after a crash. After restart the app:
Realm.init(context) (works)
RealmConfiguration.Builder().schemaVersion(10).migration(DatabaseMigration(context)).build() (works)
Realm.setDefaultConfiguration(configuration) (works)
Realm.getDefaultInstance() (crashed)
It looks like if I read or write on realm the app crashed.

Work around:
Currently we have solved the problem by downgrade the realm version to v2.0.2
More Information that we got:
We use a sync adapter and if we got much data the realm crashed while we update data after syncing it.
But in v2.0.2 we can´t repro it at the moment.

Log:
11-24 13:16:20.240 22850-22850/com.packagename.debug A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x4 in tid 22850 (.packagename.debug)
[ 11-24 13:16:20.240 163: 163 W/ ]
debuggerd: handling request: pid=22850 uid=10078 gid=10078 tid=22850
11-24 13:16:20.313 22888-22888/? A/DEBUG:


11-24 13:16:20.313 22888-22888/? A/DEBUG: Build fingerprint: 'google/marlin/marlin:7.1/NDE63P/3332229:user/release-keys'
11-24 13:16:20.313 22888-22888/? A/DEBUG: Revision: '0'
11-24 13:16:20.313 22888-22888/? A/DEBUG: ABI: 'arm'
11-24 13:16:20.314 22888-22888/? A/DEBUG: pid: 22850, tid: 22850, name: .packagename.debug >>> com.packagename.debug <<<
11-24 13:16:20.314 22888-22888/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
11-24 13:16:20.314 22888-22888/? A/DEBUG: r0 9ea57008 r1 ffffed22 r2 9ea57a34 r3 00000000
11-24 13:16:20.314 22888-22888/? A/DEBUG: r4 9ea57008 r5 ffffed22 r6 00000000 r7 000000cf
11-24 13:16:20.314 22888-22888/? A/DEBUG: r8 00000020 r9 00000000 sl 00240000 fp a29b4ab0
11-24 13:16:20.314 22888-22888/? A/DEBUG: ip 00000002 sp bef6e670 lr a2882a37 pc a2892540 cpsr 60070030
11-24 13:16:20.322 22888-22888/? A/DEBUG: backtrace:
11-24 13:16:20.322 22888-22888/? A/DEBUG: #00 pc 00097540 /data/app/com.packagename.debug-1/lib/arm/librealm-jni.so
11-24 13:16:20.323 22888-22888/? A/DEBUG: #1 pc 00087a35 /data/app/com.packagename.debug-1/lib/arm/librealm-jni.so
11-24 13:16:20.323 22888-22888/? A/DEBUG: #2 pc 00087aa7 /data/app/com.packagename.debug-1/lib/arm/librealm-jni.so
11-24 13:16:20.323 22888-22888/? A/DEBUG: #3 pc 000daad9 /data/app/com.packagename.debug-1/lib/arm/librealm-jni.so
11-24 13:16:20.323 22888-22888/? A/DEBUG: #4 pc 000a7f4b /data/app/com.packagename.debug-1/lib/arm/librealm-jni.so
11-24 13:16:20.323 22888-22888/? A/DEBUG: #5 pc 000da48d /data/app/com.packagename.debug-1/lib/arm/librealm-jni.so
11-24 13:16:20.323 22888-22888/? A/DEBUG: #6 pc 000a7f4b /data/app/com.packagename.debug-1/lib/arm/librealm-jni.so
11-24 13:16:20.323 22888-22888/? A/DEBUG: #7 pc 0005bb9b /data/app/com.packagename.debug-1/lib/arm/librealm-jni.so
11-24 13:16:20.323 22888-22888/? A/DEBUG: #8 pc 00061641 /data/app/com.packagename.debug-1/lib/arm/librealm-jni.so
11-24 13:16:20.323 22888-22888/? A/DEBUG: #9 pc 0006a445 /data/app/com.packagename.debug-1/lib/arm/librealm-jni.so
11-24 13:16:20.323 22888-22888/? A/DEBUG: #10 pc 0006d9fb /data/app/com.packagename.debug-1/lib/arm/librealm-jni.so
11-24 13:16:20.323 22888-22888/? A/DEBUG: #11 pc 00068eb3 /data/app/com.packagename.debug-1/lib/arm/librealm-jni.so
11-24 13:16:20.323 22888-22888/? A/DEBUG: #12 pc 00024e95 /data/app/com.packagename.debug-1/lib/arm/librealm-jni.so (Java_io_realm_internal_SharedRealm_nativeGetSharedRealm+224)
11-24 13:16:20.323 22888-22888/? A/DEBUG: #13 pc 00af4819 /data/app/com.packagename.debug-1/oat/arm/base.odex (offset 0xa30000)

@beeender
Copy link
Contributor

@tkrawetzke Is it something can be reproduced in your side?
Is it possible for you to make a apk with the problematic version of Realm and share with us? to help@realm.io . Also, please let us know the steps to reproduce it. Thanks a lot!!!

@timmygap
Copy link
Author

@beeender Sorry, but we can´t share our apk with you. Can you try to reproduce it by yourself?

@beeender
Copy link
Contributor

We can, but then we need to guess all the preconditions which might take infinite time ... Is that possible that we sign a NDA with you and get the apk to reproduce the problem?

@rodriguesmarcelo
Copy link

Hi,

I had the same problem, but if i downgrade version of realm dont solve my problem.

Realm.getDefaultInstance() (crashed)

Information:
Its a new app, i'm not migrating it.
Realm version 2.2.1.
Device android version 4.2.2.
Device model SMT111M (Samsung Galaxy tab 3).

Console Information:
D/WritingBuddyImpl: getCurrentWritingBuddyView()
D/ProgressBar: updateDrawableBounds: left = 0
D/ProgressBar: updateDrawableBounds: top = 0
D/ProgressBar: updateDrawableBounds: right = 76
D/ProgressBar: updateDrawableBounds: bottom = 76
D/dalvikvm: threadid=12: still suspended after undo (sc=1 dc=1)
D/dalvikvm: threadid=12: still suspended after undo (sc=1 dc=1)
D/dalvikvm: GC_CONCURRENT freed 263K, 18% free 5910K/7204K, paused 4ms+5ms, total 39ms
A/libc: Fatal signal 11 (SIGSEGV) at 0x62f70ff6 (code=2), thread 6403 (AsyncTask #1)
Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'

Debug mode:
http://imageshack.com/a/img923/8130/5R0l9N.png

@albetoetecnia
Copy link

albetoetecnia commented Jan 26, 2017

Same problem, I've updated to latest version 2.3.0 but not solve.

crash here (realmNotifier is null):

public static SharedRealm getInstance(RealmConfiguration config, RealmNotifier realmNotifier,
                                          SchemaVersionListener schemaVersionListener, boolean autoChangeNotifications) {
        String[] userAndServer = ObjectServerFacade.getSyncFacadeIfPossible().getUserAndServerUrl(config);
        String rosServerUrl = userAndServer[0];
        String rosUserToken = userAndServer[1];
        boolean enable_caching = false; // Handled in Java currently
        boolean disableFormatUpgrade = false; // TODO Double negatives :/
        long nativeConfigPtr = nativeCreateConfig(
                config.getPath(),
                config.getEncryptionKey(),
                rosServerUrl != null ? SchemaMode.SCHEMA_MODE_ADDITIVE.getNativeValue() : SchemaMode.SCHEMA_MODE_MANUAL.getNativeValue(),
                config.getDurability() == Durability.MEM_ONLY,
                enable_caching,
                config.getSchemaVersion(),
                disableFormatUpgrade,
                autoChangeNotifications,
                rosServerUrl,
                rosUserToken);
        try {
            **return new SharedRealm(
                    nativeGetSharedRealm(nativeConfigPtr, realmNotifier),**
                    config,
                    realmNotifier,
                    schemaVersionListener);
        } finally {
            nativeCloseConfig(nativeConfigPtr);
        }
    }

@Konsumierer
Copy link

Konsumierer commented Jan 26, 2017

Same problem with a Samsung Galaxy S3 mini I8200N with Android 4.2.2.
Cannot be reproduced for another Galaxy S3 mini I8190 with Android 4.1.2 however.

Realm.io version: 2.1.1 and 2.3.0 tested

Crash seems to be provoked by a call to Realm.getInstance( io.realm.RealmConfiguration configuration ).
App data was cleared before start, i.e. no database exists.

01-26 11:14:03.359 30415-30415/com.package W/dalvikvm: VFY: unable to find class referenced in signature (Lrx/Observable;)
01-26 11:14:03.367 30415-30415/com.package A/libc: Fatal signal 11 (SIGSEGV) at 0x5f8c8fe0 (code=2), thread 30415 (i.android.local)
01-26 11:14:03.421 29557-29557/? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-26 11:14:03.421 29557-29557/? I/DEBUG: Build fingerprint: 'samsung/goldenve3gxx/goldenve3g:4.2.2/JDQ39/I8200NXXUAOC1:user/release-keys'
01-26 11:14:03.421 29557-29557/? I/DEBUG: Revision: '3'
01-26 11:14:03.421 29557-29557/? I/DEBUG: pid: 30415, tid: 30415, name: i.android.local  >>> com.package <<<
01-26 11:14:03.421 29557-29557/? I/DEBUG: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 5f8c8fe0
01-26 11:14:03.515 29557-29557/? I/DEBUG:     r0 5f9cafc7  r1 5f8c8fe0  r2 5f9ce127  r3 5f8c8fe0
01-26 11:14:03.515 29557-29557/? I/DEBUG:     r4 00000000  r5 5f8c9000  r6 5f9d1298  r7 5f9caf80
01-26 11:14:03.515 29557-29557/? I/DEBUG:     r8 00000020  r9 00000020  sl 5eda5500  fp 00000020
01-26 11:14:03.515 29557-29557/? I/DEBUG:     ip 00000010  sp bee03358  lr 00000000  pc 5f785fd8  cpsr 20000030
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d0  0000000000000000  d1  532f6c616e726500
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d2  4b2f726573656400  d3  6972657365447900
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d4  42c1aa3842c1a9a8  d5  42c1ab4842c1aac0
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d6  42c1ac6042c1abd8  d7  42c1ad8842c1acf0
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d8  0000000000000000  d9  0000000000000000
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d10 0000000000000000  d11 0000000000000000
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d12 0000000000000000  d13 0000000000000000
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d14 0000000000000000  d15 0000000000000000
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d16 0000000000000000  d17 0000000000000000
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d18 0000000000000000  d19 0000000000000000
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d20 4008000000000000  d21 3fbc71c71c71c71c
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d22 3fcc7288e957b53b  d23 3fd24998d6307188
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d24 3fd99a27ad32ddf5  d25 3fe555b0aaeac752
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d26 0000000000000000  d27 0000000000000007
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d28 000000000000000c  d29 0000000000000000
01-26 11:14:03.515 29557-29557/? I/DEBUG:     d30 0000000000000000  d31 0000000000000000
01-26 11:14:03.515 29557-29557/? I/DEBUG:     scr 20000010
01-26 11:14:03.515 29557-29557/? I/DEBUG: backtrace:
01-26 11:14:03.515 29557-29557/? I/DEBUG:     #00  pc 0008dfd8  /data/app-lib/com.package-1/librealm-jni.so
01-26 11:14:03.515 29557-29557/? I/DEBUG:     #01  pc 000afb3b  /data/app-lib/com.package-1/librealm-jni.so
01-26 11:14:03.515 29557-29557/? I/DEBUG:     #02  pc 00027b2d  /data/app-lib/com.package-1/librealm-jni.so (Java_io_realm_internal_SharedRealm_nativeGetTable+172)

@Zhuinden
Copy link
Contributor

@Konsumierer if you set RealmLog.setLevel(ALL) does it show anything more?

@Konsumierer
Copy link

Konsumierer commented Feb 1, 2017

@Zhuinden, sure:

This is the log with Realm 2.1.1 and LogLevel.ALL.

02-01 11:13:25.851 29765-29765/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeCreateConfig
02-01 11:13:25.851 29765-29765/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeGetSharedRealm 1592424472
02-01 11:13:36.937 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeCreateConfig
02-01 11:13:36.937 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeGetSharedRealm 1603694752
02-01 11:13:36.937 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeCloseConfig 1603694752
02-01 11:13:36.945 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeHasTable 1603697192
02-01 11:13:36.945 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeCloseSharedRealm 1603697192
02-01 11:13:36.953 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeCreateConfig
02-01 11:13:36.953 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeGetSharedRealm 1603673168
02-01 11:13:36.953 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeGetVersion 1603703488
02-01 11:13:36.953 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeCloseConfig 1603673168
02-01 11:13:36.960 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeIsClosed 1603703488
02-01 11:13:36.960 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeGetVersion 1603703488
02-01 11:13:36.960 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeGetVersion 1603703488
02-01 11:13:36.960 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeIsClosed 1603703488
02-01 11:13:36.960 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeBeginTransaction 1603703488
02-01 11:13:36.960 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeGetVersion 1603703488
02-01 11:13:36.960 30143-30143/com.package V/REALM_JNI:  --> Java_io_realm_internal_SharedRealm_nativeSetVersion 1603703488
02-01 11:13:36.960 30143-30143/com.package A/libc: Fatal signal 11 (SIGSEGV) at 0x5f954ff6 (code=2), thread 30143 (i.android.local)
02-01 11:13:36.968 30143-30145/com.package A/libc: @@@ ABORTING: LIBC: HEAP MEMORY CORRUPTION IN dlmalloc
02-01 11:13:36.968 30143-30145/com.package A/libc: Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 30145 (GC)

@ernestp
Copy link

ernestp commented Feb 24, 2017

Seems having same issue, after app termination (and probably db corruption) app crashes every time with below crash log, device Samsung S6 have free RAM 1.4Gb, 18Gb storage free, Realm 2.3.1

Fatal Exception: io.realm.exceptions.RealmError: Unrecoverable error. mmap() failed: Out of memory size: 872415232 offset: 0 in /Users/blakemeike/Working/release/realm/realm-library/src/main/cpp/io_realm_internal_SharedRealm.cpp line 94 at io.realm.internal.SharedRealm.nativeGetSharedRealm(SharedRealm.java) at io.realm.internal.SharedRealm.getInstance(SharedRealm.java:211) at io.realm.internal.SharedRealm.getInstance(SharedRealm.java:188) at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:124) at io.realm.Realm.getDefaultInstance(Realm.java:209) at user code at android.app.ActivityThread.handleCreateService(ActivityThread.java:3808) at android.app.ActivityThread.access$2100(ActivityThread.java:222) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1883) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7229) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

@cmelchior
Copy link
Contributor

Outdated. Closing due to inactivty as most likely the underlying code has changed by now. Also, many of the comments here seem to indicate different problems

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 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

10 participants