Skip to content
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

No send/recv traffic after a while on Samsung S9+ #1712

Closed
9 of 17 tasks
Coxxs opened this issue Mar 30, 2018 · 10 comments
Closed
9 of 17 tasks

No send/recv traffic after a while on Samsung S9+ #1712

Coxxs opened this issue Mar 30, 2018 · 10 comments

Comments

@Coxxs
Copy link

Coxxs commented Mar 30, 2018

This issue is similar with another issue (#1410), but the symptom seems to be different. So I decided to open a new issue.

Environment

  • Android version: 8.0.0
  • Device: Samsung S9+ (SM-G9650/DS) [Dual-Sim (Qualcomm)]
  • Shadowsocks version: 4.5.2
  • Last version that did not exhibit the issue (if applicable):

Configuration

Put an x inside the [ ] that applies.

  • IPv4 server address
  • IPv6 server address
  • Client IPv4 availability
  • Client IPv6 availability
  • Encrypt method:
  • Route
    • All
    • Bypass LAN
    • Bypass China
    • Bypass LAN & China
    • GFW List
    • China List
    • Custom rules
  • IPv6 route
  • Apps VPN mode
    • Bypass mode
  • Remote DNS: 8.8.8.8
  • DNS Forwarding
  • Plugin configuration (if applicable):
  • Auto Connect
  • TCP Fast Open
  • If you're not using VPN mode, please supply more details here:

Samsung Related Configuration

  • Unmonitored shadowsocks in "Settings -> Device maintenance"
  • Locked shadowsocks in recent apps
  • No optimization apps installed (Greenify, brevent, etc.. )

What did you do?

  1. Boot up the device, the ss service auto connected.
  2. Enjoy the internet (1hrs ~ 2days)
  3. Unable to access the internet via ss. (ss shows: Connect success / send 0KB 0 Bytes/s | recv 0KB 0 Bytes/s )
  4. Try to connect to different servers via ss -> no send/recv traffic
  5. Try to connect to the servers mentioned above (on other devices, under same network) -> the server seems ok.

Methods I tried but still no send/recv traffic:

Other attempts:

  • Use outline or other VPN apps unrelated to ss protocol (still no send/recv traffic)
  • Connect to baidu without VPN services -> success

It seems that the only method to solve this problem temporarily is reboot.

I thought it's a bug related to VPN services in the Samsung OS, but I can hardly find similar issues on google (#1712 (comment)) , so I wonder if some specific usage in ss triggered this bug in Samsung OS.

@Coxxs Coxxs changed the title Not working after a while on Samsung S9+ no send/recv traffic after a while on Samsung S9+ Mar 30, 2018
@Coxxs Coxxs changed the title no send/recv traffic after a while on Samsung S9+ No send/recv traffic after a while on Samsung S9+ Mar 30, 2018
@Mygod
Copy link
Contributor

Mygod commented Mar 30, 2018

Thanks for the very helpful logcat. Unfortunately Netd and ConnectivityService are both system components. So I think this might be a bug of your ROM.

Does this issue also occur for 4.5.1? Does other VPN app works with your device?

@Rex1021
Copy link

Rex1021 commented Mar 30, 2018

my s8 has a problem, when you touch the circle button which start to connect, it doesn't work, you can't get any responses

@Rex1021
Copy link

Rex1021 commented Mar 30, 2018

but last version works well

@Mygod
Copy link
Contributor

Mygod commented Mar 30, 2018

I meant do you observe the similar behavior for other VPN apps before everything breaks down?

@madeye
Copy link
Contributor

madeye commented Mar 30, 2018

@Mygod I think maybe no one can keep a VPN connected for days? 😃

@Mygod
Copy link
Contributor

Mygod commented Mar 30, 2018

@madeye Maybe but unlike real VPNs, Shadowsocks is stateless.

@Coxxs Try switching between Wi-Fi and cellular networks frequently and see if that makes it happen more often. I'm suspecting some race condition somewhere.

@Mygod
Copy link
Contributor

Mygod commented Mar 30, 2018

It would probably be most helpful if you could get a logcat just after when connectivity is lost.

If possible, please also run adb shell ip addr.

@Mygod
Copy link
Contributor

Mygod commented Mar 30, 2018

Thanks. That's very helpful. I also tried your way on my Lineage OS for ~20 seconds and nothing happened.

Looking at your logcat, the most relevant lines are:

03-30 15:19:19.185   948  1229 E Netd    : Error deleting IPv4 rule: No such file or directory
03-30 15:19:19.185   948  1229 E Netd    : failed to remove interface tun0 from VPN netId 506
03-30 15:19:19.185   948  1229 E Netd    : deleting network with netId 506 without clearing its interfaces
03-30 15:19:19.186  1523  1778 E ConnectivityService: Exception removing network: java.lang.IllegalStateException: command '120 network destroy 506' failed with '400 120 destroyNetwork() failed (No such file or directory)'

This is almost certainly a race condition. Unfortunately it's impossible to debug it because we don't have access to Samsung's source code.

Also good job finding that related issue. Now I'm certain there's nothing to do here since you can reproduce it also with airplane mode. Please wait for Samsung to release a fix. (you could also contact their support staff)

@Mygod
Copy link
Contributor

Mygod commented Mar 30, 2018

Tip on switching slowly: Shut down VPN, switch profile then start again.

It's a race condition. It doesn't happen every time. If you try it for an hour it will probably happen.

Shadowsocks does change the route. It tells netd which route to add to VPN tunnel otherwise no traffic will go through VPN.

@AlynxZhou
Copy link

Seems 9.0 Beta fixed this issue.

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

No branches or pull requests

5 participants