-
Notifications
You must be signed in to change notification settings - Fork 298
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
CBL 1.0.4 - Rare/minor dealloc issue #592
Comments
Interesting — both the main thread and the replicator thread are dealloc'ing a CBLReplication, with nearly identical stacks. If it's the same instance, then that would explain the crash. But it shouldn't be possible for an object's -dealloc to be called on multiple threads, since ref-counting is thread-safe. On the other hand, it could be different CBLReplication instances, in which case it's just a very weird coincidence that both threads are in almost the same state.
|
@nl I plan to look at this issue some time this week or early next week. I would need to gather some more information and hopefully I can reproduce this. Look like we have ARC race condition here. Are you using continuous replicators? |
In my tests, I'm using both push and pull, mixed continuous and non-continuous replications. You're right about the no-delay: I'm stopping a replication and creating/starting a similar one immediately. I do this every few seconds. Here's a similar crash: https://gist.github.com/nl/9e94ebc9293073105ce4. It's not dealloc anymore, but it only happens in this same scenario (rapid creation/deletion of replications). |
I was trying to reproduce but still no luck. I have setup 2 pushers (one-time and continuous) and 2 pullers (one-time and continuos). I started, stopped and recreated those replicators every 2 seconds for 200 times, and everything worked as expected. I tested this on a mac app as I remembered that you are developing a mac application (let me know if I'm wrong). Anyway, does this issue happen to you again? and would it possible to post your code snippets showing how you setup the replicators and how you start/stop them in everything few seconds? If you have any other things or steps that you suspect to cause this issue, please feel free to provide. |
You're right about the Mac thing. I worked around the issue using your first hint: I start the 'new' replication after a slight runloop delay instead of right away after issuing the async stop on the 'old' replication. |
I'm closing this ticket now as I cannot reproduce but I will keep an eye on this. Feel free to reopen the ticket if you encounter the issue again or have more information that can help investigating the issue. Thanks a lot anyway for reporting the issue. |
For some reason, using CBL 1.0.4 and creating/starting/stopping replications every few seconds, I got this random crash. It happened only once, but just in case someone's interested... https://gist.github.com/nl/0e6911935526abf090aa
The text was updated successfully, but these errors were encountered: