{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/2332","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2332/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2332/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2332/events","html_url":"https://github.com/realm/realm-cocoa/issues/2332","id":98712924,"number":2332,"title":"Crash when sorting by integer value due to `../realm/views.hpp:92: [realm-core-0.92.0] Assertion failed: ctb` on iOS 7.x devices","user":{"login":"kishikawakatsumi","id":40610,"avatar_url":"https://avatars.githubusercontent.com/u/40610?v=3","gravatar_id":"","url":"https://api.github.com/users/kishikawakatsumi","html_url":"https://github.com/kishikawakatsumi","followers_url":"https://api.github.com/users/kishikawakatsumi/followers","following_url":"https://api.github.com/users/kishikawakatsumi/following{/other_user}","gists_url":"https://api.github.com/users/kishikawakatsumi/gists{/gist_id}","starred_url":"https://api.github.com/users/kishikawakatsumi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kishikawakatsumi/subscriptions","organizations_url":"https://api.github.com/users/kishikawakatsumi/orgs","repos_url":"https://api.github.com/users/kishikawakatsumi/repos","events_url":"https://api.github.com/users/kishikawakatsumi/events{/privacy}","received_events_url":"https://api.github.com/users/kishikawakatsumi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/P1","name":"P1","color":"ededed"}],"state":"closed","locked":false,"assignee":{"login":"tgoyne","id":408944,"avatar_url":"https://avatars.githubusercontent.com/u/408944?v=3","gravatar_id":"","url":"https://api.github.com/users/tgoyne","html_url":"https://github.com/tgoyne","followers_url":"https://api.github.com/users/tgoyne/followers","following_url":"https://api.github.com/users/tgoyne/following{/other_user}","gists_url":"https://api.github.com/users/tgoyne/gists{/gist_id}","starred_url":"https://api.github.com/users/tgoyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgoyne/subscriptions","organizations_url":"https://api.github.com/users/tgoyne/orgs","repos_url":"https://api.github.com/users/tgoyne/repos","events_url":"https://api.github.com/users/tgoyne/events{/privacy}","received_events_url":"https://api.github.com/users/tgoyne/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-08-03T10:18:22Z","updated_at":"2015-08-10T23:39:07Z","closed_at":"2015-08-10T23:39:07Z","body":"If sorting by the integer property in the following model running on the devices with iOS 7.x, a crash occurred by hitting assertion.\r\n\r\nStep to reproduce:\r\n\r\n1. Define following the model.\r\n2. Add object of the model to the realm.\r\n3. Querying and sorting by the integer property.\r\n4. Get some value from the results.\r\n\r\nThis crash occurs only when running on the devices. (No crashes occur on the simulators)\r\nThis crash occurs only on the iOS 7. (No crashes occur on iOS 8 and 9)\r\nIf the property is NSString, double or float, no crashes occur.\r\n\r\nThis crash occurs on Realm 0.94.0. No crashes occur with Realm 0.93 or below.\r\n\r\nEnvironment:\r\n- iOS 7.1.2\r\n- iPhone 5s\r\n- Xcode 6.4\r\n- Realm Objective-C 0.94.0\r\n\r\n```objc\r\n@interface Dog : RLMObject\r\n\r\n@property NSInteger number;\r\n\r\n@end\r\n\r\n@implementation Dog\r\n\r\n@end\r\n```\r\n\r\n```objc\r\nRLMRealm *realm = [RLMRealm defaultRealm];\r\n\r\nDog *d = [[Dog alloc] init];\r\nd.number = 1;\r\n\r\n[realm transactionWithBlock:^{\r\n    [realm addObject:d];\r\n}];\r\n\r\nRLMResults *r = [[Dog allObjects] sortedResultsUsingProperty:@\"number\" ascending:NO];\r\nDog *d1 = r[0]; // Crash here\r\n\r\nNSLog(@\"%@\", d1);\r\n```\r\n\r\n\r\n```\r\n../realm/views.hpp:92: [realm-core-0.92.0] Assertion failed: ctb\r\n0   SortCrash                           0x000000010011cf24 _ZN5realm4util18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 44\r\n1   SortCrash                           0x0000000100073b6c _ZN5realm4util9terminateEPKcS2_l + 1192\r\n2   SortCrash                           0x00000001001f6a84 _ZNSt3__16vectorIPKN5realm18ColumnTemplateBaseENS_9allocatorIS4_EEE8__appendEmRKS4_ + 0\r\n3   SortCrash                           0x000000010015fdf0 _ZN5realm10RowIndexes4sortERNS0_6SorterE + 244\r\n4   SortCrash                           0x000000010015f4b8 _ZN5realm13TableViewBase4sortENSt3__16vectorImNS1_9allocatorImEEEENS2_IbNS3_IbEEEE + 1048\r\n5   SortCrash                           0x00000001000f2ccc _ZL26RLMResultsValidateAttachedP10RLMResults + 564\r\n6   SortCrash                           0x00000001000eb920 _ZL18RLMResultsValidateP10RLMResults + 24\r\n7   SortCrash                           0x00000001000ec564 -[RLMResults objectAtIndex:] + 56\r\n8   SortCrash                           0x00000001000ee348 -[RLMResults objectAtIndexedSubscript:] + 48\r\n9   SortCrash                           0x000000010005e8a8 -[AppDelegate application:didFinishLaunchingWithOptions:] + 748\r\n10  UIKit                               0x0000000188dec544 <redacted> + 316\r\n11  UIKit                               0x0000000188debef0 <redacted> + 1564\r\n12  UIKit                               0x0000000188de59d4 <redacted> + 772\r\n13  UIKit                               0x0000000188d798b4 <redacted> + 3316\r\n14  UIKit                               0x0000000188d78ab8 <redacted> + 104\r\n15  UIKit                               0x0000000188de502c <redacted> + 672\r\n16  GraphicsServices                    0x000000018b997504 <redacted> + 676\r\n17  GraphicsServices                    0x000000018b997030 <redacted> + 48\r\n18  CoreFoundation                      0x0000000185d6f040 <redacted> + 56\r\n19  CoreFoundation                      0x0000000185d6efa0 <redacted> + 444\r\n20  CoreFoundation                      0x0000000185d6d1c4 <redacted> + 1620\r\n21  CoreFoundation                      0x0000000185caddd0 CFRunLoopRunSpecific + 452\r\n22  UIKit                               0x0000000188de41b0 <redacted> + 784\r\n23  UIKit                               0x0000000188ddefc4 UIApplicationMain + 1156\r\n24  SortCrash                           0x000000010005ee20 main + 124\r\n25  libdyld.dylib                       0x00000001928abaa0 <redacted> + 4\r\nIMPORTANT: if you see this error, please send this log to help@realm.io.\r\n(lldb) \r\n```"},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/129647383","html_url":"https://github.com/realm/realm-cocoa/issues/2332#issuecomment-129647383","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2332","id":129647383,"user":{"login":"segiddins","id":1946610,"avatar_url":"https://avatars.githubusercontent.com/u/1946610?v=3","gravatar_id":"","url":"https://api.github.com/users/segiddins","html_url":"https://github.com/segiddins","followers_url":"https://api.github.com/users/segiddins/followers","following_url":"https://api.github.com/users/segiddins/following{/other_user}","gists_url":"https://api.github.com/users/segiddins/gists{/gist_id}","starred_url":"https://api.github.com/users/segiddins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/segiddins/subscriptions","organizations_url":"https://api.github.com/users/segiddins/orgs","repos_url":"https://api.github.com/users/segiddins/repos","events_url":"https://api.github.com/users/segiddins/events{/privacy}","received_events_url":"https://api.github.com/users/segiddins/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T23:39:07Z","updated_at":"2015-08-10T23:39:07Z","body":"This was fixed by https://github.com/realm/realm-cocoa/pull/2373."}}