================================================================= 2022-04-01 00:39:34.952952-0700 xctest[29357:174563] CouchbaseLite Network WARNING: {BLIPIO#89} onWebSocketMessages couldn't find any messages to process ==29357==ERROR: AddressSanitizer: heap-use-after-free on address 0x6070001e5898 at pc 0x000110735549 bp 0x7000025516b0 sp 0x7000025516a8 READ of size 1 at 0x6070001e5898 thread T10 #0 0x110735548 in litecore::actor::Timer::state std::__1::__cxx_atomic_load(std::__1::__cxx_atomic_base_impl const*, std::__1::memory_order) atomic:1010 #1 0x11073541a in std::__1::__atomic_base::load(std::__1::memory_order) const atomic:1643 #2 0x110732f89 in std::__1::__atomic_base::operator litecore::actor::Timer::state() const atomic:1647 #3 0x110733ed1 in litecore::actor::Timer::Manager::setFireTime(litecore::actor::Timer*, std::__1::chrono::time_point > >, bool) Timer.cc:109 #4 0x1106a9895 in litecore::actor::Timer::fireAfter(std::__1::chrono::duration >) Timer.hh:60 #5 0x1106a95eb in void litecore::actor::Timer::fireAfter >(std::__1::chrono::duration > const&) Timer.hh:69 #6 0x1102b3cc4 in litecore::websocket::WebSocketImpl::startResponseTimer(std::__1::chrono::duration >) WebSocketImpl.cc:392 #7 0x1102bb9e0 in litecore::websocket::WebSocketImpl::callRequestClose(int, fleece::slice) WebSocketImpl.cc:459 #8 0x1102be66c in litecore::websocket::WebSocketImpl::close(int, fleece::slice) WebSocketImpl.cc:511 #9 0x11072f735 in litecore::blip::BLIPIO::_close(litecore::websocket::CloseCode, fleece::alloc_slice) BLIPConnection.cc:217 #10 0x11072fa11 in invocation function for block in void litecore::actor::Actor::enqueue(char const*, void (litecore::blip::BLIPIO::*)(litecore::websocket::CloseCode, fleece::alloc_slice), litecore::websocket::CloseCode, fleece::alloc_slice) Actor.hh:111 #11 0x1102447ec in litecore::actor::GCDMailbox::safelyCall(void () block_pointer) const GCDMailbox.cc:81 #12 0x110244def in invocation function for block in litecore::actor::GCDMailbox::enqueue(char const*, void () block_pointer) GCDMailbox.cc:116 #13 0x10052c7ca in __wrap_dispatch_async_block_invoke+0xca (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x477ca) #14 0x7ff80f24c0cb in _dispatch_call_block_and_release+0xb (libdispatch.dylib:x86_64+0x20cb) #15 0x7ff80f24d316 in _dispatch_client_callout+0x7 (libdispatch.dylib:x86_64+0x3316) #16 0x7ff80f253316 in _dispatch_lane_serial_drain+0x29f (libdispatch.dylib:x86_64+0x9316) #17 0x7ff80f253dfc in _dispatch_lane_invoke+0x16d (libdispatch.dylib:x86_64+0x9dfc) #18 0x7ff80f25deed in _dispatch_workloop_worker_thread+0x2f0 (libdispatch.dylib:x86_64+0x13eed) #19 0x7ff80f404fcf in _pthread_wqthread+0x145 (libsystem_pthread.dylib:x86_64+0x2fcf) #20 0x7ff80f403f56 in start_wqthread+0xe (libsystem_pthread.dylib:x86_64+0x1f56) 0x6070001e5898 is located 56 bytes inside of 80-byte region [0x6070001e5860,0x6070001e58b0) freed by thread T4 here: #0 0x10053c66d in wrap__ZdlPv+0x7d (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x5766d) #1 0x1102d9393 in std::__1::default_delete::operator()(litecore::actor::Timer*) const unique_ptr.h:57 #2 0x1102b48a5 in std::__1::unique_ptr >::reset(litecore::actor::Timer*) unique_ptr.h:318 #3 0x1102bbfed in litecore::websocket::WebSocketImpl::onClose(litecore::websocket::CloseStatus) WebSocketImpl.cc:591 #4 0x11056ee83 in litecore::repl::C4SocketImpl::closed(C4Error) c4Socket.cc:223 #5 0x11056f404 in non-virtual thunk to litecore::repl::C4SocketImpl::closed(C4Error) c4Socket.cc #6 0x110580f97 in c4socket_closed c4Replicator_CAPI.cc:252 #7 0x11001d3e3 in __37-[CBLMessageSocket connectionClosed:]_block_invoke CBLMessageSocket.mm:217 #8 0x10052c7ca in __wrap_dispatch_async_block_invoke+0xca (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x477ca) #9 0x7ff80f24c0cb in _dispatch_call_block_and_release+0xb (libdispatch.dylib:x86_64+0x20cb) #10 0x7ff80f24d316 in _dispatch_client_callout+0x7 (libdispatch.dylib:x86_64+0x3316) #11 0x7ff80f253316 in _dispatch_lane_serial_drain+0x29f (libdispatch.dylib:x86_64+0x9316) #12 0x7ff80f253dfc in _dispatch_lane_invoke+0x16d (libdispatch.dylib:x86_64+0x9dfc) #13 0x7ff80f25deed in _dispatch_workloop_worker_thread+0x2f0 (libdispatch.dylib:x86_64+0x13eed) #14 0x7ff80f404fcf in _pthread_wqthread+0x145 (libsystem_pthread.dylib:x86_64+0x2fcf) #15 0x7ff80f403f56 in start_wqthread+0xe (libsystem_pthread.dylib:x86_64+0x1f56) previously allocated by thread T7 here: #0 0x10053c24d in wrap__Znwm+0x7d (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x5724d) #1 0x1102b2323 in litecore::websocket::WebSocketImpl::WebSocketImpl(fleece::alloc_slice const&, litecore::websocket::Role, bool, litecore::websocket::WebSocketImpl::Parameters const&) WebSocketImpl.cc:100 #2 0x11056ac6f in litecore::repl::C4SocketImpl::C4SocketImpl(fleece::alloc_slice, litecore::websocket::Role, fleece::alloc_slice, C4SocketFactory const*, void*) c4Socket.cc:117 #3 0x11056957a in litecore::repl::C4SocketImpl::C4SocketImpl(fleece::alloc_slice, litecore::websocket::Role, fleece::alloc_slice, C4SocketFactory const*, void*) c4Socket.cc:122 #4 0x1105697d4 in litecore::repl::CreateWebSocket(fleece::alloc_slice, fleece::alloc_slice, C4Database*, C4SocketFactory const*, void*) c4Socket.cc:86 #5 0x110698b35 in litecore::C4RemoteReplicator::createReplicator() c4RemoteReplicator.hh:131 #6 0x11069912a in litecore::C4ReplicatorImpl::_start(bool) c4ReplicatorImpl.hh:299 #7 0x1106a8271 in litecore::C4RemoteReplicator::_restart(bool) c4RemoteReplicator.hh:147 #8 0x1106985c3 in litecore::C4RemoteReplicator::retry(bool) c4RemoteReplicator.hh:82 #9 0x1106a6f04 in decltype(*(static_cast(fp0)).*fp(static_cast(fp1))) std::__1::__invoke(bool (litecore::C4RemoteReplicator::*&)(bool), litecore::C4RemoteReplicator*&, bool&) type_traits:3859 #10 0x1106a6d99 in std::__1::__bind_return, std::__1::tuple<>, __is_valid_bind_return, std::__1::tuple<> >::value>::type std::__1::__apply_functor, 0ul, 1ul, std::__1::tuple<> >(bool (litecore::C4RemoteReplicator::*&)(bool), std::__1::tuple&, std::__1::__tuple_indices<0ul, 1ul>, std::__1::tuple<>&&) bind.h:257 #11 0x1106a6cb6 in std::__1::__bind_return, std::__1::tuple<>, __is_valid_bind_return, std::__1::tuple<> >::value>::type std::__1::__bind::operator()<>() bind.h:292 #12 0x1106a6bc4 in decltype(static_cast&>(fp)()) std::__1::__invoke&>(std::__1::__bind&) type_traits:3918 #13 0x1106a6b7c in void std::__1::__invoke_void_return_wrapper::__call&>(std::__1::__bind&) invoke.h:61 #14 0x1106a6b4c in std::__1::__function::__alloc_func, std::__1::allocator >, void ()>::operator()() function.h:178 #15 0x1106a3698 in std::__1::__function::__func, std::__1::allocator >, void ()>::operator()() function.h:352 #16 0x110738e5b in std::__1::__function::__value_func::operator()() const function.h:505 #17 0x110732994 in std::__1::function::operator()() const function.h:1182 #18 0x110731d9e in litecore::actor::Timer::Manager::run() Timer.cc:52 #19 0x110737284 in litecore::actor::Timer::Manager::Manager()::$_0::operator()() const Timer.cc:28 #20 0x110737204 in decltype(static_cast(fp)()) std::__1::__invoke(litecore::actor::Timer::Manager::Manager()::$_0&&) type_traits:3918 #21 0x110736fb4 in void std::__1::__thread_execute >, litecore::actor::Timer::Manager::Manager()::$_0>(std::__1::tuple >, litecore::actor::Timer::Manager::Manager()::$_0>&, std::__1::__tuple_indices<>) thread:287 #22 0x110735e9f in void* std::__1::__thread_proxy >, litecore::actor::Timer::Manager::Manager()::$_0> >(void*) thread:298 #23 0x7ff80f4084e0 in _pthread_start+0x7c (libsystem_pthread.dylib:x86_64+0x64e0) #24 0x7ff80f403f6a in thread_start+0xe (libsystem_pthread.dylib:x86_64+0x1f6a) Thread T10 created by T6 here: Thread T6 created by T1 here: Thread T1 created by T0 here: Thread T4 created by T3 here: Thread T3 created by T1 here: Thread T7 created by T3 here: #0 0x10052771c in wrap_pthread_create+0x5c (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x4271c) #1 0x110735d78 in std::__1::__libcpp_thread_create(_opaque_pthread_t**, void* (*)(void*), void*) __threading_support:421 #2 0x1107358fc in std::__1::thread::thread(litecore::actor::Timer::Manager::Manager()::$_0&&) thread:314 #3 0x1107319bc in std::__1::thread::thread(litecore::actor::Timer::Manager::Manager()::$_0&&) thread:306 #4 0x11073183c in litecore::actor::Timer::Manager::Manager() Timer.cc:28 #5 0x1107316e4 in litecore::actor::Timer::Manager::Manager() Timer.cc:29 #6 0x11073165c in litecore::actor::Timer::manager() Timer.cc:22 #7 0x1106a97c9 in litecore::actor::Timer::fireAfter(std::__1::chrono::duration >) Timer.hh:60 #8 0x1106a95eb in void litecore::actor::Timer::fireAfter >(std::__1::chrono::duration > const&) Timer.hh:69 #9 0x1102b3cc4 in litecore::websocket::WebSocketImpl::startResponseTimer(std::__1::chrono::duration >) WebSocketImpl.cc:392 #10 0x1102b3ad4 in litecore::websocket::WebSocketImpl::connect() WebSocketImpl.cc:121 #11 0x11056baf9 in litecore::repl::C4SocketImpl::connect() c4Socket.cc:149 #12 0x1103d1912 in litecore::websocket::WebSocket::connect(litecore::websocket::Delegate*) WebSocketInterface.cc:52 #13 0x110727a0c in litecore::blip::BLIPIO::_start() BLIPConnection.cc:211 #14 0x1107242d3 in invocation function for block in void litecore::actor::Actor::enqueue(char const*, void (litecore::blip::BLIPIO::*)()) Actor.hh:111 #15 0x1102447ec in litecore::actor::GCDMailbox::safelyCall(void () block_pointer) const GCDMailbox.cc:81 #16 0x110244def in invocation function for block in litecore::actor::GCDMailbox::enqueue(char const*, void () block_pointer) GCDMailbox.cc:116 #17 0x10052c7ca in __wrap_dispatch_async_block_invoke+0xca (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x477ca) #18 0x7ff80f24c0cb in _dispatch_call_block_and_release+0xb (libdispatch.dylib:x86_64+0x20cb) #19 0x7ff80f24d316 in _dispatch_client_callout+0x7 (libdispatch.dylib:x86_64+0x3316) #20 0x7ff80f253316 in _dispatch_lane_serial_drain+0x29f (libdispatch.dylib:x86_64+0x9316) #21 0x7ff80f253dfc in _dispatch_lane_invoke+0x16d (libdispatch.dylib:x86_64+0x9dfc) #22 0x7ff80f25deed in _dispatch_workloop_worker_thread+0x2f0 (libdispatch.dylib:x86_64+0x13eed) #23 0x7ff80f404fcf in _pthread_wqthread+0x145 (libsystem_pthread.dylib:x86_64+0x2fcf) #24 0x7ff80f403f56 in start_wqthread+0xe (libsystem_pthread.dylib:x86_64+0x1f56) SUMMARY: AddressSanitizer: heap-use-after-free atomic:1010 in litecore::actor::Timer::state std::__1::__cxx_atomic_load(std::__1::__cxx_atomic_base_impl const*, std::__1::memory_order) Shadow bytes around the buggy address: 0x1c0e0003cac0: fd fd fa fa fa fa fd fd fd fd fd fd fd fd fd fd 0x1c0e0003cad0: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fa fa 0x1c0e0003cae0: fa fa fd fd fd fd fd fd fd fd fd fd fa fa fa fa 0x1c0e0003caf0: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fd fd 0x1c0e0003cb00: fd fd fd fd fd fd fd fd fa fa fa fa fd fd fd fd =>0x1c0e0003cb10: fd fd fd[fd]fd fd fa fa fa fa fd fd fd fd fd fd 0x1c0e0003cb20: fd fd fd fd fa fa fa fa fd fd fd fd fd fd fd fd 0x1c0e0003cb30: fd fd fa fa fa fa fd fd fd fd fd fd fd fd fd fd 0x1c0e0003cb40: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fa fa 0x1c0e0003cb50: fa fa fd fd fd fd fd fd fd fd fd fd fa fa fa fa 0x1c0e0003cb60: 00 00 00 00 00 00 00 00 00 00 fa fa fa fa 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==29357==ABORTING Warning: hit breakpoint while running function, skipping commands and conditions to prevent recursion. AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report. (lldb) --------------------------------- --------------------------------- --------------------------------- ------------BT ALL -------------- --------------------------------- --------------------------------- --------------------------------- --------------------------------- (lldb) bt all thread #1, queue = 'com.apple.main-thread' frame #0: 0x00007ff80f3cb97a libsystem_kernel.dylib`mach_msg_trap + 10 frame #1: 0x00007ff80f3cbce8 libsystem_kernel.dylib`mach_msg + 56 frame #2: 0x00007ff80f4cecdd CoreFoundation`__CFRunLoopServiceMachPort + 319 frame #3: 0x00007ff80f4cd368 CoreFoundation`__CFRunLoopRun + 1276 frame #4: 0x00007ff80f4cc7ac CoreFoundation`CFRunLoopRunSpecific + 562 frame #5: 0x000000010170534a XCTestCore`-[XCTWaiter waitForExpectations:timeout:enforceOrder:] + 886 frame #6: 0x0000000101707876 XCTestCore`+[XCTWaiter waitForExpectations:timeout:enforceOrder:] + 80 frame #7: 0x000000010cb2809a CouchbaseLiteTests`-[ReplicatorTest runWithReplicator:reset:errorCode:errorDomain:](self=0x0000612000028fc0, _cmd="runWithReplicator:reset:errorCode:errorDomain:", replicator=0x00006100000c4940, reset=YES, errorCode=0, errorDomain=0x0000000000000000) at ReplicatorTest.m:424:34 frame #8: 0x000000010cb25f71 CouchbaseLiteTests`-[ReplicatorTest run:reset:errorCode:errorDomain:onReplicatorReady:](self=0x0000612000028fc0, _cmd="run:reset:errorCode:errorDomain:onReplicatorReady:", config=0x000060d0000bcdf0, reset=YES, errorCode=0, errorDomain=0x0000000000000000, onReplicatorReady=(null)) at ReplicatorTest.m:327:12 frame #9: 0x000000010cb259a3 CouchbaseLiteTests`-[ReplicatorTest run:reset:errorCode:errorDomain:](self=0x0000612000028fc0, _cmd="run:reset:errorCode:errorDomain:", config=0x000060d0000bcdf0, reset=YES, errorCode=0, errorDomain=0x0000000000000000) at ReplicatorTest.m:310:12 frame #10: 0x000000010cafbb48 CouchbaseLiteTests`-[ReplicatorTest_MessageEndpoint runP2PErrorScenario:withRecoverability:](self=0x0000612000028fc0, _cmd="runP2PErrorScenario:withRecoverability:", location=kCBLMockConnectionReceive, isRecoverable=YES) at ReplicatorTest+MessageEndPoint.m:194:5 frame #11: 0x000000010cb0b702 CouchbaseLiteTests`-[ReplicatorTest_MessageEndpoint testMEP2PRecoverableFailureDuringReceive](self=0x0000612000028fc0, _cmd="testMEP2PRecoverableFailureDuringReceive") at ReplicatorTest+MessageEndPoint.m:401:5 frame #12: 0x00007ff80f4b22bc CoreFoundation`__invoking___ + 140 frame #13: 0x00007ff80f4b2163 CoreFoundation`-[NSInvocation invoke] + 305 frame #14: 0x000000010172d4f1 XCTestCore`+[XCTFailableInvocation invokeStandardConventionInvocation:completion:] + 64 frame #15: 0x000000010172d4af XCTestCore`__90+[XCTFailableInvocation invokeInvocation:withTestMethodConvention:lastObservedErrorIssue:]_block_invoke_3 + 23 frame #16: 0x000000010172cf93 XCTestCore`__81+[XCTFailableInvocation invokeWithAsynchronousWait:lastObservedErrorIssue:block:]_block_invoke.11 + 71 frame #17: 0x00000001016e5087 XCTestCore`+[XCTSwiftErrorObservation observeErrorsInBlock:] + 113 frame #18: 0x000000010172ce28 XCTestCore`+[XCTFailableInvocation invokeWithAsynchronousWait:lastObservedErrorIssue:block:] + 435 frame #19: 0x000000010172d267 XCTestCore`+[XCTFailableInvocation invokeInvocation:withTestMethodConvention:lastObservedErrorIssue:] + 205 frame #20: 0x000000010172d558 XCTestCore`+[XCTFailableInvocation invokeInvocation:lastObservedErrorIssue:] + 64 frame #21: 0x000000010171838c XCTestCore`__24-[XCTestCase invokeTest]_block_invoke_2 + 102 frame #22: 0x00000001016f3b39 XCTestCore`-[XCTMemoryChecker _assertInvalidObjectsDeallocatedAfterScope:] + 65 frame #23: 0x00000001017231bb XCTestCore`-[XCTestCase assertInvalidObjectsDeallocatedAfterScope:] + 116 frame #24: 0x0000000101718303 XCTestCore`__24-[XCTestCase invokeTest]_block_invoke.277 + 179 frame #25: 0x00000001016dd271 XCTestCore`-[XCTestCase(XCTIssueHandling) _caughtUnhandledDeveloperExceptionPermittingControlFlowInterruptions:caughtInterruptionException:whileExecutingBlock:] + 179 frame #26: 0x0000000101717e53 XCTestCore`-[XCTestCase invokeTest] + 852 frame #27: 0x000000010171977a XCTestCore`__26-[XCTestCase performTest:]_block_invoke.393 + 38 frame #28: 0x00000001016dd271 XCTestCore`-[XCTestCase(XCTIssueHandling) _caughtUnhandledDeveloperExceptionPermittingControlFlowInterruptions:caughtInterruptionException:whileExecutingBlock:] + 179 frame #29: 0x00000001017190fd XCTestCore`__26-[XCTestCase performTest:]_block_invoke.372 + 516 frame #30: 0x00000001016fdeeb XCTestCore`+[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 218 frame #31: 0x0000000101718d21 XCTestCore`-[XCTestCase performTest:] + 287 frame #32: 0x00000001016cada7 XCTestCore`-[XCTest runTest] + 57 frame #33: 0x0000000101701187 XCTestCore`-[XCTestSuite runTestBasedOnRepetitionPolicy:testRun:] + 151 frame #34: 0x0000000101701007 XCTestCore`__27-[XCTestSuite performTest:]_block_invoke + 243 frame #35: 0x000000010170091b XCTestCore`__59-[XCTestSuite _performProtectedSectionForTest:testSection:]_block_invoke + 24 frame #36: 0x00000001016fdeeb XCTestCore`+[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 218 frame #37: 0x00000001017008d2 XCTestCore`-[XCTestSuite _performProtectedSectionForTest:testSection:] + 159 frame #38: 0x0000000101700bc4 XCTestCore`-[XCTestSuite performTest:] + 219 frame #39: 0x00000001016cada7 XCTestCore`-[XCTest runTest] + 57 frame #40: 0x0000000101701187 XCTestCore`-[XCTestSuite runTestBasedOnRepetitionPolicy:testRun:] + 151 frame #41: 0x0000000101701007 XCTestCore`__27-[XCTestSuite performTest:]_block_invoke + 243 frame #42: 0x000000010170091b XCTestCore`__59-[XCTestSuite _performProtectedSectionForTest:testSection:]_block_invoke + 24 frame #43: 0x00000001016fdeeb XCTestCore`+[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 218 frame #44: 0x00000001017008d2 XCTestCore`-[XCTestSuite _performProtectedSectionForTest:testSection:] + 159 frame #45: 0x0000000101700bc4 XCTestCore`-[XCTestSuite performTest:] + 219 frame #46: 0x00000001016cada7 XCTestCore`-[XCTest runTest] + 57 frame #47: 0x0000000101701187 XCTestCore`-[XCTestSuite runTestBasedOnRepetitionPolicy:testRun:] + 151 frame #48: 0x0000000101701007 XCTestCore`__27-[XCTestSuite performTest:]_block_invoke + 243 frame #49: 0x000000010170091b XCTestCore`__59-[XCTestSuite _performProtectedSectionForTest:testSection:]_block_invoke + 24 frame #50: 0x00000001016fdeeb XCTestCore`+[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 218 frame #51: 0x00000001017008d2 XCTestCore`-[XCTestSuite _performProtectedSectionForTest:testSection:] + 159 frame #52: 0x0000000101700bc4 XCTestCore`-[XCTestSuite performTest:] + 219 frame #53: 0x00000001016cada7 XCTestCore`-[XCTest runTest] + 57 frame #54: 0x00000001016cc895 XCTestCore`__89-[XCTTestRunSession executeTestsWithIdentifiers:skippingTestsWithIdentifiers:completion:]_block_invoke + 115 frame #55: 0x00000001016fdeeb XCTestCore`+[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 218 frame #56: 0x00000001016cc77d XCTestCore`-[XCTTestRunSession executeTestsWithIdentifiers:skippingTestsWithIdentifiers:completion:] + 271 frame #57: 0x000000010173a812 XCTestCore`__72-[XCTExecutionWorker enqueueTestIdentifiersToRun:testIdentifiersToSkip:]_block_invoke_2 + 119 frame #58: 0x000000010173a95a XCTestCore`-[XCTExecutionWorker runWithError:] + 112 frame #59: 0x00000001016fb2ef XCTestCore`__25-[XCTestDriver _runTests]_block_invoke.318 + 61 frame #60: 0x00000001016d5907 XCTestCore`-[XCTestObservationCenter _observeTestExecutionForBlock:] + 307 frame #61: 0x00000001016faed0 XCTestCore`-[XCTestDriver _runTests] + 1455 frame #62: 0x00000001016cb34c XCTestCore`_XCTestMain + 125 frame #63: 0x0000000100006599 xctest`main + 355 frame #64: 0x000000010001d51e dyld`start + 462 thread #2, queue = 'Repl<-x-msg-conn:///0x60600032d440' frame #0: 0x00007ff80f3cdbd2 libsystem_kernel.dylib`__psynch_mutexwait + 10 frame #1: 0x00007ff80f405e7e libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 76 frame #2: 0x00007ff80f403cbb libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 205 frame #3: 0x00007ff80f3686b9 libc++.1.dylib`std::__1::mutex::lock() + 9 frame #4: 0x00000001107382bc CouchbaseLite`std::__1::unique_lock::unique_lock(this=0x000000010b61d6a0, __m=0x000060d00003a518) at __mutex_base:118:61 frame #5: 0x000000011073205d CouchbaseLite`std::__1::unique_lock::unique_lock(this=0x000000010b61d6a0, __m=0x000060d00003a518) at __mutex_base:118:54 frame #6: 0x00000001107334c1 CouchbaseLite`litecore::actor::Timer::Manager::unschedule(this=0x000060d00003a500, timer=0x000060700020a0e0, deleting=true) at Timer.cc:88:28 frame #7: 0x00000001106a81f4 CouchbaseLite`litecore::actor::Timer::~Timer(this=0x000060700020a0e0) at Timer.hh:42:52 frame #8: 0x00000001106a81b5 CouchbaseLite`litecore::actor::Timer::~Timer(this=0x000060700020a0e0) at Timer.hh:42:41 frame #9: 0x000000011037194b CouchbaseLite`std::__1::default_delete::operator(this=0x00006190006507d8, __ptr=0x000060700020a0e0)(litecore::actor::Timer*) const at unique_ptr.h:57:5 frame #10: 0x000000011034fc96 CouchbaseLite`std::__1::unique_ptr >::reset(this=0x00006190006507d8, __p=0x0000000000000000) at unique_ptr.h:318:7 frame #11: 0x0000000110350710 CouchbaseLite`litecore::repl::Checkpointer::stopAutosave(this=0x0000619000650710) at Checkpointer.cc:136:16 frame #12: 0x00000001107bc8e0 CouchbaseLite`litecore::repl::Replicator::_onClose(this=0x0000619000650480, status=litecore::blip::Connection::CloseStatus @ 0x000000010b61d620, state=kClosed) at Replicator.cc:454:23 frame #13: 0x00000001107ce933 CouchbaseLite`invocation function for block in void litecore::actor::Actor::enqueue(.block_descriptor=0x0000608000192320)(litecore::websocket::CloseStatus, litecore::blip::Connection::State), litecore::websocket::CloseStatus, litecore::blip::Connection::State) at Actor.hh:111:42 frame #14: 0x00000001102447ed CouchbaseLite`litecore::actor::GCDMailbox::safelyCall(this=0x00006190006504a8, block=0x00000001107ce6d0) block_pointer) const at GCDMailbox.cc:81:13 frame #15: 0x0000000110244df0 CouchbaseLite`invocation function for block in litecore::actor::GCDMailbox::enqueue(.block_descriptor=0x000060400034bdd0) block_pointer) at GCDMailbox.cc:116:13 frame #16: 0x000000010052c7cb libclang_rt.asan_osx_dynamic.dylib`__wrap_dispatch_async_block_invoke + 203 frame #17: 0x00007ff80f24c0cc libdispatch.dylib`_dispatch_call_block_and_release + 12 frame #18: 0x00007ff80f24d317 libdispatch.dylib`_dispatch_client_callout + 8 frame #19: 0x00007ff80f253317 libdispatch.dylib`_dispatch_lane_serial_drain + 672 frame #20: 0x00007ff80f253dfd libdispatch.dylib`_dispatch_lane_invoke + 366 frame #21: 0x00007ff80f25deee libdispatch.dylib`_dispatch_workloop_worker_thread + 753 frame #22: 0x00007ff80f404fd0 libsystem_pthread.dylib`_pthread_wqthread + 326 frame #23: 0x00007ff80f403f57 libsystem_pthread.dylib`start_wqthread + 15 thread #5 frame #0: 0x00007ff80f3cd05a libsystem_kernel.dylib`__workq_kernreturn + 10 frame #1: 0x00007ff80f405034 libsystem_pthread.dylib`_pthread_wqthread + 426 frame #2: 0x00007ff80f403f57 libsystem_pthread.dylib`start_wqthread + 15 thread #8, name = 'Timer (CBL)' frame #0: 0x00007ff80f3cdbd2 libsystem_kernel.dylib`__psynch_mutexwait + 10 frame #1: 0x00007ff80f405e7e libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 76 frame #2: 0x00007ff80f403cbb libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 205 frame #3: 0x00007ff80f408b07 libsystem_pthread.dylib`_pthread_cond_wait + 1401 frame #4: 0x00007ff80f366d33 libc++.1.dylib`std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock&, std::__1::chrono::time_point > >) + 93 frame #5: 0x000000011073a3a7 CouchbaseLite`std::__1::cv_status std::__1::condition_variable::wait_for >(this=0x000060d00003a558, __lk=0x000000010d658020, __d=0x000000010d62cec0) at __mutex_base:463:9 frame #6: 0x0000000110739669 CouchbaseLite`void std::__1::condition_variable::__do_timed_wait(this=0x000060d00003a558, __lk=0x000000010d658020, __tp=time_point > > @ 0x000000010d62cea0) at __mutex_base:518:5 frame #7: 0x0000000110732e03 CouchbaseLite`std::__1::cv_status std::__1::condition_variable::wait_until > >(this=0x000060d00003a558, __lk=0x000000010d658020, __t=0x000000010d6580a0) at __mutex_base:421:5 frame #8: 0x0000000110731f23 CouchbaseLite`litecore::actor::Timer::Manager::run(this=0x000060d00003a500) at Timer.cc:62:28 frame #9: 0x0000000110737285 CouchbaseLite`litecore::actor::Timer::Manager::Manager(this=0x000060200000eaf8)::$_0::operator()() const at Timer.cc:28:24 frame #10: 0x0000000110737205 CouchbaseLite`decltype(__f=0x000060200000eaf8)::$_0>(fp)()) std::__1::__invoke(litecore::actor::Timer::Manager::Manager()::$_0&&) at type_traits:3918:1 frame #11: 0x0000000110736fb5 CouchbaseLite`void std::__1::__thread_execute >, litecore::actor::Timer::Manager::Manager()::$_0>(__t=size=2, (null)=__tuple_indices<> @ 0x000070000244cf08)::$_0>&, std::__1::__tuple_indices<>) at thread:287:5 frame #12: 0x0000000110735ea0 CouchbaseLite`void* std::__1::__thread_proxy >, litecore::actor::Timer::Manager::Manager()::$_0> >(__vp=0x000060200000eaf0) at thread:298:5 frame #13: 0x00007ff80f4084e1 libsystem_pthread.dylib`_pthread_start + 125 frame #14: 0x00007ff80f403f6b libsystem_pthread.dylib`thread_start + 15 thread #9 frame #0: 0x00007ff80f403f48 libsystem_pthread.dylib`start_wqthread * thread #11, queue = 'BLIP[->x-msg-endpt:////_blipsync]', stop reason = Use of deallocated memory frame #0: 0x00000001005369f0 libclang_rt.asan_osx_dynamic.dylib`__asan::AsanDie() frame #1: 0x000000010054f61f libclang_rt.asan_osx_dynamic.dylib`__sanitizer::Die() + 175 frame #2: 0x0000000100534cc3 libclang_rt.asan_osx_dynamic.dylib`__asan::ScopedInErrorReport::~ScopedInErrorReport() + 419 frame #3: 0x00000001005345b6 libclang_rt.asan_osx_dynamic.dylib`__asan::ReportGenericError(unsigned long, unsigned long, unsigned long, unsigned long, bool, unsigned long, unsigned int, bool) + 1462 frame #4: 0x0000000100534fe8 libclang_rt.asan_osx_dynamic.dylib`__asan_report_load1 + 40 * frame #5: 0x0000000110735549 CouchbaseLite`litecore::actor::Timer::state std::__1::__cxx_atomic_load(__a=0x00006070001e5898, __order=memory_order_seq_cst) at atomic:1010:12 frame #6: 0x000000011073541b CouchbaseLite`std::__1::__atomic_base::load(this=0x00006070001e5898, __m=memory_order_seq_cst) const at atomic:1643:17 frame #7: 0x0000000110732f8a CouchbaseLite`std::__1::__atomic_base::operator litecore::actor::Timer::state(this=0x00006070001e5898) const at atomic:1647:53 frame #8: 0x0000000110733ed2 CouchbaseLite`litecore::actor::Timer::Manager::setFireTime(this=0x000060d00003a500, timer=0x00006070001e5860, when=std::__1::chrono::steady_clock::time_point @ 0x0000000112e0ef20, earlier=false) at Timer.cc:109:13 frame #9: 0x00000001106a9896 CouchbaseLite`litecore::actor::Timer::fireAfter(this=0x00006070001e5860, d=(__rep_ = 5000000000)) at Timer.hh:60:52 frame #10: 0x00000001106a95ec CouchbaseLite`void litecore::actor::Timer::fireAfter >(this=0x00006070001e5860, dur=0x0000000112d00420) at Timer.hh:69:20 frame #11: 0x00000001102b3cc5 CouchbaseLite`litecore::websocket::WebSocketImpl::startResponseTimer(this=0x00006150000e2e80, timeoutSecs=(__rep_ = 5)) at WebSocketImpl.cc:392:29 frame #12: 0x00000001102bb9e1 CouchbaseLite`litecore::websocket::WebSocketImpl::callRequestClose(this=0x00006150000e2e80, status=1000, message=slice @ 0x0000000112e0e520) at WebSocketImpl.cc:459:13 frame #13: 0x00000001102be66d CouchbaseLite`litecore::websocket::WebSocketImpl::close(this=0x00006150000e2e80, status=1000, message=slice @ 0x0000000112e0e420) at WebSocketImpl.cc:511:21 frame #14: 0x000000011072f736 CouchbaseLite`litecore::blip::BLIPIO::_close(this=0x00006180000d1c80, closeCode=kCodeNormal, message=alloc_slice @ 0x0000000112cff8a0) at BLIPConnection.cc:217:29 frame #15: 0x000000011072fa12 CouchbaseLite`invocation function for block in void litecore::actor::Actor::enqueue(.block_descriptor=0x000060700020af50)(litecore::websocket::CloseCode, fleece::alloc_slice), litecore::websocket::CloseCode, fleece::alloc_slice) at Actor.hh:111:42 frame #16: 0x00000001102447ed CouchbaseLite`litecore::actor::GCDMailbox::safelyCall(this=0x00006180000d1ca8, block=0x000000011072f7b0) block_pointer) const at GCDMailbox.cc:81:13 frame #17: 0x0000000110244df0 CouchbaseLite`invocation function for block in litecore::actor::GCDMailbox::enqueue(.block_descriptor=0x000060400034b7d0) block_pointer) at GCDMailbox.cc:116:13 frame #18: 0x000000010052c7cb libclang_rt.asan_osx_dynamic.dylib`__wrap_dispatch_async_block_invoke + 203 frame #19: 0x00007ff80f24c0cc libdispatch.dylib`_dispatch_call_block_and_release + 12 frame #20: 0x00007ff80f24d317 libdispatch.dylib`_dispatch_client_callout + 8 frame #21: 0x00007ff80f253317 libdispatch.dylib`_dispatch_lane_serial_drain + 672 frame #22: 0x00007ff80f253dfd libdispatch.dylib`_dispatch_lane_invoke + 366 frame #23: 0x00007ff80f25deee libdispatch.dylib`_dispatch_workloop_worker_thread + 753 frame #24: 0x00007ff80f404fd0 libsystem_pthread.dylib`_pthread_wqthread + 326 frame #25: 0x00007ff80f403f57 libsystem_pthread.dylib`start_wqthread + 15 thread #12 frame #0: 0x00007ff80f3cba9a libsystem_kernel.dylib`syscall_thread_switch + 10 frame #1: 0x00007ff80f42052f libsystem_platform.dylib`_OSSpinLockLockYield + 80 frame #2: 0x000000010054ef9c libclang_rt.asan_osx_dynamic.dylib`__sanitizer::ThreadRegistry::FinishThread(unsigned int) + 28 frame #3: 0x00000001005387f0 libclang_rt.asan_osx_dynamic.dylib`__asan::AsanThread::Destroy() + 128 frame #4: 0x00007ff80f40651c libsystem_pthread.dylib`_pthread_tsd_cleanup + 412 frame #5: 0x00007ff80f408b89 libsystem_pthread.dylib`_pthread_exit + 70 frame #6: 0x00007ff80f406310 libsystem_pthread.dylib`_pthread_wqthread_exit + 79 frame #7: 0x00007ff80f405062 libsystem_pthread.dylib`_pthread_wqthread + 472 frame #8: 0x00007ff80f403f57 libsystem_pthread.dylib`start_wqthread + 15 thread #13 frame #0: 0x00007ff80f3cd05a libsystem_kernel.dylib`__workq_kernreturn + 10 frame #1: 0x00007ff80f405034 libsystem_pthread.dylib`_pthread_wqthread + 426 frame #2: 0x00007ff80f403f57 libsystem_pthread.dylib`start_wqthread + 15 thread #14 frame #0: 0x0000000000000000 (lldb)