{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/1472","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1472/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1472/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1472/events","html_url":"https://github.com/realm/realm-cocoa/issues/1472","id":56988427,"number":1472,"title":"Realm sometimes crashes when first accessing it","user":{"login":"anlaital","id":2168023,"avatar_url":"https://avatars.githubusercontent.com/u/2168023?v=3","gravatar_id":"","url":"https://api.github.com/users/anlaital","html_url":"https://github.com/anlaital","followers_url":"https://api.github.com/users/anlaital/followers","following_url":"https://api.github.com/users/anlaital/following{/other_user}","gists_url":"https://api.github.com/users/anlaital/gists{/gist_id}","starred_url":"https://api.github.com/users/anlaital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anlaital/subscriptions","organizations_url":"https://api.github.com/users/anlaital/orgs","repos_url":"https://api.github.com/users/anlaital/repos","events_url":"https://api.github.com/users/anlaital/events{/privacy}","received_events_url":"https://api.github.com/users/anlaital/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/pending","name":"pending","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-09T04:39:45Z","updated_at":"2015-02-11T03:44:55Z","closed_at":null,"body":"We are currently doing internal piloting on the version of our app that uses Realm with encryption enabled, and I'm seeing a few of these crashes. These are taken from  Crashlytics and the app is built in release mode. The [RLMObject allObjects] is the first Realm call that is invoked in the app when this crash happens.\r\n\r\nThese crashes seem to be fairly frequent. Realm version is 0.90.5.\r\n\r\n```\r\nCrashed: com.apple.main-thread\r\nEXC_BAD_ACCESS KERN_PROTECTION_FAILURE at 0x000000010487810c\r\n\r\nThread : Crashed: com.apple.main-thread\r\n0  *                           0x0000000100335d10 tightdb::Array::init_from_mem(tightdb::MemRef) + 336\r\n1  *                           0x00000001003aecd4 tightdb::SharedGroup::open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, tightdb::SharedGroup::DurabilityLevel, bool, char const*) + 2504\r\n2  *                           0x00000001003aecd4 tightdb::SharedGroup::open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, tightdb::SharedGroup::DurabilityLevel, bool, char const*) + 2504\r\n3  *                           0x00000001003b0034 tightdb::SharedGroup::open(tightdb::Replication&, tightdb::SharedGroup::DurabilityLevel, char const*) + 7464\r\n4  *                           0x00000001002f90f4 tightdb::SharedGroup::SharedGroup(tightdb::Replication&, tightdb::SharedGroup::DurabilityLevel, char const*) (group_shared.hpp:610)\r\n5  *                           0x00000001002f3d5c -[RLMRealm initWithPath:key:readOnly:inMemory:dynamic:error:] (RLMRealm.mm:303)\r\n6  *                           0x00000001002f4ce0 +[RLMRealm realmWithPath:key:readOnly:inMemory:dynamic:schema:error:] (RLMRealm.mm:483)\r\n7  *                           0x00000001002f4910 +[RLMRealm realmWithPath:readOnly:error:] (RLMRealm.mm:408)\r\n8  *                           0x00000001002f4870 +[RLMRealm defaultRealm] (RLMRealm.mm:396)\r\n9  *                           0x00000001002cd390 +[RLMObject allObjects] (RLMObject.mm:78)\r\n```"},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/73829993","html_url":"https://github.com/realm/realm-cocoa/issues/1472#issuecomment-73829993","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1472","id":73829993,"user":{"login":"anlaital","id":2168023,"avatar_url":"https://avatars.githubusercontent.com/u/2168023?v=3","gravatar_id":"","url":"https://api.github.com/users/anlaital","html_url":"https://github.com/anlaital","followers_url":"https://api.github.com/users/anlaital/followers","following_url":"https://api.github.com/users/anlaital/following{/other_user}","gists_url":"https://api.github.com/users/anlaital/gists{/gist_id}","starred_url":"https://api.github.com/users/anlaital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anlaital/subscriptions","organizations_url":"https://api.github.com/users/anlaital/orgs","repos_url":"https://api.github.com/users/anlaital/repos","events_url":"https://api.github.com/users/anlaital/events{/privacy}","received_events_url":"https://api.github.com/users/anlaital/received_events","type":"User","site_admin":false},"created_at":"2015-02-11T03:44:55Z","updated_at":"2015-02-11T03:44:55Z","body":"I'm not using ```writeCopyToPath:encryptionKey:```, but I am using an encrypted Realm. One possibility is to narrow this issue down to the encryption implementation, so I'll release the next internal beta without it just to see if this issue no longer happens. That way there's at least a way of knowing something more about this.\r\n\r\nIf this happens even without encryption then that also helps a lot with debugging efforts."}}