{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-core/issues/2252","repository_url":"https://api.github.com/repos/realm/realm-core","labels_url":"https://api.github.com/repos/realm/realm-core/issues/2252/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-core/issues/2252/comments","events_url":"https://api.github.com/repos/realm/realm-core/issues/2252/events","html_url":"https://github.com/realm/realm-core/issues/2252","id":182105189,"number":2252,"title":"Assertion failed: &src_table->get_column_link_base(src_col_ndx).get_target_table() == this","user":{"login":"jpsim","id":474794,"avatar_url":"https://avatars.githubusercontent.com/u/474794?v=3","gravatar_id":"","url":"https://api.github.com/users/jpsim","html_url":"https://github.com/jpsim","followers_url":"https://api.github.com/users/jpsim/followers","following_url":"https://api.github.com/users/jpsim/following{/other_user}","gists_url":"https://api.github.com/users/jpsim/gists{/gist_id}","starred_url":"https://api.github.com/users/jpsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpsim/subscriptions","organizations_url":"https://api.github.com/users/jpsim/orgs","repos_url":"https://api.github.com/users/jpsim/repos","events_url":"https://api.github.com/users/jpsim/events{/privacy}","received_events_url":"https://api.github.com/users/jpsim/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-core/labels/T:Bug-Crash","name":"T:Bug-Crash","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-10T20:17:32Z","updated_at":"2016-10-10T20:33:22Z","closed_at":null,"body":"Realm Swift user reported an assertion failure with core 2.0.1: https://secure.helpscout.net/conversation/260289054/6881\r\n\r\n```\r\ntable.cpp:4415: [realm-core-2.0.1] Assertion failed: &src_table->get_column_link_base(src_col_ndx).get_target_table() == this\r\n0 Realm 0x0000000112c72778 _ZN5realm4utilL18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 40\r\n1 Realm 0x0000000112c72a7a _ZN5realm4util9terminateEPKcS2_lOSt16initializer_listINS0_9PrintableEE + 506\r\n2 Realm 0x0000000112e15b19 _ZN5realm5Table17get_backlink_viewEmPS0_m + 153\r\n3 Realm 0x00000001129efb99 _ZL20RLMGetLinkingObjectsP13RLMObjectBaseP11RLMProperty + 441\r\n4 Realm 0x00000001129eee47 RLMDynamicGet + 455\r\n5 RealmSwift 0x000000011325c080 _TFC10RealmSwift18LinkingObjectsBaseg10rlmResultsGCSo10RLMResultsCSo9RLMObject_ + 384\r\n6 RealmSwift 0x000000011325f822 _TFC10RealmSwift14LinkingObjects12makeIteratorfT_GCS_11RLMIteratorx_ + 82\r\n7 [REDACTED]\r\n8 [REDACTED]\r\n9 [REDACTED]\r\n10 libdispatch.dylib 0x0000000116808980 _dispatch_call_block_and_release + 12\r\n11 libdispatch.dylib 0x00000001168320cd _dispatch_client_callout + 8\r\n12 libdispatch.dylib 0x000000011680e1c3 _dispatch_continuation_pop + 1091\r\n13 libdispatch.dylib 0x000000011680dc73 _dispatch_async_redirect_invoke + 925\r\n14 libdispatch.dylib 0x00000001168133b7 _dispatch_root_queue_drain + 720\r\n15 libdispatch.dylib 0x000000011681308b _dispatch_worker_thread3 + 123\r\n16 libsystem_pthread.dylib 0x0000000116be1746 _pthread_wqthread + 1299\r\n17 libsystem_pthread.dylib 0x0000000116be1221 start_wqthread + 13\r\nIMPORTANT: if you see this error, please send this log to help@realm.io.\r\n```\r\n\r\nUser says that this code used to work prior to upgrading to Realm Swift 2.x. Here's a sanitized version of the code in question:\r\n\r\n```swift\r\n// Models\r\n\r\nclass ModelA: Object {\r\n  // some properties\r\n  let bObjects = LinkingObjects(fromType: ModelB.self, property: \"aObjects\")\r\n}\r\n\r\nclass ModelB: Object {\r\n  let aObjects = List<ModelA>()\r\n}\r\n\r\n// Code\r\n\r\nlet bObjects = a!.bObjects\r\n\r\ntry! realm.write {\r\n  realm.delete(a!)\r\n}\r\nfor b in bObjects { // <- assertion failure here\r\n  // not relevant\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/realm/realm-core/issues/comments/252738266","html_url":"https://github.com/realm/realm-core/issues/2252#issuecomment-252738266","issue_url":"https://api.github.com/repos/realm/realm-core/issues/2252","id":252738266,"user":{"login":"avitus","id":31926,"avatar_url":"https://avatars.githubusercontent.com/u/31926?v=3","gravatar_id":"","url":"https://api.github.com/users/avitus","html_url":"https://github.com/avitus","followers_url":"https://api.github.com/users/avitus/followers","following_url":"https://api.github.com/users/avitus/following{/other_user}","gists_url":"https://api.github.com/users/avitus/gists{/gist_id}","starred_url":"https://api.github.com/users/avitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avitus/subscriptions","organizations_url":"https://api.github.com/users/avitus/orgs","repos_url":"https://api.github.com/users/avitus/repos","events_url":"https://api.github.com/users/avitus/events{/privacy}","received_events_url":"https://api.github.com/users/avitus/received_events","type":"User","site_admin":false},"created_at":"2016-10-10T20:33:22Z","updated_at":"2016-10-10T20:33:22Z","body":"For what it's worth, I've worked around this by changing the query to:\r\n\r\n`let bObjects = Array(a!.bObjects).map {$0.id}`\r\n\r\nThat avoids the LazyMapRandomAccessCollection and ensures that the id's are preserved after deleting 'a'.\r\n\r\nOne thing I forgot to mention is that I'm using Swift 3."}}
{"actor":{"display_login":"avitus"}}