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

Crash when accessing orphaned nested list

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

      Expected results

      Clearing a list with nested lists in an mixed field will lead to a crash on any access to the previously nested lists - also even tests for validity. We need to be able to at least ask if the lists are still valid.

      This only happens if we clear the parent list with realm_list_clear(parent) but not if the mixed property is overwritten with a non-list value.

      See this test for reproduction.

      Actual Results

      Crash

      [ctest] libc++abi: terminating due to uncaught exception of type realm::OutOfBounds: Requested index 0 calling get() on list 'Foo.any' when empty
      

      Steps & Code to Reproduce

      The crash is trigger by CHECK(!realm_list_is_valid(user_data.list)); in this test

      Core version

      Core version: 14.4.1

            Assignee:
            jorgen.edelbo@mongodb.com Jørgen Edelbo
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: