Project

General

Profile

Issue #609

Strongswan fails to disconnect - Android client

Added by Le Hoang over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
android
Affected version:
5.1.3
Resolution:
Won't fix

Description

We have been using the Android StrongSwan VPN client and have noticed that the app fails to disconnect properly. We're using a Samsung Galaxy tab 2 10.1 on Android Version 4.0.4. When attempting to disconnect, the app will just remain in the disconnecting state. After closer investigation on the source code and adding in a VPNStateListener, we have found that the State remains as "Disconnecting". This behaviour is not shown on any other of our Android devices including: Samsung Galaxy S5, Nexus 4, Samsung Galaxy S4, Samsung Galaxy S3 and HTC One X. Android Versions ranging from 4.2.2 - 4.4.2.

We have noticed that there was a bug raised last year that described similar behaviour:
http://wiki.strongswan.org/issues/298


Related issues

Related to Bug #298: Deadlock on charon deinitClosed25.02.2013

History

#1 Updated by Tobias Brunner over 6 years ago

  • Related to Bug #298: Deadlock on charon deinit added

#2 Updated by Tobias Brunner over 6 years ago

We're using a Samsung Galaxy tab 2 10.1 on Android Version 4.0.4.

According to Wikipedia an update to Android 4.2.2 should be available for that device (or at least to 4.1.2).

When attempting to disconnect, the app will just remain in the disconnecting state.
...
We have noticed that there was a bug raised last year that described similar behaviour:
http://wiki.strongswan.org/issues/298

It's a known issue and kinda related to #298. The problem is that Android versions before 4.1 implemented pthread_sigmask() incorrectly (this commit fixed it). Which means that on older Android releases threads might get canceled when they are not in a cancelable state and are e.g. holding locks, which could lead to a deadlock during shutdown.

Attached is a patch I had lying around that provides a workaround for Android < 4.1. I haven't applied it upstream so far because I prefer the current implementation and the workaround is only required for old Android versions with an ever decreasing market share.

#3 Updated by Le Hoang over 6 years ago

I applied the patch and it seems to be working. Thanks a lot.

#4 Updated by Le Hoang over 6 years ago

After some more rigorous testing, we have found that the problem still persists even with the patch. When the patch is applied, the problem does not disappear but only occurs less frequently. How much has this patch been tested?

#5 Updated by Tobias Brunner over 6 years ago

How much has this patch been tested?

Hasn't been tested at all.

#6 Updated by Tobias Brunner over 5 years ago

  • Status changed from Feedback to Closed
  • Resolution set to Won't fix

Also available in: Atom PDF