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

Crashes during sync #2197

Closed
sammy-SC opened this Issue Aug 28, 2018 · 12 comments

Comments

Projects
None yet
7 participants
@sammy-SC

sammy-SC commented Aug 28, 2018

I’ve released my app with CouchbaseLite-Swift 2.0.3. During development and testing I didn’t spot any issues but when released to production to a larger number of users, number of crashes spiked. All of the issues seem to be linked to syncing. These are the 5 crashes that occur in CouchbaseLite-Swift 2.0.3. Each crash has a link to gist with stack trace, name of method where it crashes, number of total crashes and iOS versions distribution.


Crash report 1

  • Crash in CouchbaseLiteSwift uWS::WebSocketProtocol<false>::consume(char, unsigned int, void) + 44
  • Total number of crashes: 18 crashes
  • Exception:
Crashed: Websocket C4 dispatch
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000001
  • iOS versions
    • 11.4.1: 82%
    • 11.2.5: 6%
    • 11.4.0: 6%
    • 11.3.1: 6%

Crash report 2

  • Crash was introduced with CouchbaseLite-Swift 2.0.3, it does not have CouchbaseLiteSwift in stack trace however it seems to related to networking
  • Total number of crashes: 6 crashes
  • Exception:
Fatal Exception: std::__1::system_error
mutex lock failed: Invalid argument
  • iOS versions
    • 11.4.1: 66%
    • 11.4.0: 17%
    • 11.3.1: 17%

Crash report 3

  • Crash in CouchbaseLiteSwift litecore::blip::Connection::setWebSocket(litecore::websocket::WebSocket*, fleeceapi::AllocedDict const&) + 4256
  • Total number of crashes: 4 crashes
  • Exception:
Crashed: Websocket C4 dispatch
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000048
  • iOS versions
    • 11.4.1: 50%
    • 11.3.0: 50%

Crash report 4

  • Crashes in CouchbaseLiteSwift litecore::websocket::WebSocketImpl::onReceive(fleece::slice) + 124
  • Total number of crashes: 2 crashes
  • Exception:
Crashed: Websocket C4 dispatch
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000
  • iOS versions
    • 12.0.0: 100%

Crash report 5

  • Crashes in CouchbaseLiteSwift c4socket_gotHTTPResponse + 48
  • Total number of crashes: 1 crash
  • Exception:
Crashed: Websocket C4 dispatch
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x7461747300000001
  • iOS versions
    • 11.4.1: 100%

Version: CouchbaseLite-Swift 2.0.3
Server: 2.0.0

@pasin

This comment has been minimized.

Contributor

pasin commented Aug 28, 2018

@sammy-SC Thanks a lot for the crash reports.

Can you also provide exception information (e.g. EXC_CRASH SIGABRT and etc) of each crash as well? Normally the information is at the top at the crash report?

In 2.1 that we will release soon, we have reimplemented CBLWebSocket which should be able to help some of these crashes especially crash report 2.

@sammy-SC

This comment has been minimized.

sammy-SC commented Aug 29, 2018

@pasin I've added exception information to each crash.

Is there an expected release date for CouchbaseLite 2.1?

This issue has been tagged with label known-issue, for future reference, where do I find a list of known issues? I can't find it within this repo and if I knew this I would have avoided using CouchbaseLite 2.1.

Is there a workaround that I could use before 2.1 is released?

Thank you

@famanson

This comment has been minimized.

famanson commented Aug 29, 2018

@pasin hiya, this seems to me like a very serious issue, and CBLWebSocket is the core of the sync itself, why is it classed as icebox? Why is this not prioritised for a hotfix?

@pasin

This comment has been minimized.

Contributor

pasin commented Aug 29, 2018

We will release 2.1 which has a new CBLWebSocket implementation by the end of this week. This means that some of the crashes here (at least the second report) will be taken care in 2.1.

But this issue and #2196 came very late in the release cycle, we are not able to accommodate them in 2.1 release. We plan to have a patch release (2.1.1 tentatively) to mainly focus on crashes in replication.

@pasin

This comment has been minimized.

Contributor

pasin commented Aug 29, 2018

@sammy-SC I couldn't see the exception detail on each report.

@sammy-SC

This comment has been minimized.

sammy-SC commented Aug 29, 2018

@pasin my apologise for not including the exception detail, I thought I did. Exception details should now be visible under each crash.

Also please where do I find list of known issues?

Is there a workaround that I could use before 2.1 is released to prevent those crashes?
I noticed you linked an issue which suggests to wrap c4socket_received in try/catch, would that help?

Thank you very much

@pasin

This comment has been minimized.

Contributor

pasin commented Aug 29, 2018

@sammy-SC you can filter Github issue with known-issue label and 2.1 milestone to see the list of the known issues.

Sorry, there is no workaround for that at the moment. The try/catch needs to be done at the Lite-Core level.

FWIW, I did one fix that fixes thebad_alloc crash reported in #2196. You may cherry pick the fix to the release/2.1.x branch and build the framework yourself.

Please update the exception info and we will try to fix the issue as soon as we can.

@djpongh djpongh modified the milestones: 2.1.0, Iridium Sep 4, 2018

@djpongh djpongh added the P1: high label Sep 4, 2018

@djpongh djpongh modified the milestones: Iridium, 2.1.1 Sep 4, 2018

@djpongh djpongh added backlog and removed icebox labels Sep 4, 2018

@snej

This comment has been minimized.

Member

snej commented Sep 6, 2018

@sammy-SC, It's much better to file a separate bug report for each distinct crash. What we have here are up to five bugs, and it's unclear to me from reading the discussion which are fixed in 2.1 and which are still issues (and of those, which may be duplicates.)

@djpongh djpongh modified the milestones: 2.1.1, 2.1.2 Sep 12, 2018

@shobhakartiwari

This comment has been minimized.

shobhakartiwari commented Sep 24, 2018

I am using CBLite 2.0 and it getting crashed randomly , kindly help in resolving this issue :

terminating with uncaught exception of type std::__1: (worry) ystem_error: mutex lock failed: Invalid argument

@sammy-SC

This comment has been minimized.

sammy-SC commented Sep 24, 2018

@snej I assumed those crashes were related. I will close this issue and separate each crash into it's own issue. Sorry for the trouble.

@djpongh djpongh added ready and removed backlog labels Sep 28, 2018

@djpongh

This comment has been minimized.

djpongh commented Oct 26, 2018

Hopefully we fixed this in 2.1.2 coming out shortly. Please reopen if found again.

@djpongh djpongh closed this Oct 26, 2018

@pasin pasin removed the ready label Oct 26, 2018

@srinadh-k

This comment has been minimized.

srinadh-k commented Nov 13, 2018

Hello, i am also getting crash, so any plans when you are release 2.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment