Actually I take that back. Although I think the *_cmd* is what is actually causing the assertion it must be something with the threading that causes it to get to that assertion code due to this line.
*ok = dispatch_get_current_queue() == dispatchQueue;* The only problem is the threading works fine on the device (non-testing) and seems to look okay looking at the backtrace. Jens let me know if you have any other thoughts of what could be the problem. Thank you. On Thursday, April 3, 2014 3:51:34 PM UTC-7, David Quon wrote: > > Hi Jens. After looking at this some more I don't see this assertion when > I *dispatch_sync* as described above. > > * [[NSAssertionHandler currentHandler] handleFailureInMethod:_cmd* > > * object:self* > > * > file:@(__FILE__)* > > * > lineNumber:__LINE__* > > * description:* > > * @"***** THREAD-SAFETY VIOLATION: This database is being used > on a thread it wasn't "* > > * " created on! Please see the concurrency guidelines in the > Couchbase Lite "* > > * "documentation. *****"];* > Looking at the backtrace above I'm thinking that the assert is happening > due to the *_cmd* not being defined due to the block dispatch. That > would be consistent with the original error message given above. I tried > proving this today but for some reason I can't get Kiwi to work with a > manually brought in CBL framework (without CocoaPods). Do you have any > advice you can lend me here? Thanks. > > On Wednesday, April 2, 2014 5:06:51 PM UTC-7, David Quon wrote: >> >> After looking over the backtrace I emailed you I it still looks to be >> running on the correct thread as far as I can tell ( >> *com.apple.root.default-priority*). The only thing I see questionable >> in the back trace is the unavailable on the following two lines: >> >> * * frame #3: 0x0dbb4ad4 KiwiUnitTest`-[CBL_FMDatabase >> beginUse](self=0x0c8a5060, _cmd=<unavailable>) + 187 at FMDatabase.m:904* >> * frame #4: 0x0dbb3d35 KiwiUnitTest`-[CBL_FMDatabase >> executeQuery:withArgumentsInArray:orVAList:](self=<unavailable>, >> _cmd=0x0455520c, sql=<unavailable>, arrayArgs=0x0455520c, args=0xbfffbffc) + >> 195 at FMDatabase.m:515* >> >> >> Let me know if I'm missing something. Thanks. >> >> On Wednesday, April 2, 2014 1:54:52 PM UTC-7, David Quon wrote: >>> >>> I emailed you the backtrace from the exception. Thanks for your help >>> Jens. >>> >>> On Wednesday, April 2, 2014 1:15:59 PM UTC-7, Jens Alfke wrote: >>>> >>>> >>>> On Apr 2, 2014, at 12:43 PM, David Quon <dav...@amcoonline.net> wrote: >>>> >>>> So I'm a little confused why the test *ok >>>> = dispatch_get_current_queue() == dispatchQueue;* in *beginUse* would >>>> fail. Do you have any thoughts of what else I could be doing incorrectly >>>> to cause this assertion? >>>> >>>> >>>> Well, it sounds like you’re looking at the values in one place in the >>>> code, but that’s not where the assertion is being checked. Can you post a >>>> backtrace from the exception where the assertion fails? That should show >>>> what thread/queue it's on at the time. >>>> >>>> —Jens >>>> >>> -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchbase+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/4feebdd2-671b-4743-9315-feb5e6f68a27%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.