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

Assert while trimming history.

      How frequently does the bug occur?

      Sometimes

      Description

      We noticed some crash happened in our app from Firebase Crashlytics.
      This crash has occurred repeatedly by a small number of users only.
      We can’t reproduce this in both of development and production app.
      Does anyone have any idea from the stack trace?

      Stacktrace & log output

      Unable to find source-code formatter for language: shell. 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
      Crashed: com.quipper.realm
      0  libsystem_kernel.dylib         0x6bbc __pthread_kill + 8
      1  libsystem_pthread.dylib        0xd854 pthread_kill + 208
      2  libsystem_c.dylib              0x1f6ac abort + 124
      3  Realm                          0x2d031c please_report_this_issue_in_github_realm_realm_core + 10
      4  Realm                          0x2d061c realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 328
      5  Realm                          0x2d0980 realm::util::terminate_with_info(char const*, char const*, long, char const*, std::initializer_list<realm::util::Printable>&&) + 388
      6  Realm                          0x14eec0 void realm::util::terminate_with_info<unsigned long&, unsigned long&, unsigned long const&, unsigned long&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(char const*, int, char const*, char const*, unsigned long&, unsigned long&, unsigned long const&, unsigned long&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) + 134
      7  Realm                          0x14ecc4 realm::SlabAlloc::do_free(unsigned long, char*) + 1864
      8  Realm                          0x15e3c4 realm::Array::destroy_deep(realm::MemRef, realm::Allocator&) + 60
      9  Realm                          0x15e308 realm::Array::destroy_deep(unsigned long, realm::Allocator&) + 140
      10 Realm                          0x15296c realm::Array::destroy_children(unsigned long) + 116
      11 Realm                          0x15e42c realm::Array::destroy_deep(realm::MemRef, realm::Allocator&) + 164
      12 Realm                          0x15e308 realm::Array::destroy_deep(unsigned long, realm::Allocator&) + 140
      13 Realm                          0x15de94 realm::ArrayBinary::erase(unsigned long) + 68
      14 Realm                          0x4191b0 realm::util::FunctionRef<unsigned long (realm::BPlusTreeNode*, unsigned long)>::FunctionRef<realm::BPlusTree<realm::BinaryData>::erase(unsigned long)::'lambda'(realm::BPlusTreeNode*, unsigned long)&>(realm::BPlusTree<realm::BinaryData>::erase(unsigned long)::'lambda'(realm::BPlusTreeNode*, unsigned long)&)::'lambda'(void*, realm::BPlusTreeNode*, unsigned long)::__invoke(void*, realm::BPlusTreeNode*, unsigned long) + 28
      15 Realm                          0x1715f0 realm::BPlusTreeBase::bptree_erase(unsigned long, realm::util::FunctionRef<unsigned long (realm::BPlusTreeNode*, unsigned long)>) + 52
      16 Realm                          0x1b3104 (anonymous namespace)::InRealmHistory::set_oldest_bound_version(unsigned long long) + 164
      17 Realm                          0x18d734 realm::DB::low_level_commit(unsigned long long, realm::Transaction&, bool) + 296
      18 Realm                          0x18dbb4 realm::Transaction::commit_and_continue_as_read(bool) + 164
      19 Realm                          0x392504 realm::_impl::RealmCoordinator::commit_write(realm::Realm&, bool) + 108
      20 Realm                          0x420aa4 realm::Realm::commit_transaction() + 128
      21 Realm                          0x1222d4 -[RLMRealm commitWriteTransactionWithoutNotifying:error:] + 288
      22 RealmSwift                     0x6a908 $s10RealmSwift0A0V5write16withoutNotifying_xSaySo20RLMNotificationTokenCG_xyKXEtKlF + 400
      23 LocalCache                     0x996c specialized closure realm/realm-swift#1 in RealmModel.add(_:update:) + 117 (RealmModel.swift:117)
      24 LocalCache                     0xaa8c partial apply for specialized closure realm/realm-swift#1 in RealmModel.add(_:update:) + 444 (<compiler-generated>:444)
      25 Hydra                          0x9a70 closure realm/realm-swift#1 in closure realm/realm-swift#1 in Promise.runBody() + 168 (Promise.swift:168)
      26 Hydra                          0xc994 thunk for @escaping @callee_guaranteed () -> () + 28 (<compiler-generated>:28)
      27 libdispatch.dylib              0x63094 _dispatch_call_block_and_release + 24
      28 libdispatch.dylib              0x64094 _dispatch_client_callout + 16
      29 libdispatch.dylib              0xa73c _dispatch_lane_serial_drain$VARIANT$mp + 644
      30 libdispatch.dylib              0xb1f4 _dispatch_lane_invoke$VARIANT$mp + 408
      31 libdispatch.dylib              0x14ec8 _dispatch_workloop_worker_thread + 632
      32 libsystem_pthread.dylib        0x1e10 _pthread_wqthread + 284
      33 libsystem_pthread.dylib        0x193c start_wqthread + 8
      

      Can you reproduce the bug?

      Not yet

      Reproduction Steps

      We can't reproduce this crash.
      This crash almost happened in the first 5 seconds of a user's session from the logs.

      Version

      10.25.0

      What SDK flavour are you using?

      Local Database only

      Are you using encryption?

      No, not using encryption

      Platform OS and version(s)

      iPadOS 15.4.x, 15.5.x

      Build environment

      Xcode version: 13.3.1
      Dependency manager and version: Using downloaded static framework directly.


      \`\`\`
      ProductName:	macOS
      ProductVersion:	12.3.1
      BuildVersion:	21E258
      
      /Applications/Xcode-13.3.1.app/Contents/Developer
      Xcode 13.3.1
      Build version 13E500a
      
      
      
      
      /bin/bash
      GNU bash, version 3.2.57(1)-release (arm64-apple-darwin21)
      
      
      (not in use here)
      
      /usr/bin/git
      git version 2.32.0 (Apple Git-132)
      \`\`\`
      
      

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

              Created:
              Updated:
              Resolved: