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

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

Closed
clement-ilango opened this issue May 2, 2024 · 12 comments
Assignees

Comments

@clement-ilango
Copy link

clement-ilango commented May 2, 2024

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>
Copy link

sync-by-unito bot commented May 2, 2024

➤ PM Bot commented:

Jira ticket: RNET-1141

@nirinchev
Copy link
Member

You haven't specified the version of the Realm SDK that you're using, but this appears to be a bug that was fixed in the latest version - can you try upgrading to confirm?

@nirinchev
Copy link
Member

@ironage this appears to be similar to the encryption bug that you fixed, but continues to happen even with Core 14.6.1, which should contain the fix. Is there anything obvious from the stacktrace or something we can ask the reporter to try track it down?

@ironage
Copy link

ironage commented May 2, 2024

Hi @clement-ilango the stack traces you provided show you are using a core version of v14.5.1, and the relevant fix is in v14.6.0. For the .Net SDK this is version 12.1.0 (2024-05-01) or later. Please try upgrading and let us know if this solves the issue. If not, please provide an updated stack trace, and send your Realm file with encryption key to realm-help@mongodb.com.

@ironage ironage added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label May 2, 2024
@ironage
Copy link

ironage commented May 2, 2024

@clement-ilango apologies, I missed this part of your latest message:

D:\a\realm-dotnet\realm-dotnet\wrappers\realm-core\src\realm/util/encrypted_file_mapping.hpp:184: [realm-core-14.6.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, 1549425541120, 1549425508352, 16]

Which indicates that you are still seeing this on the updated version. Could you please still send the file to the email in my message above so that we can reproduce this and track down the issue?

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels May 2, 2024
@ironage
Copy link

ironage commented May 2, 2024

@clement-ilango sorry, but I am unable to find your attachment when you respond by email to this thread. As far as I can tell, it is a limitation of Github's issue response system. Would you be able to send the file to realm-help@mongodb.com ?

@clement-ilango
Copy link
Author

clement-ilango commented May 2, 2024 via email

@ironage
Copy link

ironage commented May 3, 2024

@clement-ilango I have received the files. Thanks for your patience in this process, we will investigate.

@nirinchev
Copy link
Member

@clement-ilango I've edited the ticket in Jira to remove the sensitive information. Can you please double check to confirm. If there's more content that needs to be removed, can you please reach out to me via email at nikola.irinchev@mongodb.com.

@ironage
Copy link

ironage commented Jun 10, 2024

We have merged a fix, please try when the next release is available that includes Core v14.10.0

@clement-ilango
Copy link
Author

clement-ilango commented Jun 10, 2024 via email

@nirinchev
Copy link
Member

Fixed in 12.3.0

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants