Prevent Android 8.1 crash

Authored by philipc on Jan 16 2018, 7:07 PM.

Description

Prevent Android 8.1 crash

Summary:
The SSL/TLS handshake code in LanLinkProvider is normally invoked in parallel, so that multiple incoming messages can be read at once. However, this logic causes an unusual crash in Android 8.1's native openssl library.

Sample logcat of crash is available at https://paste.kde.org/ptolqcpya

This patch mitigates the issue by making the addLink function in that class synchronized. I recommend future work to determine whether there are any other thread-safety concerns in the handshake code.

Test Plan:

  1. Designate a test wi-fi network
  2. Disconnect all KDE Connect devices from that network
  3. Install build on disconnected Android 8.1 device
  4. Clear KDE Connect app data (if present) on 8.1 device
  5. Connect 8.1 device to test wi-fi network
  6. Connect any other KDE Connect device to test wi-fi network

Reviewers: albertvaka

Reviewed By: albertvaka

Differential Revision: https://phabricator.kde.org/D9739

Details

Committed
apolJan 16 2018, 7:08 PM
Reviewer
albertvaka
Differential Revision
D9739: Prevent Android 8.1 crash
Parents
R225:79a58e12a173: GIT_SILENT made messages (after extraction)
Branches
Unknown
Tags
Unknown