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

Crash when using 2.1 to pull attachments from 2.0 #2205

Closed
parvezq opened this issue Sep 19, 2018 · 17 comments
Closed

Crash when using 2.1 to pull attachments from 2.0 #2205

parvezq opened this issue Sep 19, 2018 · 17 comments
Assignees
Milestone

Comments

@parvezq
Copy link

parvezq commented Sep 19, 2018

For an iOS 11.4 (Swift 3.3) application, we are getting crash when syncing is going on.
The Xcode console prints below text:

CouchbaseLiteSwift was compiled with optimization - stepping may behave oddly; variables may not be available.

The crash details are as given below (obtained through backtrace):

(lldb) bt
* thread #43, queue = 'DB->ws://mysyncgateway/syncgateway/mybucket/_blipsync', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x0000000116303ca1 CouchbaseLiteSwift`fleece::Encoder::writeValue(fleece::Value const*, fleece::SharedKeys const*, fleece::function_ref<bool (fleece::Value const*, fleece::Value const*)> const*) [inlined] fleece::Value::tag() const at Value.hh:177 [opt]
    frame #1: 0x0000000116303ca1 CouchbaseLiteSwift`fleece::Encoder::writeValue(this=0x00007f8c058b6e00, value=0x0000000000000000, sk=0x0000000000000000, writeNestedValue=0x0000000000000000)> const*) at Encoder.cc:319 [opt]
    frame #2: 0x0000700009cb7a40
    frame #3: 0x00000001162fa809 CouchbaseLiteSwift`::FLEncoder_WriteValueWithSharedKeys(FLEncoder, FLValue, FLSharedKeys) [inlined] fleece::Encoder::writeValue(this=<unavailable>, v=<unavailable>, sk=<unavailable>) at Encoder.hh:83 [opt]
    frame #4: 0x00000001162fa802 CouchbaseLiteSwift`::FLEncoder_WriteValueWithSharedKeys(e=0x0000000000000000, v=<unavailable>, sk=<unavailable>) at Fleece_C_impl.cc:363 [opt]
    frame #5: 0x0000000116140f04 CouchbaseLiteSwift`litecore::repl::DBWorker::_insertRevisionsNow() [inlined] FLEncoder_WriteValue(e=0x000060000087a100, v=<unavailable>) at Fleece_C_impl.cc:365 [opt]
    frame #6: 0x0000000116140ef3 CouchbaseLiteSwift`litecore::repl::DBWorker::_insertRevisionsNow() [inlined] fleeceapi::Encoder::writeValue(fleeceapi::Value) at FleeceCpp.hh:441 [opt]
    frame #7: 0x0000000116140ef3 CouchbaseLiteSwift`litecore::repl::DBWorker::_insertRevisionsNow(this=0x0000000000000000) at DBWorker.cc:905 [opt]
    frame #8: 0x00000001162dca45 CouchbaseLiteSwift`::___ZN8litecore5actor10GCDMailbox12enqueueAfterENSt3__16chrono8durationIdNS2_5ratioILl1ELl1EEEEEU13block_pointerFvvE_block_invoke() [inlined] litecore::actor::GCDMailbox::safelyCall(this=<unavailable>, block=<unavailable>) block_pointer) at GCDMailbox.cc:81 [opt]
    frame #9: 0x00000001162dca3f CouchbaseLiteSwift`::___ZN8litecore5actor10GCDMailbox12enqueueAfterENSt3__16chrono8durationIdNS2_5ratioILl1ELl1EEEEEU13block_pointerFvvE_block_invoke(.block_descriptor=<unavailable>) at GCDMailbox.cc:109 [opt]
    frame #10: 0x00000001170567ec libdispatch.dylib`_dispatch_client_callout + 8
    frame #11: 0x000000011705cad9 libdispatch.dylib`_dispatch_continuation_pop + 967
    frame #12: 0x0000000117067f4a libdispatch.dylib`_dispatch_source_invoke + 1635
    frame #13: 0x000000011705e8d1 libdispatch.dylib`_dispatch_queue_serial_drain + 517
    frame #14: 0x000000011705f4fa libdispatch.dylib`_dispatch_queue_invoke + 328
    frame #15: 0x000000011706236c libdispatch.dylib`_dispatch_root_queue_drain + 664
    frame #16: 0x0000000117062076 libdispatch.dylib`_dispatch_worker_thread3 + 132
    frame #17: 0x00000001175801ca libsystem_pthread.dylib`_pthread_wqthread + 1387
    frame #18: 0x000000011757fc4d libsystem_pthread.dylib`start_wqthread + 13
(lldb) 

Any idea about the crash reason?

  • Version: CouchbaseLiteSwift 2.1.0
  • Client OS: 11.4
  • Server: 2.0.0
@djpongh djpongh added this to the 2.1.1 milestone Sep 19, 2018
@pasin
Copy link
Contributor

pasin commented Sep 19, 2018

@parvezq You can do bt -all? If possible, please provide the following info as well:

  1. What is the scenario that causes the crash?

  2. Is the crash always reproducible?

  3. Can you share the log with Replicator and Verbose logging enabled?

Thanks!

@djpongh djpongh modified the milestones: 2.1.1, 2.1.2 Sep 19, 2018
@parvezq
Copy link
Author

parvezq commented Sep 19, 2018 via email

@pasin
Copy link
Contributor

pasin commented Sep 19, 2018

  1. The crash always occurs.

If the crash always occurs, maybe some certain documents or blobs trigger the crash?

  1. Enabled LogDomain.all logging but I did not see any log.

If attaching the device/simulator to xcode, you should be able to see the log in the Xcode's console; if not, it is very strange.

Do we have source code for the 2.1.0 available that I can use to identify the culprit code in the project, if yes please share link.

Here is the tag: https://github.com/couchbase/couchbase-lite-ios/tree/2.1.0

@parvezq
Copy link
Author

parvezq commented Sep 20, 2018

Below is the detailed stack trace:

(lldb) bt all
  thread #1, queue = 'com.apple.main-thread'
    frame #0: 0x0000000114f297c2 libsystem_kernel.dylib`mach_msg_trap + 10
    frame #1: 0x0000000114f28cdc libsystem_kernel.dylib`mach_msg + 60
    frame #2: 0x00000001112c77d5 CoreFoundation`__CFRunLoopServiceMachPort + 229
    frame #3: 0x00000001112c6c19 CoreFoundation`__CFRunLoopRun + 1689
    frame #4: 0x00000001112c630b CoreFoundation`CFRunLoopRunSpecific + 635
    frame #5: 0x0000000117f57a73 GraphicsServices`GSEventRunModal + 62
    frame #6: 0x000000010d5c5057 UIKit`UIApplicationMain + 159
    frame #7: 0x000000010c1577f7 *MyApp`main at AppDelegate.swift:33
    frame #8: 0x0000000114abc955 libdyld.dylib`start + 1
  thread #6, name = 'com.apple.uikit.eventfetch-thread'
    frame #0: 0x0000000114f297c2 libsystem_kernel.dylib`mach_msg_trap + 10
    frame #1: 0x0000000114f28cdc libsystem_kernel.dylib`mach_msg + 60
    frame #2: 0x00000001112c77d5 CoreFoundation`__CFRunLoopServiceMachPort + 229
    frame #3: 0x00000001112c6c19 CoreFoundation`__CFRunLoopRun + 1689
    frame #4: 0x00000001112c630b CoreFoundation`CFRunLoopRunSpecific + 635
    frame #5: 0x000000010fd99b4a Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 274
    frame #6: 0x000000010fe166bf Foundation`-[NSRunLoop(NSRunLoop) runUntilDate:] + 143
    frame #7: 0x000000010e21bce4 UIKit`-[UIEventFetcher threadMain] + 118
    frame #8: 0x000000010fda73b3 Foundation`__NSThread__start__ + 1221
    frame #9: 0x0000000114f696c1 libsystem_pthread.dylib`_pthread_body + 340
    frame #10: 0x0000000114f6956d libsystem_pthread.dylib`_pthread_start + 377
    frame #11: 0x0000000114f68c5d libsystem_pthread.dylib`thread_start + 13
  thread #13, queue = 'BLIP[->ws://mysyncgateway/syncgateway/mybucket/_blipsync]'
    frame #0: 0x0000000114f32d1e libsystem_kernel.dylib`__psynch_mutexwait + 10
    frame #1: 0x0000000114f69bfe libsystem_pthread.dylib`_pthread_mutex_lock_wait + 83
    frame #2: 0x0000000114f67551 libsystem_pthread.dylib`_pthread_mutex_lock_slow + 253
    frame #3: 0x000000010ce7e489 libc++.1.dylib`std::__1::mutex::lock() + 9
    frame #4: 0x0000000113b23273 CouchbaseLiteSwift`litecore::LogDomain::vlog(litecore::LogLevel, unsigned int, char const*, __va_list_tag*) + 83
    frame #5: 0x0000000113b23bdf CouchbaseLiteSwift`litecore::Logging::_logv(litecore::LogLevel, char const*, __va_list_tag*) const + 367
    frame #6: 0x0000000113b23a52 CouchbaseLiteSwift`litecore::Logging::_log(litecore::LogLevel, char const*, ...) const + 130
    frame #7: 0x0000000113cf0353 CouchbaseLiteSwift`litecore::blip::BLIPIO::_queueMessage(litecore::Retained<litecore::blip::MessageOut>) + 611
    frame #8: 0x0000000113cf03d9 CouchbaseLiteSwift`___lldb_unnamed_symbol5798$$CouchbaseLiteSwift + 57
    frame #9: 0x0000000113cdf8a5 CouchbaseLiteSwift`___lldb_unnamed_symbol5730$$CouchbaseLiteSwift + 21
    frame #10: 0x0000000114a3e7ab libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame #11: 0x0000000114a3f7ec libdispatch.dylib`_dispatch_client_callout + 8
    frame #12: 0x0000000114a47be5 libdispatch.dylib`_dispatch_queue_serial_drain + 1305
    frame #13: 0x0000000114a484fa libdispatch.dylib`_dispatch_queue_invoke + 328
    frame #14: 0x0000000114a4b36c libdispatch.dylib`_dispatch_root_queue_drain + 664
    frame #15: 0x0000000114a4b076 libdispatch.dylib`_dispatch_worker_thread3 + 132
    frame #16: 0x0000000114f691ca libsystem_pthread.dylib`_pthread_wqthread + 1387
    frame #17: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #15
    frame #0: 0x0000000114f32cee libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x0000000114f6a662 libsystem_pthread.dylib`_pthread_cond_wait + 732
    frame #2: 0x000000010ce4f35d libc++.1.dylib`std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >) + 93
    frame #3: 0x000000011c341045 JavaScriptCore`std::__1::cv_status std::__1::condition_variable::wait_until<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > > const&) + 117
    frame #4: 0x000000011c340f0f JavaScriptCore`std::__1::cv_status std::__1::condition_variable_any::wait_until<std::__1::unique_lock<bmalloc::Mutex>, std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >(std::__1::unique_lock<bmalloc::Mutex>&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > > const&) + 95
    frame #5: 0x000000011c340b17 JavaScriptCore`bmalloc::Scavenger::threadRunLoop() + 375
    frame #6: 0x000000011c340809 JavaScriptCore`bmalloc::Scavenger::threadEntryPoint(bmalloc::Scavenger*) + 9
    frame #7: 0x000000011c340bf8 JavaScriptCore`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(bmalloc::Scavenger*), bmalloc::Scavenger*> >(void*) + 40
    frame #8: 0x0000000114f696c1 libsystem_pthread.dylib`_pthread_body + 340
    frame #9: 0x0000000114f6956d libsystem_pthread.dylib`_pthread_start + 377
    frame #10: 0x0000000114f68c5d libsystem_pthread.dylib`thread_start + 13
  thread #18, name = 'com.apple.CFStream.LegacyThread'
    frame #0: 0x0000000114f297c2 libsystem_kernel.dylib`mach_msg_trap + 10
    frame #1: 0x0000000114f28cdc libsystem_kernel.dylib`mach_msg + 60
    frame #2: 0x00000001112c77d5 CoreFoundation`__CFRunLoopServiceMachPort + 229
    frame #3: 0x00000001112c6c19 CoreFoundation`__CFRunLoopRun + 1689
    frame #4: 0x00000001112c630b CoreFoundation`CFRunLoopRunSpecific + 635
    frame #5: 0x000000011138a4b5 CoreFoundation`_legacyStreamRunLoop_workThread + 261
    frame #6: 0x0000000114f696c1 libsystem_pthread.dylib`_pthread_body + 340
    frame #7: 0x0000000114f6956d libsystem_pthread.dylib`_pthread_start + 377
    frame #8: 0x0000000114f68c5d libsystem_pthread.dylib`thread_start + 13
  thread #19, name = 'com.apple.NSURLConnectionLoader'
    frame #0: 0x0000000114f297c2 libsystem_kernel.dylib`mach_msg_trap + 10
    frame #1: 0x0000000114f28cdc libsystem_kernel.dylib`mach_msg + 60
    frame #2: 0x00000001112c77d5 CoreFoundation`__CFRunLoopServiceMachPort + 229
    frame #3: 0x00000001112c6c19 CoreFoundation`__CFRunLoopRun + 1689
    frame #4: 0x00000001112c630b CoreFoundation`CFRunLoopRunSpecific + 635
    frame #5: 0x0000000115740444 CFNetwork`-[__CoreSchedulingSetRunnable runForever] + 198
    frame #6: 0x000000010fda73b3 Foundation`__NSThread__start__ + 1221
    frame #7: 0x0000000114f696c1 libsystem_pthread.dylib`_pthread_body + 340
    frame #8: 0x0000000114f6956d libsystem_pthread.dylib`_pthread_start + 377
    frame #9: 0x0000000114f68c5d libsystem_pthread.dylib`thread_start + 13
  thread #20, name = 'com.apple.CFSocket.private'
    frame #0: 0x0000000114f32fca libsystem_kernel.dylib`__select + 10
    frame #1: 0x00000001112ff75d CoreFoundation`__CFSocketManager + 669
    frame #2: 0x0000000114f696c1 libsystem_pthread.dylib`_pthread_body + 340
    frame #3: 0x0000000114f6956d libsystem_pthread.dylib`_pthread_start + 377
    frame #4: 0x0000000114f68c5d libsystem_pthread.dylib`thread_start + 13
  thread #21, name = 'LiteCore Timer'
    frame #0: 0x0000000114f32cee libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x0000000114f6a662 libsystem_pthread.dylib`_pthread_cond_wait + 732
    frame #2: 0x000000010ce4f35d libc++.1.dylib`std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >) + 93
    frame #3: 0x0000000113cdf044 CouchbaseLiteSwift`litecore::actor::Timer::Manager::run() + 292
    frame #4: 0x0000000113cdeedd CouchbaseLiteSwift`___lldb_unnamed_symbol5729$$CouchbaseLiteSwift + 45
    frame #5: 0x0000000114f696c1 libsystem_pthread.dylib`_pthread_body + 340
    frame #6: 0x0000000114f6956d libsystem_pthread.dylib`_pthread_start + 377
    frame #7: 0x0000000114f68c5d libsystem_pthread.dylib`thread_start + 13
  thread #25
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #26
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #28
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
* thread #29, queue = 'DB->ws://mysyncgateway/syncgateway/mybucket/_blipsync', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x0000000113d06ca1 CouchbaseLiteSwift`fleece::Encoder::writeValue(fleece::Value const*, fleece::SharedKeys const*, fleece::function_ref<bool (fleece::Value const*, fleece::Value const*)> const*) + 113
    frame #1: 0x0000700008d00a40
    frame #2: 0x0000000113cfd809 CouchbaseLiteSwift`FLEncoder_WriteValueWithSharedKeys + 41
    frame #3: 0x0000000113b43f04 CouchbaseLiteSwift`litecore::repl::DBWorker::_insertRevisionsNow() + 676
    frame #4: 0x0000000113cdfa45 CouchbaseLiteSwift`___lldb_unnamed_symbol5733$$CouchbaseLiteSwift + 21
    frame #5: 0x0000000114a3f7ec libdispatch.dylib`_dispatch_client_callout + 8
    frame #6: 0x0000000114a45ad9 libdispatch.dylib`_dispatch_continuation_pop + 967
    frame #7: 0x0000000114a50f4a libdispatch.dylib`_dispatch_source_invoke + 1635
    frame #8: 0x0000000114a478d1 libdispatch.dylib`_dispatch_queue_serial_drain + 517
    frame #9: 0x0000000114a484fa libdispatch.dylib`_dispatch_queue_invoke + 328
    frame #10: 0x0000000114a4b36c libdispatch.dylib`_dispatch_root_queue_drain + 664
    frame #11: 0x0000000114a4b076 libdispatch.dylib`_dispatch_worker_thread3 + 132
    frame #12: 0x0000000114f691ca libsystem_pthread.dylib`_pthread_wqthread + 1387
    frame #13: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #30
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #31
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #32
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #33
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #34
    frame #0: 0x0000000114f68c40 libsystem_pthread.dylib`start_wqthread
  thread #35
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #36
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #37
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #38
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #39
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #40
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #41
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #42, queue = 'Repl->ws://mysyncgateway/syncgateway/mybucket/_blipsync'
    frame #0: 0x0000000114f32c46 libsystem_kernel.dylib`__proc_info + 10
    frame #1: 0x0000000114f2a1fa libsystem_kernel.dylib`proc_pidinfo + 30
    frame #2: 0x0000000111316eae CoreFoundation`_CFLogvEx3 + 286
    frame #3: 0x000000010fe07ccf Foundation`_NSLogv + 104
    frame #4: 0x000000010fdf3ad6 Foundation`NSLog + 132
    frame #5: 0x0000000113aedb1d CouchbaseLiteSwift`___lldb_unnamed_symbol3406$$CouchbaseLiteSwift + 163
    frame #6: 0x0000000113b233a0 CouchbaseLiteSwift`litecore::LogDomain::vlog(litecore::LogLevel, unsigned int, char const*, __va_list_tag*) + 384
    frame #7: 0x0000000113b23bdf CouchbaseLiteSwift`litecore::Logging::_logv(litecore::LogLevel, char const*, __va_list_tag*) const + 367
    frame #8: 0x0000000113b23a52 CouchbaseLiteSwift`litecore::Logging::_log(litecore::LogLevel, char const*, ...) const + 130
    frame #9: 0x0000000113b6c783 CouchbaseLiteSwift`litecore::repl::Replicator::_childChangedStatus(litecore::repl::Worker*, litecore::repl::Worker::Status) + 403
    frame #10: 0x0000000113ba7754 CouchbaseLiteSwift`___lldb_unnamed_symbol4933$$CouchbaseLiteSwift + 68
    frame #11: 0x0000000113cdf8a5 CouchbaseLiteSwift`___lldb_unnamed_symbol5730$$CouchbaseLiteSwift + 21
    frame #12: 0x0000000114a3e7ab libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame #13: 0x0000000114a3f7ec libdispatch.dylib`_dispatch_client_callout + 8
    frame #14: 0x0000000114a47be5 libdispatch.dylib`_dispatch_queue_serial_drain + 1305
    frame #15: 0x0000000114a484fa libdispatch.dylib`_dispatch_queue_invoke + 328
    frame #16: 0x0000000114a4b36c libdispatch.dylib`_dispatch_root_queue_drain + 664
    frame #17: 0x0000000114a4b076 libdispatch.dylib`_dispatch_worker_thread3 + 132
    frame #18: 0x0000000114f691ca libsystem_pthread.dylib`_pthread_wqthread + 1387
    frame #19: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #43
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #44
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #45
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #46
    frame #0: 0x0000000114f68c40 libsystem_pthread.dylib`start_wqthread
  thread #47
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #48
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #49
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #50
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #51
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #52
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #53
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #54
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #55
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #56
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
  thread #57
    frame #0: 0x0000000114f33562 libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x0000000114f6926f libsystem_pthread.dylib`_pthread_wqthread + 1552
    frame #2: 0x0000000114f68c4d libsystem_pthread.dylib`start_wqthread + 13
(lldb) 

Even I tried using below Couchbase logging but unfortunately it did not prints out any log in console.

Database.setLogLevel(.verbose, domain: .network)
Database.setLogLevel(.verbose, domain: .replicator)

Also what folders to include for the CouchbaseLiteSwift source code (from the 2.1.0 tag link shared above) so that I can debug it and check the issue at my end.

@pasin
Copy link
Contributor

pasin commented Sep 20, 2018

To add CouchbaseLite project directly, try the followings:

  1. Drag the CouchbaseLite.xcodeproj into the Project Navigator of your application's Xcode project.
  2. In your application's target, select Build Phrases and add CBL Swift to the Target Dependencies.
  3. Select General tab and add CouchbaseLiteSwift.framework to the Embedded Binaries. If there are two CouchbaseLiteSwift.framework, try to add the first one. If it doesn't work, try to add another one.

@pasin
Copy link
Contributor

pasin commented Sep 20, 2018

@parvezq after all I think the full stacktrace doesn't provide any new info and the first stacktrace already reveals the issue. I'm sorry for asking the unnecessary full stacktrace. BTW, I'm formatting the stacktrace on your post to make it more readable.

@pasin
Copy link
Contributor

pasin commented Sep 20, 2018

From the stacktrace, it seems like _byte is null?

