Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-146

Crash: Invalid mnemonic

      We are seeing a number of crash reports on the Java side that indicates the Realm file is somehow being corrupted. It is still unclear why this is happening, but the errors all have the same form but with different values:

      Fatal Exception: io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/data/com.test/files/userdb.realm': Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 623E3EBB12044142, mnemonic: A7 8C EE A, fmt[0]: 160, fmt[1]: 49, flags: D7. (Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 623E3EBB12044142, mnemonic: A7 8C EE A, fmt[0]: 160, fmt[1]: 49, flags: D7) (/data/data/com.test/files/userdb.realm) in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101

      References to Java issues:

      Current observations:

      • We can still not rule out completely this is happening due to the files being manipulated by code outside Realm's control, e.g. end app users users deleting or moving files or backup/restore procedures overwritting files.
      • There are few (if any) reports of this happening on other platforms which either indicates a general problem in the Java binding or the Android kernel.
      • It is happening across a wide variety of Android devices and versions indicating the problem is on our side.
      • This crash is seen together with https://github.com/realm/realm-core/issues/3133. One observation is that this crash only seems to happen for the userdb.realm while #3133 only happens for the librarydb.realm. This could indicate these files are somehow being handled differently as they seem to become corrupted in different ways. I'm trying to verify this.

      Known devices that has experienced this error:

      • Galaxy Grand Prime
      • Galaxy J1
      • Galaxy Note3 Neo
      • Mate 7
      • Moto G (5S) Plus
      • Redmi Note 4
      • SM-J400F
      • SM-G611MT

      Crash data:

      A list of exceptions and devices it is happening on can be seen here:

      Unable to find source-code formatter for language: text. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      Searching 66 files for "(# OS Version(.|\n)*?)(^Fatal Exception:.*Invalid mnemonic.*)" (regex)
      
      /Users/cm/Downloads/User Realm Crashes/com.test_issue_2727_crash_5BABA50602E90001659D11678B8E9F44_DNE_0_v2.txt:
         11  # Date: 2018-09-26T15:25:00Z
         12: # OS Version: 8.1.0
         13: # Device: Moto G (5S) Plus
         14: # RAM Free: 54.5%
         15: # Disk Free: 75.6%
         16: 
         17: 
         18: Fatal Exception: java.lang.RuntimeException: Unable to create application com.test.MainApplication: io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/data/com.test/files/userdb.realm': Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 6D9515BB3A044142, mnemonic: 50 F0 D2 A9, fmt[0]: 58, fmt[1]: 174, flags: 30. (Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 6D9515BB3A044142, mnemonic: 50 F0 D2 A9, fmt[0]: 58, fmt[1]: 174, flags: 30) (/data/data/com.test/files/userdb.realm) in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101 Kind: ACCESS_ERROR.
      
      /Users/cm/Downloads/User Realm Crashes/com.test_issue_2727_crash_5BAC04C9037F00017A589B5172E1E4A0_DNE_0_v2.txt:
         11  # Date: 2018-09-26T21:50:08Z
         12: # OS Version: 5.1.1
         13: # Device: Galaxy Note3 Neo
         14: # RAM Free: 17.6%
         15: # Disk Free: 3.5%
         16: 
         17: 
         18: Fatal Exception: io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/data/com.test/files/userdb.realm': Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 623E3EBB12044142, mnemonic: A7 8C EE A, fmt[0]: 160, fmt[1]: 49, flags: D7. (Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 623E3EBB12044142, mnemonic: A7 8C EE A, fmt[0]: 160, fmt[1]: 49, flags: D7) (/data/data/com.test/files/userdb.realm) in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101
      
      /Users/cm/Downloads/User Realm Crashes/com.test_issue_2727_crash_5BB30FB001BF00010F7711678B8E9F44_DNE_0_v2.txt:
         11  # Date: 2018-10-02T06:26:00Z
         12: # OS Version: 8.1.0
         13: # Device: Moto G (5S) Plus
         14: # RAM Free: 49.6%
         15: # Disk Free: 71.6%
         16: 
         17: 
         18: Fatal Exception: java.lang.RuntimeException: Unable to create application com.test.MainApplication: io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/data/com.test/files/userdb.realm': Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 6D9515BB3A044142, mnemonic: 50 F0 D2 A9, fmt[0]: 58, fmt[1]: 174, flags: 30. (Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 6D9515BB3A044142, mnemonic: 50 F0 D2 A9, fmt[0]: 58, fmt[1]: 174, flags: 30) (/data/data/com.test/files/userdb.realm) in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101 Kind: ACCESS_ERROR.
      
      /Users/cm/Downloads/User Realm Crashes/com.test_issue_2727_crash_5BBFB19D03B3000172D76B2E4A0B9596_DNE_0_v2.txt:
         11  # Date: 2018-10-11T20:25:00Z
         12: # OS Version: 5.1.1
         13: # Device: Mate 7
         14: # RAM Free: 41.4%
         15: # Disk Free: 18.8%
         16: 
         17: 
         18: Fatal Exception: java.lang.RuntimeException: Unable to create application com.test.MainApplication: io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/data/com.test/files/userdb.realm': Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 9AF3F63B74044142, mnemonic: 26 5A 98 D, fmt[0]: 195, fmt[1]: 51, flags: 9F. (Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 9AF3F63B74044142, mnemonic: 26 5A 98 D, fmt[0]: 195, fmt[1]: 51, flags: 9F) (/data/data/com.test/files/userdb.realm) in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101 Kind: ACCESS_ERROR.
      
      /Users/cm/Downloads/User Realm Crashes/com.test_issue_2727_crash_5BC5AD7902FA00015EA2A8B0ED677417_DNE_0_v2.txt:
         11  # Date: 2018-10-16T09:20:00Z
         12: # OS Version: 8.0.0
         13: # Device: SM-J400F
         14: # RAM Free: 23.7%
         15: # Disk Free: 67.4%
         16: 
         17: 
         18: Fatal Exception: java.lang.RuntimeException: Unable to create application com.test.MainApplication: io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/data/com.test/files/userdb.realm': Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 6841387164044142, mnemonic: 88 54 B0 9E, fmt[0]: 15, fmt[1]: 65, flags: 1B. (Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 6841387164044142, mnemonic: 88 54 B0 9E, fmt[0]: 15, fmt[1]: 65, flags: 1B) (/data/data/com.test/files/userdb.realm) in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101 Kind: ACCESS_ERROR.
      
      /Users/cm/Downloads/User Realm Crashes/com.test_issue_2727_crash_5BC5B8DB038800013B7DA8B0ED677417_DNE_0_v2.txt:
         11  # Date: 2018-10-16T10:09:00Z
         12: # OS Version: 8.0.0
         13: # Device: SM-J400F
         14: # RAM Free: 35.9%
         15: # Disk Free: 68.8%
         16: 
         17: 
         18: Fatal Exception: java.lang.RuntimeException: Unable to create application com.test.MainApplication: io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/data/com.test/files/userdb.realm': Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 6841387164044142, mnemonic: 88 54 B0 9E, fmt[0]: 15, fmt[1]: 65, flags: 1B. (Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 6841387164044142, mnemonic: 88 54 B0 9E, fmt[0]: 15, fmt[1]: 65, flags: 1B) (/data/data/com.test/files/userdb.realm) in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101 Kind: ACCESS_ERROR.
      
      /Users/cm/Downloads/User Realm Crashes/com.test_issue_2727_crash_5BC617EC039000017784A8B0ED677417_DNE_0_v2.txt:
         11  # Date: 2018-10-16T16:55:00Z
         12: # OS Version: 8.0.0
         13: # Device: SM-J400F
         14: # RAM Free: 30.7%
         15: # Disk Free: 68.4%
         16: 
         17: 
         18: Fatal Exception: java.lang.RuntimeException: Unable to create application com.test.MainApplication: io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/data/com.test/files/userdb.realm': Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 6841387164044142, mnemonic: 88 54 B0 9E, fmt[0]: 15, fmt[1]: 65, flags: 1B. (Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 6841387164044142, mnemonic: 88 54 B0 9E, fmt[0]: 15, fmt[1]: 65, flags: 1B) (/data/data/com.test/files/userdb.realm) in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101 Kind: ACCESS_ERROR.
      
      /Users/cm/Downloads/User Realm Crashes/com.test_issue_2727_crash_5BC7AFEB03E100014B1CBE206EDC8208_DNE_0_v2.txt:
         11  # Date: 2018-10-17T21:55:50Z
         12: # OS Version: 8.0.0
         13: # Device: SM-G611MT
         14: # RAM Free: 26.2%
         15: # Disk Free: 62.3%
         16: 
         17: 
         18: Fatal Exception: java.lang.RuntimeException: Unable to create application com.test.MainApplication: io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/data/com.test/files/userdb.realm': Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: F107DDE3F1044142, mnemonic: 8A 76 9C BC, fmt[0]: 182, fmt[1]: 246, flags: D1. (Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: F107DDE3F1044142, mnemonic: 8A 76 9C BC, fmt[0]: 182, fmt[1]: 246, flags: D1) (/data/data/com.test/files/userdb.realm) in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101 Kind: ACCESS_ERROR.
      
      /Users/cm/Downloads/User Realm Crashes/com.test_issue_2727_crash_5BCAA37201E8000118B353A4AF9E1966_DNE_0_v2.txt:
         11  # Date: 2018-10-20T03:39:00Z
         12: # OS Version: 5.0.2
         13: # Device: Galaxy Grand Prime
         14: # RAM Free: 36.7%
         15: # Disk Free: 23.2%
         16: 
         17: 
         18: Fatal Exception: java.lang.RuntimeException: Unable to create application com.test.MainApplication: io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/data/com.test/files/userdb.realm': Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: DDFE0CDD21044142, mnemonic: 6D 6A 23 E3, fmt[0]: 79, fmt[1]: 228, flags: BB. (Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: DDFE0CDD21044142, mnemonic: 6D 6A 23 E3, fmt[0]: 79, fmt[1]: 228, flags: BB) (/data/data/com.test/files/userdb.realm) in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101 Kind: ACCESS_ERROR.
      
      /Users/cm/Downloads/User Realm Crashes/com.test_issue_2727_crash_5BD5C91F014E0001452D672A97D5E137_DNE_0_v2.txt:
         11  # Date: 2018-10-28T14:35:00Z
         12: # OS Version: 6.0.1
         13: # Device: Galaxy J1
         14: # RAM Free: 41.5%
         15: # Disk Free: 6.6%
         16: 
         17: 
         18: Fatal Exception: java.lang.RuntimeException: Unable to create application com.test.MainApplication: io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/data/com.test/files/userdb.realm': Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 8DB56480F044142, mnemonic: C7 C7 2 58, fmt[0]: 160, fmt[1]: 169, flags: AB. (Invalid mnemonic. top_ref[0]: 104600030316, top_ref[1]: 8DB56480F044142, mnemonic: C7 C7 2 58, fmt[0]: 160, fmt[1]: 169, flags: AB) (/data/data/com.test/files/userdb.realm) in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101 Kind: ACCESS_ERROR.
      
      10 matches across 10 files
      

            Assignee:
            jorgen.edelbo@mongodb.com Jørgen Edelbo
            Reporter:
            christian.melchior@mongodb.com Christian Melchior (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: