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

Assertion failed: m_capacity != 0 #4273

Closed
kharmabum opened this issue Oct 28, 2016 · 2 comments
Closed

Assertion failed: m_capacity != 0 #4273

kharmabum opened this issue Oct 28, 2016 · 2 comments

Comments

@kharmabum
Copy link

kharmabum commented Oct 28, 2016

On migrating from RealmSwift v1.1.0 to RealmSwift v2.0.3, getting this crash (1) at launch. It wasn't the first launch of the application, but I think it may have directly followed another Realm related crash (2). We were also frequently experiencing this crash #4244 (on RealmSwift 1.1.0). Apologies for the lack of accompanying project.

Crash 1

array_integer.cpp:131: [realm-core-2.1.4] Assertion failed: m_capacity != 0
0   Realm                               0x0000000101c46720 _ZN5realm4utilL18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 44
1   Realm                               0x0000000101c46968 _ZN5realm4util9terminateEPKcS2_lOSt16initializer_listINS0_9PrintableEE + 368
2   Realm                               0x0000000101cc38c0 _ZN5realm12ArrayIntNull13init_from_memENS_6MemRefE + 124
3   Realm                               0x0000000101ccdee4 _ZN5realm6BpTreeINS_4util8OptionalIxEEE20create_root_from_memERNS_9AllocatorENS_6MemRefE + 180
4   Realm                               0x0000000101cec050 _ZN5realm15TimestampColumnC2EbRNS_9AllocatorEmm + 328
5   Realm                               0x0000000101d6d978 _ZN5realm5Table22create_column_accessorENS_10ColumnTypeEmm + 440
6   Realm                               0x0000000101d69840 _ZN5realm5Table24refresh_column_accessorsEm + 356
7   Realm                               0x0000000101cf0a14 _ZN5realm5Group21create_table_accessorEm + 280
8   Realm                               0x0000000101cf0870 _ZN5realm5Group12do_get_tableEmPFbRKNS_4SpecEE + 220
9   Realm                               0x0000000101d6991c _ZN5realm5Table24refresh_column_accessorsEm + 576
10  Realm                               0x0000000101cf0a14 _ZN5realm5Group21create_table_accessorEm + 280
11  Realm                               0x0000000101cf0870 _ZN5realm5Group12do_get_tableEmPFbRKNS_4SpecEE + 220
12  Realm                               0x0000000101d6991c _ZN5realm5Table24refresh_column_accessorsEm + 576
13  Realm                               0x0000000101cf0a14 _ZN5realm5Group21create_table_accessorEm + 280
14  Realm                               0x0000000101cf0870 _ZN5realm5Group12do_get_tableEmPFbRKNS_4SpecEE + 220
15  Realm                               0x0000000101b1b788 _ZN5realm12ObjectSchemaC2ERKNS_5GroupENS_10StringDataEm + 148
16  Realm                               0x0000000101b20544 _ZN5realm11ObjectStore17schema_from_groupERKNS_5GroupE + 284
17  Realm                               0x0000000101bd41bc _ZN5realm5Realm4initENSt3__110shared_ptrINS_5_impl16RealmCoordinatorEEE + 128
18  Realm                               0x0000000101b27714 _ZN5realm5_impl16RealmCoordinator9get_realmENS_5Realm6ConfigE + 560
19  Realm                               0x0000000101bd5578 _ZN5realm5Realm16get_shared_realmENS0_6ConfigE + 244
20  Realm                               0x0000000101bb70d0 +[RLMRealm realmWithConfiguration:error:] + 568
21  RealmSwift                          0x0000000102ec01dc _TFC10RealmSwift5RealmCfzT_S0_ + 120
22  Other Chat                          0x00000001002ba540 _TZFC10Other_Chat5Model9configurefT_T_ + 692
23  Other Chat                          0x0000000100344814 _TFC10Other_Chat11AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryCSo8NSObjectPs9AnyObject____Sb + 124
24  Other Chat                          0x00000001003457f4 _TToFC10Other_Chat11AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryCSo8NSObjectPs9AnyObject____Sb + 208
25  UIKit                               0x000000018dffb42c <redacted> + 400
26  UIKit                               0x000000018e20bb70 <redacted> + 3524
27  UIKit                               0x000000018e2118e0 <redacted> + 1656
28  UIKit                               0x000000018e226080 <redacted> + 48
29  UIKit                               0x000000018e20e8c4 <redacted> + 168
30  FrontBoardServices                  0x0000000189ce18bc <redacted> + 36
31  FrontBoardServices                  0x0000000189ce1728 <redacted> + 176
32  FrontBoardServices                  0x0000000189ce1ad0 <redacted> + 56
33  CoreFoundation                      0x00000001880ee278 <redacted> + 24
34  CoreFoundation                      0x00000001880edbc0 <redacted> + 524
35  CoreFoundation                      0x00000001880eb7c0 <redacted> + 804
36  CoreFoundation                      0x000000018801a048 CFRunLoopRunSpecific + 444
37  UIKit                               0x000000018dff45dc <redacted> + 608
38  UIKit                               0x000000018dfef360 UIApplicationMain + 208
39  Other Chat                          0x00000001002f089c main + 876
40  libdyld.dylib                       0x0000000186ffc5b8 <redacted> + 4
IMPORTANT: if you see this error, please send this log to [email protected].(lldb) 

Crash 2

MachException: EXC_CRASH
  libsystem_kernel    0x18710e014  __pthread_kill + 8
  libsystem_pthread   0x1871d5460  pthread_kill + 112
  libsystem_c         0x1870823f4  abort + 140
  Realm               0x100cc251c  please_report_this_error_to_help_at_realm_dot_io + 12
  Realm               0x100cc27dc  realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 232
  Realm               0x100cc2968  realm::util::terminate(char const*, char const*, long, std::initializer_list<realm::util::Printable>&&) + 368
  Realm               0x100b8c23c  void realm::util::terminate<unsigned long, unsigned long>(char const*, char const*, long, unsigned long, unsigned long) + 44
  Realm               0x100b8c344  realm::LinkView::get(unsigned long) + 264
  Realm               0x100b8aef0  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 380
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8afcc  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 600
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8af04  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 400
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8af04  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 400
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8afcc  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 600
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8af04  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 400
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8afcc  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 600
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8af04  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 400
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8af04  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 400
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8afcc  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 600
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8af04  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 400
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8af04  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 400
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8af04  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 400
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8af04  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 400
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8afcc  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 600
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8af04  realm::_impl::DeepChangeChecker::check_outgoing_links(unsigned long, realm::Table const&, unsigned long, unsigned long) + 400
  Realm               0x100b8b124  realm::_impl::DeepChangeChecker::check_row(realm::Table const&, unsigned long, unsigned long) + 252
  Realm               0x100b8b224  realm::_impl::DeepChangeChecker::operator()(unsigned long) + 68
  Realm               0x100b850b0  std::__1::function<bool (unsigned long)>::operator()(unsigned long) const + 40
  Realm               0x100b96ecc  realm::_impl::ListNotifier::run() + 148
  Realm               0x100ba5074  realm::_impl::RealmCoordinator::run_async_notifiers() + 1192
  Realm               0x100ba4b78  realm::_impl::RealmCoordinator::on_change() + 24
  Realm               0x100b8e168  realm::_impl::ExternalCommitHelper::listen() + 172
  Realm               0x100b8f244  std::__1::__async_func<realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0>::operator()() + 28
  Realm               0x100b8f1cc  std::__1::__async_assoc_state<void, std::__1::__async_func<realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0> >::__execute() + 28
  Realm               0x100b8f394  std::__1::__thread_proxy<std::__1::tuple<void (std::__1::__async_assoc_state<void, std::__1::__async_func<realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0> >::*)(), std::__1::__async_assoc_state<void, std::_... + 84
  libsystem_pthread   0x1871d3860  <redacted> + 240
  libsystem_pthread   0x1871d3770  _pthread_start + 284
@jpsim
Copy link
Contributor

jpsim commented Dec 7, 2016

We just released Realm 2.1.1 which includes several bug fixes, including one for a critical bug that could have caused file corruption. This looks like the issue you reported.

Please update to this version as soon as possible. https://github.com/realm/realm-cocoa/releases/tag/v2.1.1

Updating to this version won't automatically repair already corrupt files, so existing users who have experienced corruption will need to delete their affected Realm files. You can send these Realm files to us for forensic recovery if the data is critical.

Thanks.

@kishikawakatsumi
Copy link
Contributor

I'm closing this issue because it seems to be fixed at 2.1.1. But please let us know if what we've posted here helped, and if you have any further questions or suggestions!

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

No branches or pull requests

3 participants