internal::tags tag() const noexcept   {return (internal::tags)(_byte[0] >> 4);}

@pasin
Copy link
Contributor

pasin commented Sep 20, 2018

This might be related with https://github.com/couchbase/couchbase-lite-core/issues/565.

@parvezq
Copy link
Author

parvezq commented Sep 21, 2018

After following the steps for adding the source code of CouchbaseLite as mentioned above when I try to compile my project then I am getting the compilation error for a file "sqlite3_unicodesn_tokenizer.c". It seems checking out from the tag 2.1.0 do not have all needed files included and the CouchbaseLite project is using submodules also.

@pasin
Copy link
Contributor

pasin commented Sep 21, 2018

After checking out the tag, you will also need to update the submodules as follows:

$git submodule update --init --recursive

@shobhakartiwari
Copy link

shobhakartiwari commented Sep 24, 2018

Using CBlite 2.0 for iOS and randomly during the sync process application gets crashed , here is the log , kindly help regarding this crash :

Crash Log :

terminating with uncaught exception of type std::__1: system_error: mutex lock failed: Invalid argument

@parvezq
Copy link
Author

parvezq commented Sep 24, 2018

Even after following the defined steps with submodules updated, I am now getting compilation error 'no such module CouchbaseLiteSwift' no matter we add first framework or second one.

@pasin
Copy link
Contributor

pasin commented Sep 24, 2018

@parvezq If you can create zip an empty swift project linked with CBL that shows the issue, I can try to look where the issue is.

@pasin
Copy link
Contributor

pasin commented Sep 24, 2018

Anyway I was able to reproduce the exact crash and I can confirm that it's the same issue as https://github.com/couchbase/couchbase-lite-core/issues/565. The crash happens when trying to sync the attachments/blobs that got push to SG by using CBL 2.0.0. We plan to have a fix in 2.1.2.

@pasin
Copy link
Contributor

pasin commented Sep 24, 2018

Closed the issue as we can track the issue by couchbase/couchbase-lite-core#565.

@pasin pasin closed this as completed Sep 24, 2018
@pasin pasin changed the title CouchbaseLiteSwift 2.1.0: Crash on iOS Crash when using 2.1 to pull attachments from 2.0 Sep 24, 2018
@parvezq
Copy link
Author

parvezq commented Sep 25, 2018 via email

@pasin
Copy link
Contributor

pasin commented Sep 25, 2018

@djpongh can you help answer the question?

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

4 participants