Skip to content

Trying to open a particular Realm DB file throws the following exception - "Upgrading from file format version 22 to 24 D:\a\realm-dotnet\realm-dotnet\wrappers\realm-core\src\realm/util/encrypted_file_mapping.hpp:180: [realm-core-14.5.1] Assertion failed: local_ndx < m_page_state.size() with (local_ndx, m_page_state.size(), size_t(addr), size_t(m_addr), m_page_shift) = [85, 1, 2331762327552, 2331762294784, 16] <backtrace not supported on this platform>" #3592

@clement-ilango

Description

@clement-ilango

What happened?

Info: DB: 61583 Thread 48384: Upgrading from file format version 22 to 24
D:\a\realm-dotnet\realm-dotnet\wrappers\realm-core\src\realm/util/encrypted_file_mapping.hpp:180: [realm-core-14.5.1] Assertion failed: local_ndx < m_page_state.size() with (local_ndx, m_page_state.size(), size_t(addr), size_t(m_addr), m_page_shift) = [85, 1, 2331762327552, 2331762294784, 16]

Repro steps

Same as above.

Version

.NET FRAMEWORK 4.7.2

What Atlas Services are you using?

Local Database only

What type of application is this?

WPF

Client OS and version

Windows 10

Code snippets

        var config = new RealmConfiguration(fileName);
        config.SchemaVersion = 6;

        config.Schema = new[] {....}

        if (!string.IsNullOrEmpty(FileName) && File.Exists(FileName))
        {
            var hex = File.ReadAllText(FileName);
            byte[] bytes = Misc.HexToBytes(hex);
            config.Key = bytes;
        }
        else
        {
            var hex = "";
            if (Settings.Instance.AndroidMobile.KeyEnabledOrNot)
            {
                hex = Settings.Instance.AndroidMobile.Key;
                if (string.IsNullOrEmpty(hex))
                    throw new Exception(Resources.strPleaseProvideKey);
            }
            if (!string.IsNullOrEmpty(hex))
            {
                byte[] bytes = Misc.HexToBytes(hex);
                config.Key = bytes;
            }
        }

        using (var realm = Realm.GetInstance(config))
        {
              //Do some things with the opened Realm DB
        }

Stacktrace of the exception/crash you're getting

No response

Relevant log output

2024-05-01 23:47:31.993 Info: DB: 61583 Thread 48384: Upgrading from file format version 22 to 24
D:\a\realm-dotnet\realm-dotnet\wrappers\realm-core\src\realm/util/encrypted_file_mapping.hpp:180: [realm-core-14.5.1] Assertion failed: local_ndx < m_page_state.size() with (local_ndx, m_page_state.size(), size_t(addr), size_t(m_addr), m_page_shift) =  [85, 1, 2331762327552, 2331762294784, 16]
<backtrace not supported on this platform>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions