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

Lack of thread safety in hashset causing odd exception #1055

Closed
borrrden opened this issue Aug 17, 2018 · 0 comments
Closed

Lack of thread safety in hashset causing odd exception #1055

borrrden opened this issue Aug 17, 2018 · 0 comments
Assignees
Milestone

Comments

@borrrden
Copy link
Member

borrrden commented Aug 17, 2018

Library Version

1.4.1

.NET Runtime

Probably all, but reported on Mono 5.8.1.0

Operating System / Device Details

macOS 10.9 (but probably all)

Log Output

During replication start, the following is output:

[Error] 2018-05-17 02:01:08.3885|SYNC (Replication): State machine error System.NullReferenceException Object reference not set to an instance of an object Boolean AddIfNotPresent(Couchbase.Lite.Auth.RemoteLogin) at System.Collections.Generic.HashSet1[T].AddIfNotPresent (T value) [0x000a3] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/external/corefx/src/System.Collections/src/System/Collections/Generic/HashSet.cs:1234 -- at System.Collections.Generic.HashSet1[T].Add (T item) [0x00000] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/external/corefx/src/System.Collections/src/System/Collections/Generic/HashSet.cs:456
at Couchbase.Lite.Auth.RemoteLogin.AttemptLogin () [0x00026] in <8a7a2fbeb3164f1184a2d5f7a86f5163>:0
at Couchbase.Lite.Replication.Login () [0x00028] in <8a7a2fbeb3164f1184a2d5f7a86f5163>:0
at Couchbase.Lite.Replication.StartInternal () [0x00248] in <8a7a2fbeb3164f1184a2d5f7a86f5163>:0
at Couchbase.Lite.Replication.m__6 (Stateless.StateMachine2+Transition[TState,TTrigger] transition) [0x00049] in <8a7a2fbeb3164f1184a2d5f7a86f5163>:0 at Stateless.StateMachine2+StateConfiguration+<>c__DisplayClass16_0[TState,TTrigger].b__0 (Stateless.StateMachine2+Transition[TState,TTrigger] t, System.Object[] args) [0x00000] in <a3b08423b2ad4653acb40d40eae11cb5>:0 at Stateless.StateMachine2+StateRepresentation[TState,TTrigger].ExecuteEntryActions (Stateless.StateMachine2+Transition[TState,TTrigger] transition, System.Object[] entryArgs) [0x00031] in <a3b08423b2ad4653acb40d40eae11cb5>:0 at Stateless.StateMachine2+StateRepresentation[TState,TTrigger].Enter (Stateless.StateMachine2+Transition[TState,TTrigger] transition, System.Object[] entryArgs) [0x00040] in <a3b08423b2ad4653acb40d40eae11cb5>:0 at Stateless.StateMachine2[TState,TTrigger].InternalFire (TTrigger trigger, System.Object[] args) [0x00092] in :0
at Stateless.StateMachine2[TState,TTrigger].Fire (TTrigger trigger) [0x00000] in <a3b08423b2ad4653acb40d40eae11cb5>:0 at Couchbase.Lite.Replication+<FireTrigger>c__AnonStorey0.<>m__0 () [0x00036] in <8a7a2fbeb3164f1184a2d5f7a86f5163>:0 at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2879 at System.Threading.Tasks.Task.Execute () [0x00010] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2502 [Error] 2018-05-17 02:01:08.3885\|SYNC (Replication): State machine error System.NullReferenceException Object reference not set to an instance of an object Boolean AddIfNotPresent(Couchbase.Lite.Auth.RemoteLogin) at System.Collections.Generic.HashSet1[T].AddIfNotPresent (T value) [0x000a3] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/external/corefx/src/System.Collections/src/System/Collections/Generic/HashSet.cs:1234
at System.Collections.Generic.HashSet1[T].Add (T item) [0x00000] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/external/corefx/src/System.Collections/src/System/Collections/Generic/HashSet.cs:456 at Couchbase.Lite.Auth.RemoteLogin.AttemptLogin () [0x00026] in <8a7a2fbeb3164f1184a2d5f7a86f5163>:0 at Couchbase.Lite.Replication.Login () [0x00028] in <8a7a2fbeb3164f1184a2d5f7a86f5163>:0 at Couchbase.Lite.Replication.StartInternal () [0x00248] in <8a7a2fbeb3164f1184a2d5f7a86f5163>:0 at Couchbase.Lite.Replication.<InitializeStateMachine>m__6 (Stateless.StateMachine2+Transition[TState,TTrigger] transition) [0x00049] in <8a7a2fbeb3164f1184a2d5f7a86f5163>:0
at Stateless.StateMachine2+StateConfiguration+<>c__DisplayClass16_0[TState,TTrigger].<OnEntry>b__0 (Stateless.StateMachine2+Transition[TState,TTrigger] t, System.Object[] args) [0x00000] in :0
at Stateless.StateMachine2+StateRepresentation[TState,TTrigger].ExecuteEntryActions (Stateless.StateMachine2+Transition[TState,TTrigger] transition, System.Object[] entryArgs) [0x00031] in :0
at Stateless.StateMachine2+StateRepresentation[TState,TTrigger].Enter (Stateless.StateMachine2+Transition[TState,TTrigger] transition, System.Object[] entryArgs) [0x00040] in :0
at Stateless.StateMachine2[TState,TTrigger].InternalFire (TTrigger trigger, System.Object[] args) [0x00092] in <a3b08423b2ad4653acb40d40eae11cb5>:0 at Stateless.StateMachine2[TState,TTrigger].Fire (TTrigger trigger) [0x00000] in :0
at Couchbase.Lite.Replication+c__AnonStorey0.<>m__0 () [0x00036] in <8a7a2fbeb3164f1184a2d5f7a86f5163>:0
at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2879
at System.Threading.Tasks.Task.Execute () [0x00010] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2502

Expected behavior

No exception

Actual behavior

The above exception

Steps To Reproduce

Still unclear, report from CBSE 5561

Reproduction Project

@borrrden borrrden added the bug label Aug 17, 2018
@borrrden borrrden added this to the 1.4.4 milestone Aug 17, 2018
@borrrden borrrden self-assigned this Aug 17, 2018
@borrrden borrrden added the ffc label Aug 17, 2018
@djpongh djpongh closed this as completed Aug 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants