-
Notifications
You must be signed in to change notification settings - Fork 163
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
Got crash removing object #5975
Comments
Hello, thanks for reporting this. It seems like the object that was deleted was linked to another object, while we were deleting this relationship we ended up with a value different from what we expected.
|
it's iOS 16.02 I'm debuggin on my mac on iOS simulator. |
Ok I think I've figured out how it's happening. I'm capturing the collection of items in one async method and trying to remove some of the same items from another async method. If I do a simple remove operation without any async methods performing the same time the item is removed without any problem. |
Obviously, there is something in the async flow that is causing this. However, it seems to be triggered by the fact that you are trying to remove the same object from the same collection in 2different threads. I'll double-check if this is reproducible in core. |
SDK and version
.NET Xamarin
Version: 10.17.0
Observations
Saw it first time
Crash log / stacktrace
Users/runner/work/realm-dotnet/realm-dotnet/wrappers/realm-core/src/realm/array_backlink.cpp:108: [realm-core-12.9.0] Assertion failed: int64_t(value >> 1) == key.value [272, 16]
0 realm-wrappers 0x000000010e548ffc _ZN5realm4utilL18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 28
1 realm-wrappers 0x000000010e548f01 _ZN5realm4util9terminateEPKcS2_lOSt16initializer_listINS0_9PrintableEE + 385
2 realm-wrappers 0x000000010e42de77 ZN5realm4util9terminateIJxxEEEvPKcS3_lDpT + 55
3 realm-wrappers 0x000000010e3e1cb1 _ZN5realm13ArrayBacklink6removeEmNS_6ObjKeyE + 577
4 realm-wrappers 0x000000010e472e92 _ZN5realm3Obj19remove_one_backlinkENS_6ColKeyENS_6ObjKeyE + 354
5 realm-wrappers 0x000000010e4733ce _ZNK5realm3Obj15remove_backlinkENS_6ColKeyENS_7ObjLinkERNS_12CascadeStateE + 302
6 realm-wrappers 0x000000010e41f363 _ZNK5realm10Dictionary16remove_backlinksERNS_12CascadeStateE + 243
7 realm-wrappers 0x000000010e3fe947 _ZZN5realm4util11FunctionRefIFNS_15IteratorControlENS_6ColKeyEEEC1IRZNS_7Cluster5eraseENS_6ObjKeyERNS_12CascadeStateEE3$3EEOT_ENUlPvS3_E_8__invokeESF_S3 + 1303
8 realm-wrappers 0x000000010e51de77 _ZNK5realm16TableClusterTree25for_each_and_every_columnENS_4util11FunctionRefIFNS_15IteratorControlENS_6ColKeyEEEE + 87
9 realm-wrappers 0x000000010e3f751b _ZN5realm7Cluster5eraseENS_6ObjKeyERNS_12CascadeStateE + 203
10 realm-wrappers 0x000000010e40acb0 _ZZN5realm16ClusterNodeInner5eraseENS_6ObjKeyERNS_12CascadeStateEENK3$_3clEPNS_11ClusterNodeERNS0_9ChildInfoE + 48
11 realm-wrappers 0x000000010e406a4d _ZN5realm16ClusterNodeInner5eraseENS_6ObjKeyERNS_12CascadeStateE + 301
12 realm-wrappers 0x000000010e409971 _ZN5realm11ClusterTree5eraseENS_6ObjKeyERNS_12CascadeStateE + 97
13 realm-wrappers 0x000000010e511498 _ZN5realm5Table13remove_objectENS_6ObjKeyE + 280
14 realm-wrappers 0x000000010e13efa5 object_remove + 69
15 ??? 0x000000015e7b8352 0x0 + 5880120146!!! IMPORTANT: Please report this at https://github.com/realm/realm-core/issues/new/choose2022-10-28 13:42:39.195337+0200 CTeleport.Mobile.iOS[47691:4646569] /Users/runner/work/realm-dotnet/realm-dotnet/wrappers/realm-core/src/realm/array_backlink.cpp:108: [realm-core-12.9.0] Assertion failed: int64_t(value >> 1) == key.value [272, 16]
0 realm-wrappers 0x000000010e548ffc _ZN5realm4utilL18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 28
1 realm-wrappers 0x000000010e548f01 _ZN5realm4util9terminateEPKcS2_lOSt16initializer_listINS0_9PrintableEE + 385
2 realm-wrappers 0x000000010e42de77 ZN5realm4util9terminateIJxxEEEvPKcS3_lDpT + 55
3 realm-wrappers 0x000000010e3e1cb1 _ZN5realm13ArrayBacklink6removeEmNS_6ObjKeyE + 577
4 realm-wrappers 0x000000010e472e92 _ZN5realm3Obj19remove_one_backlinkENS_6ColKeyENS_6ObjKeyE + 354
5 realm-wrappers 0x000000010e4733ce _ZNK5realm3Obj15remove_backlinkENS_6ColKeyENS_7ObjLinkERNS_12CascadeStateE + 302
6 realm-wrappers 0x000000010e41f363 _ZNK5realm10Dictionary16remove_backlinksERNS_12CascadeStateE + 243
7 realm-wrappers 0x000000010e3fe947 _ZZN5realm4util11FunctionRefIFNS_15IteratorControlENS_6ColKeyEEEC1IRZNS_7Cluster5eraseENS_6ObjKeyERNS_12CascadeStateEE3$3EEOT_ENUlPvS3_E_8__invokeESF_S3 + 1303
8 realm-wrappers 0x000000010e51de77 _ZNK5realm16TableClusterTree25for_each_and_every_columnENS_4util11FunctionRefIFNS_15IteratorControlENS_6ColKeyEEEE + 87
9 realm-wrappers 0x000000010e3f751b _ZN5realm7Cluster5eraseENS_6ObjKeyERNS_12CascadeStateE + 203
10 realm-wrappers 0x000000010e40acb0 _ZZN5realm16ClusterNodeInner5eraseENS_6ObjKeyERNS_12CascadeStateEENK3$_3clEPNS_11ClusterNodeERNS0_9ChildInfoE + 48
11 realm-wrappers 0x000000010e406a4d _ZN5realm16ClusterNodeInner5eraseENS_6ObjKeyERNS_12CascadeStateE + 301
12 realm-wrappers 0x000000010e409971 _ZN5realm11ClusterTree5eraseENS_6ObjKeyERNS_12CascadeStateE + 97
13 realm-wrappers 0x000000010e511498 _ZN5realm5Table13remove_objectENS_6ObjKeyE + 280
14 realm-wrappers 0x000000010e13efa5 object_remove + 69
15 ??? 0x000000015e7b8352 0x0 + 5880120146!!! IMPORTANT: Please report this at https://github.com/realm/realm-core/issues/new/choose
Steps & Code to Reproduce
public async Task RemoveAsync(List items) where T : RealmObject
{
await _semaphoreSlim.WaitAsync();
await RealmInstance.WriteAsync(() => items.ForEach(s => RealmInstance.Remove(s)));
_semaphoreSlim.Release();
}
The text was updated successfully, but these errors were encountered: