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

App crashes on specific device caused by okhttp when test network #2297

Closed
3 of 16 tasks
DitFranXX opened this issue Sep 1, 2019 · 6 comments
Closed
3 of 16 tasks

App crashes on specific device caused by okhttp when test network #2297

DitFranXX opened this issue Sep 1, 2019 · 6 comments

Comments

@DitFranXX
Copy link

Please read contributing guidelines. Thanks.

Describe the bug
Null point exception when test network in proxy mode.

To Reproduce
Steps to reproduce the behavior:

  1. Set to proxy mode.
  2. Touch any server
  3. Connect to server
  4. Touch status bar which can test network
  5. App crashes

Expected behavior
Show ping toast

Screenshots
SmartSelect_20190901-125232_Google Play services

Smartphone (please complete the following information):

  • Android/Chrome OS version: Android Pie (9)
  • Device: Samsung Galaxy Note10 5G Exynos
  • Version: 4.8.4
  • Last version that did not exhibit the issue: don't know

Configuration
Put an x inside the [ ] that applies.

  • IPv4 server address
  • IPv6 server address
  • Client IPv4 availability
  • Client IPv6 availability
  • Encrypt method: chacha20-ieft-poly1305
  • 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 over UDP
  • Plugin configuration (if applicable):
  • Auto Connect
  • [?] TCP Fast Open (It turned on without any setting)
  • If you're not using VPN mode, please supply more details here: Proxy mode, Connected with adguard proxy mode. (SS app filtering is disabled). The proxy is working if doesn't trigger this bug.

Additional context

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.net.InetAddress.toString()' on a null object reference
	at com.android.okhttp.internal.Util.closeQuietly(Util.java:96)
	at com.android.okhttp.internal.http.StreamAllocation.deallocate(StreamAllocation.java:293)
	at com.android.okhttp.internal.http.StreamAllocation.noNewStreams(StreamAllocation.java:257)
	at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:967)
	at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:759)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:498)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:434)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:565)
	at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
	at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:26)
	at com.github.shadowsocks.net.HttpsTest$testConnection$1$1.invokeSuspend(HttpsTest.kt:101)
	at com.github.shadowsocks.net.HttpsTest$testConnection$1$1.invoke(Unknown Source:10)
	at com.github.shadowsocks.utils.UtilsKt$useCancellable$$inlined$suspendCancellableCoroutine$lambda$2.invokeSuspend(Utils.kt:89)
	at ���(Coroutine boundary.�(�)
	at com.github.shadowsocks.net.HttpsTest$testConnection$1.invokeSuspend(HttpsTest.kt:98)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.net.InetAddress.toString()' on a null object reference
	at com.android.okhttp.internal.Util.closeQuietly(Util.java:96)
	at com.android.okhttp.internal.http.StreamAllocation.deallocate(StreamAllocation.java:293)
	at com.android.okhttp.internal.http.StreamAllocation.noNewStreams(StreamAllocation.java:257)
	at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:967)
	at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:759)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:498)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:434)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:565)
	at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
	at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:26)
	at com.github.shadowsocks.net.HttpsTest$testConnection$1$1.invokeSuspend(HttpsTest.kt:101)
	at com.github.shadowsocks.net.HttpsTest$testConnection$1$1.invoke(Unknown Source:10)
	at com.github.shadowsocks.utils.UtilsKt$useCancellable$$inlined$suspendCancellableCoroutine$lambda$2.invokeSuspend(Utils.kt:89)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:740)
@Mygod
Copy link
Contributor

Mygod commented Sep 1, 2019

Report to your device vendor instead.

Additional information: (@madeye)
This seems to be a bug almost exclusive to Samsung phones (<1% also found in Meizu, Xiaomi, Infinix, and HUAWEI).
Workaround would be to include and ship an HTTP library in our apk and use that. Unfortunately, I have not found an HTTP nonblocking coroutines library yet. See also: ktorio/ktor#1197

@madeye
Copy link
Contributor

madeye commented Sep 1, 2019

It looks an issue of okhttp library on specific devices? If so, we can do nothing here.

@DitFranXX
Copy link
Author

Thank you for response.
But is possible to use try-catch for prevent app crashes? It's annoying...

@DitFranXX DitFranXX changed the title App crashes when test network App crashes on specific device caused by okhttp during test network Sep 1, 2019
@DitFranXX DitFranXX changed the title App crashes on specific device caused by okhttp during test network App crashes on specific device caused by okhttp when test network Sep 1, 2019
@Mygod
Copy link
Contributor

Mygod commented Sep 2, 2019

Please avoid using this feature until Samsung issues a fix. Using try-catch will not fix this issue. (in fact how are your phones even functioning at this point)

@Mygod Mygod closed this as completed Sep 2, 2019
@DitFranXX
Copy link
Author

I received some update from samsung. They said Analysis was delayed.

It will fixed on next S/W update. They didn't say when it released.

@ghost
Copy link

ghost commented Dec 26, 2019

@DitFranXX Could you provide a link to the issue you opened with Samsung (if it is public)? I would benefit from being able to monitor Samsung's progress toward fixing this bug.

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

3 participants