Prevent Android 8.1 crash
ClosedPublic

Authored by philipc on Jan 8 2018, 7:25 PM.

Details

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

Diff Detail

Repository
R225 KDE Connect - Android application
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
philipc requested review of this revision.Jan 8 2018, 7:25 PM
philipc created this revision.
albertvaka accepted this revision.Jan 16 2018, 7:01 PM
This revision is now accepted and ready to land.Jan 16 2018, 7:01 PM
This revision was automatically updated to reflect the committed changes.