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 failure when using Set::clear/List::clear with Mixed holding an object #4774

Closed
nirinchev opened this issue Jun 22, 2021 · 8 comments
Assignees

Comments

@nirinchev
Copy link
Member

nirinchev commented Jun 22, 2021

SDK and version

SDK : .NET
Core version: 11.0.3

Observations

  • The .NET tests consistently crash with an assertion failure on macOS (interestingly enough, I haven't seen this on Windows/Linux, but I haven't looked very deeply into it).
  • Happens only for Set/List on the same test input - Mixed{True} and Mixed{Object}

The test opens 2 realms with 2 different users and performs the following:

  1. realm1 creates a container object
  2. realm2 waits for sync and looks up the container object
  3. obj1.List.Add(True)
  4. obj2.List.Add(new IntPropertyObject)
  5. obj2.List.Remove(obj2.List[0])
  6. obj1.List.Clear() - commenting that out resolves the crashes for both List and Set.

Between the steps we wait for changes from the reciprocal list and verify that obj1.List and obj2.List are equivalent.

Crash log / stacktrace

Crash log for the list case:

libc++abi: terminating with uncaught exception of type realm::LogicError: Instantiating a collection object not matching column type
Exception backtrace:
0   librealm-wrappers.dylib             0x000000019b0f05b5 _ZN5realm4util6detail26ExceptionWithBacktraceBaseC2Ev + 53
1   librealm-wrappers.dylib             0x000000019b0fc101 _ZN5realm4util22ExceptionWithBacktraceISt9exceptionEC2IJEEEDpOT_ + 49
2   librealm-wrappers.dylib             0x000000019b0fc0a2 _ZN5realm10LogicErrorC2ENS0_9ErrorKindE + 34
3   librealm-wrappers.dylib             0x000000019b0fc01b _ZN5realm10LogicErrorC1ENS0_9ErrorKindE + 27
4   librealm-wrappers.dylib             0x000000019bad9237 _ZN5realm17check_column_typeINS_6ObjKeyEEEvNS_6ColKeyE + 183
5   librealm-wrappers.dylib             0x000000019bb54338 _ZN5realm3LstINS_6ObjKeyEEC2ERKNS_3ObjENS_6ColKeyE + 344
6   librealm-wrappers.dylib             0x000000019bb545e5 _ZN5realm3LstINS_6ObjKeyEEC1ERKNS_3ObjENS_6ColKeyE + 37
7   librealm-wrappers.dylib             0x000000019bbeda33 _ZNK5realm3Obj8get_listINS_6ObjKeyEEENS_3LstIT_EENS_6ColKeyE + 51
8   librealm-wrappers.dylib             0x000000019bc231ea _ZZN5realm3Obj23assign_pk_and_backlinksERKS0_ENK3$_9clENS_6ColKeyE + 3066
9   librealm-wrappers.dylib             0x000000019bc00600 _ZNK5realm5Table24for_each_backlink_columnIZNS_3Obj23assign_pk_and_backlinksERKS2_E3$_9EEbT_ + 192
10  librealm-wrappers.dylib             0x000000019bc00528 _ZN5realm3Obj23assign_pk_and_backlinksERKS0_ + 536
11  librealm-wrappers.dylib             0x000000019bddf1ae _ZN5realm5Table17invalidate_objectENS_6ObjKeyE + 1534
12  librealm-wrappers.dylib             0x000000019bbeb368 _ZN5realm3Obj10invalidateEv + 72
13  librealm-wrappers.dylib             0x000000019b85a2eb _ZN5realm4sync18InstructionApplierclERKNS0_5instr11EraseObjectE + 123
14  librealm-wrappers.dylib             0x000000019b8ce019 _ZNK5realm4sync11Instruction5visitIRNS0_18InstructionApplierEEEDcOT_ + 441
15  librealm-wrappers.dylib             0x000000019b8cde13 _ZN5realm4sync18InstructionApplier5applyIS1_EEvRT_RKNS0_9ChangesetEPNS_4util6LoggerE + 147
16  librealm-wrappers.dylib             0x000000019b8c6bf5 _ZN5realm4sync18InstructionApplier5applyERKNS0_9ChangesetEPNS_4util6LoggerE + 37
17  librealm-wrappers.dylib             0x000000019b8c5d06 _ZN5realm5_impl17ClientHistoryImpl27integrate_server_changesetsERKNS_4sync12SyncProgressEPKyPKNS2_11Transformer15RemoteChangesetEmRNS2_11VersionInfoERNS2_21ClientReplicationBase16IntegrationErrorERNS_4util6LoggerEPNSE_20SyncTransactReporterE + 2246
18  librealm-wrappers.dylib             0x000000019b8f1860 _ZN5realm5_impl14ClientImplBase7Session20integrate_changesetsERNS_4sync21ClientReplicationBaseERKNS3_12SyncProgressEyRKNSt3__16vectorINS3_11Transformer15RemoteChangesetENS9_9allocatorISC_EEEERNS3_11VersionInfoERNS4_16IntegrationErrorE + 240
19  librealm-wrappers.dylib             0x000000019b8f1fde _ZN5realm5_impl14ClientImplBase7Session29initiate_integrate_changesetsEyRKNSt3__16vectorINS_4sync11Transformer15RemoteChangesetENS3_9allocatorIS7_EEEE + 142
20  librealm-wrappers.dylib             0x000000019b8409b5 _ZN12_GLOBAL__N_111SessionImpl29initiate_integrate_changesetsEyRKNSt3__16vectorIN5realm4sync11Transformer15RemoteChangesetENS1_9allocatorIS6_EEEE + 117
21  librealm-wrappers.dylib             0x000000019b8f080d _ZN5realm5_impl14ClientImplBase7Session24receive_download_messageERKNS_4sync12SyncProgressEyRKNSt3__16vectorINS3_11Transformer15RemoteChangesetENS7_9allocatorISA_EEEE + 1469
22  librealm-wrappers.dylib             0x000000019b8f0241 _ZN5realm5_impl14ClientImplBase10Connection24receive_download_messageEyRKNS_4sync12SyncProgressEyRKNSt3__16vectorINS3_11Transformer15RemoteChangesetENS7_9allocatorISA_EEEE + 177
23  librealm-wrappers.dylib             0x000000019b8ebab1 _ZN5realm5_impl14ClientProtocol22parse_message_receivedINS0_14ClientImplBase10ConnectionEEEvRT_PKcm + 4625
24  librealm-wrappers.dylib             0x000000019b8e4e68 _ZN5realm5_impl14ClientImplBase10Connection23handle_message_receivedEPKcm + 56
25  librealm-wrappers.dylib             0x000000019b8e4d4a _ZN5realm5_impl14ClientImplBase10Connection33websocket_binary_message_receivedEPKcm + 138
26  librealm-wrappers.dylib             0x000000019bebd6cb _ZN12_GLOBAL__N_19WebSocket17frame_reader_loopEv + 283
27  librealm-wrappers.dylib             0x000000019bec1064 _ZZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvENKUlNSt3__110error_codeEmE_clES2_m + 196
28  librealm-wrappers.dylib             0x000000019bec0f85 _ZNSt3__1L8__invokeIRZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvEUlNS_10error_codeEmE_JS3_mEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOS6_DpOS7_ + 85
29  librealm-wrappers.dylib             0x000000019bec0f07 _ZNSt3__128__invoke_void_return_wrapperIvE6__callIJRZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvEUlNS_10error_codeEmE_S5_mEEEvDpOT_ + 71
30  librealm-wrappers.dylib             0x000000019bec0eb7 _ZNSt3__110__function12__alloc_funcIZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvEUlNS_10error_codeEmE_NS_9allocatorIS5_EEFvS4_mEEclEOS4_Om + 71
31  librealm-wrappers.dylib             0x000000019bebfc28 _ZNSt3__110__function6__funcIZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvEUlNS_10error_codeEmE_NS_9allocatorIS5_EEFvS4_mEEclEOS4_Om + 72
32  librealm-wrappers.dylib             0x000000019b905b2a _ZNKSt3__110__function12__value_funcIFvNS_10error_codeEmEEclEOS2_Om + 106
33  librealm-wrappers.dylib             0x000000019b905a98 _ZNKSt3__18functionIFvNS_10error_codeEmEEclES1_m + 72
34  librealm-wrappers.dylib             0x000000019b905a1c _ZN5realm4util7network7Service9AsyncOper29do_recycle_and_execute_helperINSt3__18functionIFvNS5_10error_codeEmEEEJS7_mEEEvbRbT_DpT0_ + 124
35  librealm-wrappers.dylib             0x000000019b9058d2 _ZN5realm4util7network7Service9AsyncOper22do_recycle_and_executeINSt3__18functionIFvNS5_10error_codeEmEEEJRS7_RmEEEvbRT_DpOT0_ + 194
36  librealm-wrappers.dylib             0x000000019b907621 _ZN5realm4util7network7Service14BasicStreamOpsINS1_6SocketEE16BufferedReadOperINSt3__18functionIFvNS7_10error_codeEmEEEE19recycle_and_executeEv + 689
37  librealm-wrappers.dylib             0x000000019b9ed07d _ZN5realm4util7network7Service4Impl7executeERNSt3__110unique_ptrINS2_9AsyncOperENS2_18LendersOperDeleterEEE + 29
38  librealm-wrappers.dylib             0x000000019b9e7b25 _ZN5realm4util7network7Service4Impl3runEv + 325
39  librealm-wrappers.dylib             0x000000019b9e79ad _ZN5realm4util7network7Service3runEv + 29
40  librealm-wrappers.dylib             0x000000019b84794e _ZN5realm5_impl14ClientImplBase3runEv + 30
41  librealm-wrappers.dylib             0x000000019b82ac90 _ZN12_GLOBAL__N_110ClientImpl3runEv + 64
42  librealm-wrappers.dylib             0x000000019b82ac1d _ZN5realm4sync6Client3runEv + 29
43  librealm-wrappers.dylib             0x000000019b6453c6 _ZZN5realm5_impl10SyncClientC1ENSt3__110unique_ptrINS_4util6LoggerENS2_14default_deleteIS5_EEEERKNS_16SyncClientConfigENS2_10shared_ptrIKNS_11SyncManagerEEEENKUlvE0_clEv + 246
44  librealm-wrappers.dylib             0x000000019b64527d _ZNSt3__1L8__invokeIZN5realm5_impl10SyncClientC1ENS_10unique_ptrINS1_4util6LoggerENS_14default_deleteIS6_EEEERKNS1_16SyncClientConfigENS_10shared_ptrIKNS1_11SyncManagerEEEEUlvE0_JEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOSI_DpOSJ_ + 29
45  librealm-wrappers.dylib             0x000000019b6451e5 _ZNSt3__1L16__thread_executeINS_10unique_ptrINS_15__thread_structENS_14default_deleteIS2_EEEEZN5realm5_impl10SyncClientC1ENS1_INS6_4util6LoggerENS3_ISA_EEEERKNS6_16SyncClientConfigENS_10shared_ptrIKNS6_11SyncManagerEEEEUlvE0_JEJEEEvRNS_5tupleIJT_T0_DpT1_EEENS_15__tuple_indicesIJXspT2_EEEE + 37
46  librealm-wrappers.dylib             0x000000019b644a36 _ZNSt3__1L14__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEZN5realm5_impl10SyncClientC1ENS2_INS7_4util6LoggerENS4_ISB_EEEERKNS7_16SyncClientConfigENS_10shared_ptrIKNS7_11SyncManagerEEEEUlvE0_EEEEEPvSN_ + 118
47  libsystem_pthread.dylib             0x00007fff2055c954 _pthread_start + 224
48  libsystem_pthread.dylib             0x00007fff205584a7 thread_start + 15

Crash log for the Set case:

/Users/nikolairinchev/work/dotnet/wrappers/realm-core/src/realm/obj.cpp:1829: [realm-core-11.0.3] Assertion failed: ndx != realm::npos
0   librealm-wrappers.dylib             0x00000001abdbf07f _ZN5realm4utilL18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 31
1   librealm-wrappers.dylib             0x00000001abdbf313 _ZN5realm4util9terminateEPKcS2_lOSt16initializer_listINS0_9PrintableEE + 243
2   librealm-wrappers.dylib             0x00000001abb1a9df _ZN5realm12_GLOBAL__N_111nullify_setINS_5MixedEEEvRNS_3ObjENS_6ColKeyET_ + 207
3   librealm-wrappers.dylib             0x00000001abb19383 _ZN5realm3Obj12nullify_linkENS_6ColKeyENS_7ObjLinkE + 1107
4   librealm-wrappers.dylib             0x00000001ab97081c _ZN5realm12CascadeState25enqueue_for_nullificationERNS_5TableENS_6ColKeyENS_6ObjKeyENS_7ObjLinkE + 156
5   librealm-wrappers.dylib             0x00000001ab9705e3 _ZN5realm13ArrayBacklink17nullify_fwd_linksEmRNS_12CascadeStateE + 675
6   librealm-wrappers.dylib             0x00000001ab9cc8f3 _ZZN5realm7Cluster22nullify_incoming_linksENS_6ObjKeyERNS_12CascadeStateEENK3$_6clENS_6ColKeyE + 291
7   librealm-wrappers.dylib             0x00000001ab9b03b0 _ZNK5realm5Table24for_each_backlink_columnIZNS_7Cluster22nullify_incoming_linksENS_6ObjKeyERNS_12CascadeStateEE3$_6EEbT_ + 192
8   librealm-wrappers.dylib             0x00000001ab9b02df _ZN5realm7Cluster22nullify_incoming_linksENS_6ObjKeyERNS_12CascadeStateE + 175
9   librealm-wrappers.dylib             0x00000001ab9d2a3f _ZN5realm11ClusterTree13nullify_linksENS_6ObjKeyERNS_12CascadeStateE + 159
10  librealm-wrappers.dylib             0x00000001abcfaa93 _ZN5realm5Table13remove_objectENS_6ObjKeyE + 323
11  librealm-wrappers.dylib             0x00000001abcfb1d6 _ZN5realm5Table17invalidate_objectENS_6ObjKeyE + 1574
12  librealm-wrappers.dylib             0x00000001abb07368 _ZN5realm3Obj10invalidateEv + 72
13  librealm-wrappers.dylib             0x00000001ab7762eb _ZN5realm4sync18InstructionApplierclERKNS0_5instr11EraseObjectE + 123
14  librealm-wrappers.dylib             0x00000001ab7ea019 _ZNK5realm4sync11Instruction5visitIRNS0_18InstructionApplierEEEDcOT_ + 441
15  librealm-wrappers.dylib             0x00000001ab7e9e13 _ZN5realm4sync18InstructionApplier5applyIS1_EEvRT_RKNS0_9ChangesetEPNS_4util6LoggerE + 147
16  librealm-wrappers.dylib             0x00000001ab7e2bf5 _ZN5realm4sync18InstructionApplier5applyERKNS0_9ChangesetEPNS_4util6LoggerE + 37
17  librealm-wrappers.dylib             0x00000001ab7e1d06 _ZN5realm5_impl17ClientHistoryImpl27integrate_server_changesetsERKNS_4sync12SyncProgressEPKyPKNS2_11Transformer15RemoteChangesetEmRNS2_11VersionInfoERNS2_21ClientReplicationBase16IntegrationErrorERNS_4util6LoggerEPNSE_20SyncTransactReporterE + 2246
18  librealm-wrappers.dylib             0x00000001ab80d860 _ZN5realm5_impl14ClientImplBase7Session20integrate_changesetsERNS_4sync21ClientReplicationBaseERKNS3_12SyncProgressEyRKNSt3__16vectorINS3_11Transformer15RemoteChangesetENS9_9allocatorISC_EEEERNS3_11VersionInfoERNS4_16IntegrationErrorE + 240
19  librealm-wrappers.dylib             0x00000001ab80dfde _ZN5realm5_impl14ClientImplBase7Session29initiate_integrate_changesetsEyRKNSt3__16vectorINS_4sync11Transformer15RemoteChangesetENS3_9allocatorIS7_EEEE + 142
20  librealm-wrappers.dylib             0x00000001ab75c9b5 _ZN12_GLOBAL__N_111SessionImpl29initiate_integrate_changesetsEyRKNSt3__16vectorIN5realm4sync11Transformer15RemoteChangesetENS1_9allocatorIS6_EEEE + 117
21  librealm-wrappers.dylib             0x00000001ab80c80d _ZN5realm5_impl14ClientImplBase7Session24receive_download_messageERKNS_4sync12SyncProgressEyRKNSt3__16vectorINS3_11Transformer15RemoteChangesetENS7_9allocatorISA_EEEE + 1469
22  librealm-wrappers.dylib             0x00000001ab80c241 _ZN5realm5_impl14ClientImplBase10Connection24receive_download_messageEyRKNS_4sync12SyncProgressEyRKNSt3__16vectorINS3_11Transformer15RemoteChangesetENS7_9allocatorISA_EEEE + 177
23  librealm-wrappers.dylib             0x00000001ab807ab1 _ZN5realm5_impl14ClientProtocol22parse_message_receivedINS0_14ClientImplBase10ConnectionEEEvRT_PKcm + 4625
24  librealm-wrappers.dylib             0x00000001ab800e68 _ZN5realm5_impl14ClientImplBase10Connection23handle_message_receivedEPKcm + 56
25  librealm-wrappers.dylib             0x00000001ab800d4a _ZN5realm5_impl14ClientImplBase10Connection33websocket_binary_message_receivedEPKcm + 138
26  librealm-wrappers.dylib             0x00000001abdd96cb _ZN12_GLOBAL__N_19WebSocket17frame_reader_loopEv + 283
27  librealm-wrappers.dylib             0x00000001abddd064 _ZZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvENKUlNSt3__110error_codeEmE_clES2_m + 196
28  librealm-wrappers.dylib             0x00000001abddcf85 _ZNSt3__1L8__invokeIRZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvEUlNS_10error_codeEmE_JS3_mEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOS6_DpOS7_ + 85
29  librealm-wrappers.dylib             0x00000001abddcf07 _ZNSt3__128__invoke_void_return_wrapperIvE6__callIJRZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvEUlNS_10error_codeEmE_S5_mEEEvDpOT_ + 71
30  librealm-wrappers.dylib             0x00000001abddceb7 _ZNSt3__110__function12__alloc_funcIZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvEUlNS_10error_codeEmE_NS_9allocatorIS5_EEFvS4_mEEclEOS4_Om + 71
31  librealm-wrappers.dylib             0x00000001abddbc28 _ZNSt3__110__function6__funcIZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvEUlNS_10error_codeEmE_NS_9allocatorIS5_EEFvS4_mEEclEOS4_Om + 72
32  librealm-wrappers.dylib             0x00000001ab821b2a _ZNKSt3__110__function12__value_funcIFvNS_10error_codeEmEEclEOS2_Om + 106
33  librealm-wrappers.dylib             0x00000001ab821a98 _ZNKSt3__18functionIFvNS_10error_codeEmEEclES1_m + 72
34  librealm-wrappers.dylib             0x00000001ab821a1c _ZN5realm4util7network7Service9AsyncOper29do_recycle_and_execute_helperINSt3__18functionIFvNS5_10error_codeEmEEEJS7_mEEEvbRbT_DpT0_ + 124
35  librealm-wrappers.dylib             0x00000001ab8218d2 _ZN5realm4util7network7Service9AsyncOper22do_recycle_and_executeINSt3__18functionIFvNS5_10error_codeEmEEEJRS7_RmEEEvbRT_DpOT0_ + 194
36  librealm-wrappers.dylib             0x00000001ab823621 _ZN5realm4util7network7Service14BasicStreamOpsINS1_6SocketEE16BufferedReadOperINSt3__18functionIFvNS7_10error_codeEmEEEE19recycle_and_executeEv + 689
37  librealm-wrappers.dylib             0x00000001ab90907d _ZN5realm4util7network7Service4Impl7executeERNSt3__110unique_ptrINS2_9AsyncOperENS2_18LendersOperDeleterEEE + 29
38  librealm-wrappers.dylib             0x00000001ab903b25 _ZN5realm4util7network7Service4Impl3runEv + 325
39  librealm-wrappers.dylib             0x00000001ab9039ad _ZN5realm4util7network7Service3runEv + 29
40  librealm-wrappers.dylib             0x00000001ab76394e _ZN5realm5_impl14ClientImplBase3runEv + 30
41  librealm-wrappers.dylib             0x00000001ab746c90 _ZN12_GLOBAL__N_110ClientImpl3runEv + 64
42  librealm-wrappers.dylib             0x00000001ab746c1d _ZN5realm4sync6Client3runEv + 29
43  librealm-wrappers.dylib             0x00000001ab5613c6 _ZZN5realm5_impl10SyncClientC1ENSt3__110unique_ptrINS_4util6LoggerENS2_14default_deleteIS5_EEEERKNS_16SyncClientConfigENS2_10shared_ptrIKNS_11SyncManagerEEEENKUlvE0_clEv + 246
44  librealm-wrappers.dylib             0x00000001ab56127d _ZNSt3__1L8__invokeIZN5realm5_impl10SyncClientC1ENS_10unique_ptrINS1_4util6LoggerENS_14default_deleteIS6_EEEERKNS1_16SyncClientConfigENS_10shared_ptrIKNS1_11SyncManagerEEEEUlvE0_JEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOSI_DpOSJ_ + 29
45  librealm-wrappers.dylib             0x00000001ab5611e5 _ZNSt3__1L16__thread_executeINS_10unique_ptrINS_15__thread_structENS_14default_deleteIS2_EEEEZN5realm5_impl10SyncClientC1ENS1_INS6_4util6LoggerENS3_ISA_EEEERKNS6_16SyncClientConfigENS_10shared_ptrIKNS6_11SyncManagerEEEEUlvE0_JEJEEEvRNS_5tupleIJT_T0_DpT1_EEENS_15__tuple_indicesIJXspT2_EEEE + 37
46  librealm-wrappers.dylib             0x00000001ab560a36 _ZNSt3__1L14__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEZN5realm5_impl10SyncClientC1ENS2_INS7_4util6LoggerENS4_ISB_EEEERKNS7_16SyncClientConfigENS_10shared_ptrIKNS7_11SyncManagerEEEEUlvE0_EEEEEPvSN_ + 118
47  libsystem_pthread.dylib             0x00007fff2055c954 _pthread_start + 224
48  libsystem_pthread.dylib             0x00007fff205584a7 thread_start + 15!!! IMPORTANT: Please report this at https://github.com/realm/realm-core/issues/new/choose
@nirinchev
Copy link
Member Author

