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

Sectioned results crash - Invalid Address

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      SDK and version

      SDK : iOS
      Version: 10.43.0
      Core: 13.22.0

      Observations

      • How frequent do the crash occur?
        32 users and counting (~0.8% of the users of now)
      • Does it happen in production or during dev/test?
        Production
      • Can the crash be reproduced by you?
        No :/
      • Can you provide instructions for how we can reproduce it?
        We are observing sectioned results on a custom computed key. Maybe it can help to know that this key is not managed by realm.

      Crash log / stacktrace

      EXC_BAD_ACCESS
      Exception 1, Code 1, Subcode 88 >
      KERN_INVALID_ADDRESS at 0x58.
      

      Demangled symbols shows the crash at the following line:

      sectioned_results.cpp:124:

       for (size_t i = m_change.modifications.size(); i > 0; --i) {
                  auto& indexes_old = m_change.modifications[i - 1];
                  auto key = m_sectioned_results.m_previous_index_to_key[i - 1]; // <- Offending line
                  auto it = m_sectioned_results.m_current_key_to_index.find(key); 
                  if (it == m_sectioned_results.m_current_key_to_index.end()) {
                      // Section was removed due to all of the rows being moved to
                      // other sections. No need to report the individual rows as deleted.
                      indexes_old.clear();
      

      Steps & Code to Reproduce

      We can't reproduce the issue but our code is open source here: https://github.com/Infomaniak/ios-kMail/pull/1037/files#diff-c43bb011c6baa01d7daa6630b1cb91c05ed05a927e7529ab3895b63896083ba3R47

      I posted an issue on the swift repo but since the crash happens in core I think it's better to post the issue is here.
      (https://github.com/realm/realm-core/issues/7321)

            Assignee:
            nicola.cabiddu@mongodb.com Nicola Cabiddu
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: