couchbase / couchbase-lite-ios

Lightweight, embedded, syncable NoSQL database engine for iOS and MacOS apps.
Apache License 2.0
1.63k stars 297 forks source link

MYBackgroundMonitor - NSInvalidArgumentException #1676

Closed nmeziere closed 6 years ago

nmeziere commented 7 years ago

Hi,

I have an issue concerning MyBackgroundController :

Fatal Exception: NSInvalidArgumentException 0 CoreFoundation 0x18a83d1b8 exceptionPreprocess 1 libobjc.A.dylib 0x18927455c objc_exception_throw 2 CoreFoundation 0x18a8441a8 CFExceptionProem 3 CoreFoundation 0x18a841270 forwarding 4 CoreFoundation 0x18a73a80c _CF_forwarding_prep_0 5 CoreFoundation 0x18a8a1014 -[_CFXNotificationNameRegistration match:observer:matching:] 6 CoreFoundation 0x18a8463bc -[_CFXNotificationRegistrar match:object:observer:enumerator:] 7 CoreFoundation 0x18a73aa10 _CFXNotificationRemoveObservers 8 Foundation 0x18b24d5d8 -[NSNotificationCenter removeObserver:name:object:] 9 iCoyote10 0x10028d150 -[MYBackgroundMonitor stop] (MYBackgroundMonitor.m:52) 10 iCoyote10 0x1002d6520 -[CBLRestReplicator(Backgrounding) endBackgrounding] (CBLRestReplicator+Backgrounding.m:63) 11 iCoyote10 0x10026c384 -[CBLRestReplicator stopped] (CBLRestReplicator.m:359) 12 iCoyote10 0x10026f31c -[CBLRestPuller stopped] (CBLRestPuller.m:180) 13 iCoyote10 0x10026f934 -[CBLRestPuller changeTrackerStopped:] (CBLRestPuller.m:286) 14 iCoyote10 0x10027d274 -[CBLChangeTracker stopped] (CBLChangeTracker.m:263) 15 iCoyote10 0x1002c7a24 -[CBLSocketChangeTracker handleEOF] (CBLSocketChangeTracker.m:265) 16 iCoyote10 0x1002c7d6c -[CBLSocketChangeTracker stream:handleEvent:] (CBLSocketChangeTracker.m:333) 17 CoreFoundation 0x18a786a94 _signalEventSync 18 CoreFoundation 0x18a7869a0 _cfstream_shared_signalEventSync 19 CoreFoundation 0x18a7eab5c CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION 20 CoreFoundation 0x18a7ea434 CFRunLoopDoSources0 21 CoreFoundation 0x18a7e80a4 CFRunLoopRun 22 CoreFoundation 0x18a7162b8 CFRunLoopRunSpecific 23 Foundation 0x18b25326c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] 24 iCoyote10 0x1002695f0 -[CBL_RunLoopServer runServerThread] (CBL_Server.m:193) 25 Foundation 0x18b350e68 NSThreadstart__ 26 libsystem_pthread.dylib 0x1898d1850 (Missing) 27 libsystem_pthread.dylib 0x1898d1760 (Missing) 28 libsystem_pthread.dylib 0x1898ced94 (Missing)


pasin commented 7 years ago

I haven't investigated the issue yet but in 1.4.0 @snej did some improvement and fixed some issues around backgrounding. You may try with 1.4.0 release and see if it helps the issue.

nmeziere commented 7 years ago

Hi,

I made a mistake concerning the version of CouchBase embedded in our app. We use a version of CouchBase based on a specific commit (74f02a99aa9e685f91f2541168a23fc9aecf8445).

The diff between our version and the last CouchBase release v1.4 is : https://github.com/couchbase/couchbase-lite-ios/compare/74f02a99aa9e685f91f2541168a23fc9aecf8445...release/1.4.0

It seems there are only unit test changes. So the bug should not be fixed in the release 1.4.

Best regards,

pasin commented 6 years ago

We have continued fixing replicator backgrounding issue in 1.4.1 and after. Please try again with 1.4.1 or build the code from the master branch.