This might be related to #4724.

@ironage
Copy link
Contributor

ironage commented Jun 23, 2021

@nirinchev this is likely fixed by #4770
Are you able to test against the latest v11 or do you need a release for that?

@nirinchev
Copy link
Member Author

I can test against latest v11 - I'll update this tomorrow.

@ironage
Copy link
Contributor

ironage commented Jun 23, 2021

Great, thanks! I would at least expect the List to be fixed, but grant that the Set might be something totally different. Either way, it would be helpful to know if anything is fixed on the latest to make sure we're tracking down the right thing.

@nirinchev
Copy link
Member Author

With the latest Core v11, I get this for the List which appears similar to the original Set issue.

/Users/nikolairinchev/work/dotnet/wrappers/realm-core/src/realm/obj.cpp:2157: [realm-core-11.0.3] Assertion failed: n != realm::npos
0   librealm-wrappers.dylib             0x00000001a88b2fcf _ZN5realm4utilL18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 31
1   librealm-wrappers.dylib             0x00000001a88b3263 _ZN5realm4util9terminateEPKcS2_lOSt16initializer_listINS0_9PrintableEE + 243
2   librealm-wrappers.dylib             0x00000001a8632ee8 _ZZN5realm3Obj23assign_pk_and_backlinksERKS0_ENK3$_9clENS_6ColKeyE + 3416
3   librealm-wrappers.dylib             0x00000001a86101a0 _ZNK5realm5Table24for_each_backlink_columnIZNS_3Obj23assign_pk_and_backlinksERKS2_E3$_9EEbT_ + 192
4   librealm-wrappers.dylib             0x00000001a86100c8 _ZN5realm3Obj23assign_pk_and_backlinksERKS0_ + 536
5   librealm-wrappers.dylib             0x00000001a87ef0fe _ZN5realm5Table17invalidate_objectENS_6ObjKeyE + 1534
6   librealm-wrappers.dylib             0x00000001a85faf08 _ZN5realm3Obj10invalidateEv + 72
7   librealm-wrappers.dylib             0x00000001a8269e8b _ZN5realm4sync18InstructionApplierclERKNS0_5instr11EraseObjectE + 123
8   librealm-wrappers.dylib             0x00000001a82ddbb9 _ZNK5realm4sync11Instruction5visitIRNS0_18InstructionApplierEEEDcOT_ + 441
9   librealm-wrappers.dylib             0x00000001a82dd9b3 _ZN5realm4sync18InstructionApplier5applyIS1_EEvRT_RKNS0_9ChangesetEPNS_4util6LoggerE + 147
10  librealm-wrappers.dylib             0x00000001a82d6795 _ZN5realm4sync18InstructionApplier5applyERKNS0_9ChangesetEPNS_4util6LoggerE + 37
11  librealm-wrappers.dylib             0x00000001a82d58a6 _ZN5realm5_impl17ClientHistoryImpl27integrate_server_changesetsERKNS_4sync12SyncProgressEPKyPKNS2_11Transformer15RemoteChangesetEmRNS2_11VersionInfoERNS2_21ClientReplicationBase16IntegrationErrorERNS_4util6LoggerEPNSE_20SyncTransactReporterE + 2246
12  librealm-wrappers.dylib             0x00000001a8301400 _ZN5realm5_impl14ClientImplBase7Session20integrate_changesetsERNS_4sync21ClientReplicationBaseERKNS3_12SyncProgressEyRKNSt3__16vectorINS3_11Transformer15RemoteChangesetENS9_9allocatorISC_EEEERNS3_11VersionInfoERNS4_16IntegrationErrorE + 240
13  librealm-wrappers.dylib             0x00000001a8301b7e _ZN5realm5_impl14ClientImplBase7Session29initiate_integrate_changesetsEyRKNSt3__16vectorINS_4sync11Transformer15RemoteChangesetENS3_9allocatorIS7_EEEE + 142
14  librealm-wrappers.dylib             0x00000001a8250555 _ZN12_GLOBAL__N_111SessionImpl29initiate_integrate_changesetsEyRKNSt3__16vectorIN5realm4sync11Transformer15RemoteChangesetENS1_9allocatorIS6_EEEE + 117
15  librealm-wrappers.dylib             0x00000001a83003ad _ZN5realm5_impl14ClientImplBase7Session24receive_download_messageERKNS_4sync12SyncProgressEyRKNSt3__16vectorINS3_11Transformer15RemoteChangesetENS7_9allocatorISA_EEEE + 1469
16  librealm-wrappers.dylib             0x00000001a82ffde1 _ZN5realm5_impl14ClientImplBase10Connection24receive_download_messageEyRKNS_4sync12SyncProgressEyRKNSt3__16vectorINS3_11Transformer15RemoteChangesetENS7_9allocatorISA_EEEE + 177
17  librealm-wrappers.dylib             0x00000001a82fb651 _ZN5realm5_impl14ClientProtocol22parse_message_receivedINS0_14ClientImplBase10ConnectionEEEvRT_PKcm + 4625
18  librealm-wrappers.dylib             0x00000001a82f4a08 _ZN5realm5_impl14ClientImplBase10Connection23handle_message_receivedEPKcm + 56
19  librealm-wrappers.dylib             0x00000001a82f48ea _ZN5realm5_impl14ClientImplBase10Connection33websocket_binary_message_receivedEPKcm + 138
20  librealm-wrappers.dylib             0x00000001a88cd61b _ZN12_GLOBAL__N_19WebSocket17frame_reader_loopEv + 283
21  librealm-wrappers.dylib             0x00000001a88d0fb4 _ZZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvENKUlNSt3__110error_codeEmE_clES2_m + 196
22  librealm-wrappers.dylib             0x00000001a88d0ed5 _ZNSt3__1L8__invokeIRZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvEUlNS_10error_codeEmE_JS3_mEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOS6_DpOS7_ + 85
23  librealm-wrappers.dylib             0x00000001a88d0e57 _ZNSt3__128__invoke_void_return_wrapperIvE6__callIJRZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvEUlNS_10error_codeEmE_S5_mEEEvDpOT_ + 71
24  librealm-wrappers.dylib             0x00000001a88d0e07 _ZNSt3__110__function12__alloc_funcIZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvEUlNS_10error_codeEmE_NS_9allocatorIS5_EEFvS4_mEEclEOS4_Om + 71
25  librealm-wrappers.dylib             0x00000001a88cfb78 _ZNSt3__110__function6__funcIZN12_GLOBAL__N_19WebSocket17frame_reader_loopEvEUlNS_10error_codeEmE_NS_9allocatorIS5_EEFvS4_mEEclEOS4_Om + 72
26  librealm-wrappers.dylib             0x00000001a83156ca _ZNKSt3__110__function12__value_funcIFvNS_10error_codeEmEEclEOS2_Om + 106
27  librealm-wrappers.dylib             0x00000001a8315638 _ZNKSt3__18functionIFvNS_10error_codeEmEEclES1_m + 72
28  librealm-wrappers.dylib             0x00000001a83155bc _ZN5realm4util7network7Service9AsyncOper29do_recycle_and_execute_helperINSt3__18functionIFvNS5_10error_codeEmEEEJS7_mEEEvbRbT_DpT0_ + 124
29  librealm-wrappers.dylib             0x00000001a8315472 _ZN5realm4util7network7Service9AsyncOper22do_recycle_and_executeINSt3__18functionIFvNS5_10error_codeEmEEEJRS7_RmEEEvbRT_DpOT0_ + 194
30  librealm-wrappers.dylib             0x00000001a83171c1 _ZN5realm4util7network7Service14BasicStreamOpsINS1_6SocketEE16BufferedReadOperINSt3__18functionIFvNS7_10error_codeEmEEEE19recycle_and_executeEv + 689
31  librealm-wrappers.dylib             0x00000001a83fcc1d _ZN5realm4util7network7Service4Impl7executeERNSt3__110unique_ptrINS2_9AsyncOperENS2_18LendersOperDeleterEEE + 29
32  librealm-wrappers.dylib             0x00000001a83f76c5 _ZN5realm4util7network7Service4Impl3runEv + 325
33  librealm-wrappers.dylib             0x00000001a83f754d _ZN5realm4util7network7Service3runEv + 29
34  librealm-wrappers.dylib             0x00000001a82574ee _ZN5realm5_impl14ClientImplBase3runEv + 30
35  librealm-wrappers.dylib             0x00000001a823a830 _ZN12_GLOBAL__N_110ClientImpl3runEv + 64
36  librealm-wrappers.dylib             0x00000001a823a7bd _ZN5realm4sync6Client3runEv + 29
37  librealm-wrappers.dylib             0x00000001a8054f66 _ZZN5realm5_impl10SyncClientC1ENSt3__110unique_ptrINS_4util6LoggerENS2_14default_deleteIS5_EEEERKNS_16SyncClientConfigENS2_10shared_ptrIKNS_11SyncManagerEEEENKUlvE0_clEv + 246
38  librealm-wrappers.dylib             0x00000001a8054e1d _ZNSt3__1L8__invokeIZN5realm5_impl10SyncClientC1ENS_10unique_ptrINS1_4util6LoggerENS_14default_deleteIS6_EEEERKNS1_16SyncClientConfigENS_10shared_ptrIKNS1_11SyncManagerEEEEUlvE0_JEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOSI_DpOSJ_ + 29
39  librealm-wrappers.dylib             0x00000001a8054d85 _ZNSt3__1L16__thread_executeINS_10unique_ptrINS_15__thread_structENS_14default_deleteIS2_EEEEZN5realm5_impl10SyncClientC1ENS1_INS6_4util6LoggerENS3_ISA_EEEERKNS6_16SyncClientConfigENS_10shared_ptrIKNS6_11SyncManagerEEEEUlvE0_JEJEEEvRNS_5tupleIJT_T0_DpT1_EEENS_15__tuple_indicesIJXspT2_EEEE + 37
40  librealm-wrappers.dylib             0x00000001a80545d6 _ZNSt3__1L14__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEZN5realm5_impl10SyncClientC1ENS2_INS7_4util6LoggerENS4_ISB_EEEERKNS7_16SyncClientConfigENS_10shared_ptrIKNS7_11SyncManagerEEEEUlvE0_EEEEEPvSN_ + 118
41  libsystem_pthread.dylib             0x00007fff2055c954 _pthread_start + 224
42  libsystem_pthread.dylib             0x00007fff205584a7 thread_start + 15!!! IMPORTANT: Please report this at https://github.com/realm/realm-core/issues/new/choose

