realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.45k stars 1.75k forks source link

Realm crashes on addOrUpdateObject, but only in some environments #976

Closed eliasbagley closed 9 years ago

eliasbagley commented 9 years ago

Hey - I'm getting the following crash on Realm 0.91.1 Swift:

array.cpp:453: [realm-core-0.88.1] Assertion failed: ndx < m_size 0 Realm 0x000000010da6f566 _ZN7tightdb4util9terminateEPKcS2_l + 454 1 Realm 0x000000010da76f3f _ZN7tightdb5Array3setEmx + 399 2 Realm 0x000000010db05ad8 _ZN7tightdb6Column3setEmx + 296 3 Realm 0x000000010db09986 _ZN7tightdb14ColumnBackLink12add_backlinkEmm + 358 4 Realm 0x000000010db8e238 _ZN7tightdb5Table11do_set_linkEmmm + 216 5 Realm 0x000000010db8dec4 _ZN7tightdb5Table8set_linkEmmm + 388 6 Realm 0x000000010da2bd59 _ZL11RLMSetValueP13RLMObjectBasemS0_m + 518 7 Realm 0x000000010da2886c RLMDynamicSet + 1518 8 Realm 0x000000010da3c193 RLMAddObjectToRealm + 1674 9 Realm 0x000000010da5a72b -[RLMRealm addOrUpdateObject:] + 123 10 gobeios 0x00000001096a63ef _TFFC7gobeios16TeamQueueManagerP33_BBE8B5E29DC6908739F3885AAC76B01624queuedChallengesFromJSONFS0_FGVSs10DictionarySSPSs9AnyObjectGSaC6Models15QueuedChallenge_U_FGS1SSPS2S4_ + 607 11 gobeios 0x00000001096a656e _TTRXFo_oGVSs10DictionarySSPSs9AnyObject_oC6Models15QueuedChallenge_XFo_iGS_SSPS0__iS2 + 30 12 gobeios 0x00000001096a43a1 _TPATTRXFooGVSs10DictionarySSPSs9AnyObjectoC6Models15QueuedChallenge_XFo_iGS_SSPS0__iS2 + 81 13 libswiftCore.dylib 0x000000010ee942fc _TFVSs17MapCollectionViewg9subscriptFQQ5IndexQ0 + 172 14 libswiftCore.dylib 0x000000010ee94ce0 _TTWUSs14CollectionTypeUSs13GeneratorTypeSs16ForwardIndexType_Ss18_SignedIntegerType_Ss33_BuiltinIntegerLiteralConvertible__GVSs17MapCollectionViewQ_Q0S_SsFS_g9subscriptFQQPS_5IndexQQS5_9Generator7Element + 112 15 libswiftCore.dylib 0x000000010ee90f56 _TFVSs26LazyRandomAccessCollectiong9subscriptFQQ_5IndexQQQ_9Generator7Element + 86 16 libswiftCore.dylib 0x000000010ee91145 _TTWUSs14CollectionType_USs13GeneratorType__Ss21RandomAccessIndexType_Ss18_SignedIntegerType_Ss33_BuiltinIntegerLiteralConvertible_Ss16SignedNumberType_S3___GVSs26LazyRandomAccessCollectionQSs15_CollectionTypeSsFS6_g9subscriptFQQPS6_5IndexQS7_8_Element + 85 17 libswiftCore.dylib 0x000000010ee369df _TFSs34_copyCollectionToNativeArrayBufferUSs15_CollectionTypeSs14_Sequence_Type_USs13GeneratorType__Ss16ForwardIndexType_Ss18_SignedIntegerType_Ss33BuiltinIntegerLiteralConvertibleFQ_GVSs22_ContiguousArrayBufferQQ_8Element + 943 18 libswiftCore.dylib 0x000000010ee914f5 _TTWUSs14CollectionType_USs13GeneratorTypeSs21RandomAccessIndexType_Ss18_SignedIntegerType_Ss33_BuiltinIntegerLiteralConvertible_Ss16SignedNumberType_S3___GVSs26LazyRandomAccessCollectionQSs12SequenceTypeSsZFS6_oi2tgUS6US0__fMQPS6_FTS7_TVSs24CopyToNativeArrayBufferTGVSs22_ContiguousArrayBufferQQS79Generator7Element + 341 19 libswiftCore.dylib 0x000000010ee2b8ee _TFSa3mapUfGSaQUFFQdQ_GSaQ + 830 20 gobeios 0x00000001096a3545 _TFC7gobeios16TeamQueueManagerP33_BBE8B5E29DC6908739F3885AAC76B01624queuedChallengesFromJSONfS0_FGVSs10DictionarySSPSs9AnyObjectGSaC6Models15QueuedChallenge_ + 565 21 gobeios 0x00000001096a4ca6 _TFFC7gobeios16TeamQueueManager22getQueuedChallengeListFS0FTSi6paramsGSqGVSs10DictionarySSPSs9AnyObject10completionFT8responseOS_27QueuedChallengeListResponse_T__C9Alamofire7RequestU_FTCSo12NSURLRequestGSqCSo17NSHTTPURLResponseGSqPS2GSqCSo7NSErrorT_ + 998 22 gobeios 0x00000001096a286b _TPATFFC7gobeios16TeamQueueManager22getQueuedChallengeListFS0_FTSi6paramsGSqGVSs10DictionarySSPSs9AnyObject_10completionFT8responseOS_27QueuedChallengeListResponse_T__C9Alamofire7RequestU_FTCSo12NSURLRequestGSqCSo17NSHTTPURLResponseGSqPS2GSqCSo7NSErrorT_ + 123 23 Alamofire 0x000000010debfec0 _TFFFC9Alamofire7Request8responseFDS0_FT5queueGSqCSo8NSObject_10serializerFTCSo12NSURLRequestGSqCSo17NSHTTPURLResponse_GSqCSo6NSDataTGSqPSs9AnyObjectGSqCSo7NSError__17completionHandlerFTS2_GSqS3GSqPS5GSqS6TDS0_U_FT_T_U_FTT + 496 24 libdispatch.dylib 0x000000010f2fb186 _dispatch_call_block_and_release + 12 25 libdispatch.dylib 0x000000010f31a614 _dispatch_client_callout + 8 26 libdispatch.dylib 0x000000010f302a1c _dispatch_main_queue_callback_4CF + 1664 27 CoreFoundation 0x000000010e701229 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 28 CoreFoundation 0x000000010e6c2dfb CFRunLoopRun + 2043 29 CoreFoundation 0x000000010e6c2396 CFRunLoopRunSpecific + 470 30 GraphicsServices 0x00000001100b6a3e GSEventRunModal + 161 31 UIKit 0x000000010c1f1f10 UIApplicationMain + 1282 32 gobeios 0x00000001097c91f7 main + 135 33 libdyld.dylib 0x000000010f34f145 start + 1 IMPORTANT: if you see this error, please send this log to help@realm.io.

The strange part about this crash is that it only happens in my environment - it won't happen if I run the exact same code on a coworkers machine. The crash doesn't happen when I remove some properties from the model, but I don't think those properties I removed are the root cause, just somehow manifesting the bug.

My question is - what is a likely culprit for this to track it down, or is there a way I can get a more helpful error other than "ndx < m_size" ? I've tried updating the OS, Xcode, command line tools, Realm versions yet the problem persists so I'm not sure what in my environment could actually be affecting this. Thanks!

kneth commented 9 years ago

@eliasbagley You have posted the issue in the Realm for Java repository. The probability to get qualified help is much higher if you post it in the Realm for Cocoa repository ;-)

eliasbagley commented 9 years ago

thanks!