@ironage
Copy link
Contributor

ironage commented Jun 23, 2021

possibly related to realm/realm-swift#7305

@nirinchev
Copy link
Member Author

Simpler repro without sync:

var item = new IntPropertyObject { Int = 10 };

var realm = GetRealm(new RealmConfiguration(Guid.NewGuid().ToString()));
var container = realm.Write(() =>
{
    return realm.Add(new SyncCollectionsObject());
});

realm.Write(() =>
{
    // RealmValueList is List<Mixed> property
    container.RealmValueList.Add(item);
});

realm.Write(() =>
{
    container.RealmValueList.Clear();
});

realm.Write(() =>
{
    realm.Remove(item);
});

Here's the crash stack:

    Where: test=~Test2

=> Realms.Tests.Sync.DataTypeSynchronizationTests.Test2
/Users/nikolairinchev/work/dotnet/wrappers/realm-core/src/realm/obj.cpp:1806: [realm-core-11.0.3] Assertion failed: ndx != realm::npos
0   librealm-wrappers.dylib             0x00000001ae5befcf _ZN5realm4utilL18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 31
1   librealm-wrappers.dylib             0x00000001ae5bf263 _ZN5realm4util9terminateEPKcS2_lOSt16initializer_listINS0_9PrintableEE + 243
2   librealm-wrappers.dylib             0x00000001ae319f4f _ZN5realm12_GLOBAL__N_116nullify_linklistINS_5MixedEEEvRNS_3ObjENS_6ColKeyET_ + 207
3   librealm-wrappers.dylib             0x00000001ae318d01 _ZN5realm3Obj12nullify_linkENS_6ColKeyENS_7ObjLinkE + 561
4   librealm-wrappers.dylib             0x00000001ae1703bc _ZN5realm12CascadeState25enqueue_for_nullificationERNS_5TableENS_6ColKeyENS_6ObjKeyENS_7ObjLinkE + 156
5   librealm-wrappers.dylib             0x00000001ae170183 _ZN5realm13ArrayBacklink17nullify_fwd_linksEmRNS_12CascadeStateE + 675
6   librealm-wrappers.dylib             0x00000001ae1cc493 _ZZN5realm7Cluster22nullify_incoming_linksENS_6ObjKeyERNS_12CascadeStateEENK3$_6clENS_6ColKeyE + 291
7   librealm-wrappers.dylib             0x00000001ae1aff50 _ZNK5realm5Table24for_each_backlink_columnIZNS_7Cluster22nullify_incoming_linksENS_6ObjKeyERNS_12CascadeStateEE3$_6EEbT_ + 192
8   librealm-wrappers.dylib             0x00000001ae1afe7f _ZN5realm7Cluster22nullify_incoming_linksENS_6ObjKeyERNS_12CascadeStateE + 175
9   librealm-wrappers.dylib             0x00000001ae1d25df _ZN5realm11ClusterTree13nullify_linksENS_6ObjKeyERNS_12CascadeStateE + 159
10  librealm-wrappers.dylib             0x00000001ae4fa9e3 _ZN5realm5Table13remove_objectENS_6ObjKeyE + 323
11  librealm-wrappers.dylib             0x00000001ad8a6a15 _ZZ13object_removeENK4$_11clEv + 389
12  librealm-wrappers.dylib             0x00000001ad894c03 _ZN5realm13handle_errorsIZ13object_removeE4$_11EEDTclfp0_EERNS_15NativeException12MarshallableEOT_ + 35
13  librealm-wrappers.dylib             0x00000001ad894bd1 object_remove + 49
14  ???                                 0x000000011701661d 0x0 + 4680934941
15  ???                                 0x000000011701652d 0x0 + 4680934701
16  ???                                 0x00000001170164c1 0x0 + 4680934593
17  ???                                 0x00000001170163fa 0x0 + 4680934394
18  ???                                 0x00000001170148f7 0x0 + 4680927479
19  ???                                 0x000000011701480d 0x0 + 4680927245
20  ???                                 0x000000011701470c 0x0 + 4680926988
21  ???                                 0x0000000116f1aaa0 0x0 + 4679903904
22  libcoreclr.dylib                    0x000000010d90c45b CallDescrWorkerInternal + 124
23  libcoreclr.dylib                    0x000000010d7576b8 _Z26CallDescrWorkerWithHandlerP13CallDescrDatai + 104
24  libcoreclr.dylib                    0x000000010d81b7af _Z32CallDescrWorkerReflectionWrapperP13CallDescrDataP5Frame + 127
25  libcoreclr.dylib                    0x000000010d81c737 _ZN19RuntimeMethodHandle12InvokeMethodEP6ObjectP8PtrArrayP15SignatureNativebb + 3143
26  ???                                 0x0000000113f47aaa 0x0 + 4629756586
27  ???                                 0x0000000113f41e49 0x0 + 4629732937
28  ???                                 0x0000000116f18e84 0x0 + 4679896708
29  ???                                 0x0000000116f1a7e1 0x0 + 4679903201
30  ???                                 0x0000000116f1a77d 0x0 + 4679903101
31  ???                                 0x0000000116f1a6a7 0x0 + 4679902887
32  ???                                 0x0000000116f1a4d1 0x0 + 4679902417
33  ???                                 0x0000000116f1898d 0x0 + 4679895437
34  ???                                 0x0000000116f1889f 0x0 + 4679895199
35  ???                                 0x0000000116f18790 0x0 + 4679894928
36  ???                                 0x0000000116f17607 0x0 + 4679890439
37  ???                                 0x0000000116f126bf 0x0 + 4679870143
38  ???                                 0x0000000116f12488 0x0 + 4679869576
39  ???                                 0x0000000116f1051d 0x0 + 4679861533
40  ???                                 0x0000000116f14e97 0x0 + 4679880343
41  ???                                 0x0000000116f14814 0x0 + 4679878676
42  ???                                 0x0000000116f12f9e 0x0 + 4679872414
43  ???                                 0x0000000116f126bf 0x0 + 4679870143
44  ???                                 0x0000000116f12488 0x0 + 4679869576
45  ???                                 0x0000000116f119b2 0x0 + 4679866802
46  ???                                 0x0000000113eb5812 0x0 + 4629157906
47  ???                                 0x0000000113ebf0c1 0x0 + 4629196993
48  ???                                 0x0000000113eb592e 0x0 + 4629158190
49  libcoreclr.dylib                    0x000000010d90c45b CallDescrWorkerInternal + 124
50  libcoreclr.dylib                    0x000000010d758439 _ZN18MethodDescCallSite16CallTargetWorkerEPKmPmi + 1657
51  libcoreclr.dylib                    0x000000010d76ce2f _ZN12ThreadNative20KickOffThread_WorkerEPv + 431
52  libcoreclr.dylib                    0x000000010d719303 _ZL31ManagedThreadBase_DispatchOuterP22ManagedThreadCallState + 323
53  libcoreclr.dylib                    0x000000010d7198f0 _ZN17ManagedThreadBase7KickOffEPFvPvES0_ + 32
54  libcoreclr.dylib                    0x000000010d76d0cd _ZN12ThreadNative13KickOffThreadEPv + 397
55  libcoreclr.dylib                    0x000000010d590f04 _ZN7CorUnix10CPalThread11ThreadEntryEPv + 436
56  libsystem_pthread.dylib             0x00007fff204038fc _pthread_start + 224
57  libsystem_pthread.dylib             0x00007fff203ff443 thread_start + 15!!! IMPORTANT: Please report this at https://github.com/realm/realm-core/issues/new/choose

@jedelbo
Copy link
Contributor

jedelbo commented Jun 28, 2021

Fixed by #4785

@jedelbo jedelbo closed this as completed Jun 28, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants