Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Crash when no internet connections avaliable #1311

Open
4 of 5 tasks
5idereal opened this issue Aug 2, 2023 · 2 comments
Open
4 of 5 tasks

Crash when no internet connections avaliable #1311

5idereal opened this issue Aug 2, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@5idereal
Copy link
Contributor

5idereal commented Aug 2, 2023

复现步骤 / Step to reproduce

  1. Turn off Wi-Fi/mobile data
  2. Open Ehviewer

预期行为 / Expected behaviour

Browse normally.

实际行为 / Actual Behaviour

Crashes.

应用日志 / App logs

--------- beginning of crash
08-02 08:41:26.325 15300 15725 E AndroidRuntime: FATAL EXCEPTION: Fk0 Dispatcher
08-02 08:41:26.325 15300 15725 E AndroidRuntime: Process: moe.tarsin.ehviewer, PID: 15300
08-02 08:41:26.325 15300 15725 E AndroidRuntime: java.lang.IllegalArgumentException: Network.fromNetworkHandle refusing to instantiate NETID_UNSET Network.
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at android.net.Network.fromNetworkHandle(Network.java:454)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at android.net.NetworkUtils.getDnsNetwork(Native Method)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at android.net.DnsResolver.query(DnsResolver.java:446)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at K0.e(Unknown Source:8)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at bb.f(Unknown Source:62)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at mx0.b(Unknown Source:442)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at YJ.d(Unknown Source:9)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at YJ.a(Unknown Source:68)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at Jp.a(Unknown Source:27)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at ix0.b(Unknown Source:125)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at hh.a(Unknown Source:966)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at ix0.b(Unknown Source:125)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at kf.a(Unknown Source:213)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at ix0.b(Unknown Source:125)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at Yz0.a(Unknown Source:163)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at ix0.b(Unknown Source:125)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at Gk.a(Unknown Source:2)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at ix0.b(Unknown Source:125)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at Uw0.g(Unknown Source:95)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at Rw0.run(Unknown Source:47)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
08-02 08:41:26.325 15300 15725 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:1012)
08-02 08:41:26.323 15300 15470 W OOMEventManagerFK: Failed to mkdir /data/mqsas/hprof/

备注 / Addition details

No response

EhViewer 版本号 / EhViewer version code

1.8.9.0-SNAPSHOT

EhViewer CI 版本 / EhViewer CI Version

2a95d67

Android 系统版本 / Android version

MIUI 13

设备型号 / Device model

Redmi 10 2022

SoC 型号 / Soc model

Helio G88

自查步骤 / Verify steps

  • 如果您有足够的时间和能力,并愿意为此提交 PR ,请勾上此复选框 / Pull request is welcome. Check this if you want to start a pull request
  • 您已仔细查看并知情 Q&A 中的内容 / You have checked Q&A carefully
  • 您已搜索过 Issue Tracker,没有找到类似内容 / I have searched on Issue Tracker, No duplicate or related open issue has been found
  • 您确保这个 Issue 只提及一个问题。如果您有多个问题报告,烦请发起多个 Issue / Ensure there is only one bug report in this issue. Please make mutiply issue for mutiply bugs
  • 您确保已使用最新 CI 版本测试,并且该问题在最新 CI 版本中并未解决 / This bug have not solved in latest CI version
@5idereal 5idereal added the bug Something isn't working label Aug 2, 2023
@asuka-mio
Copy link
Member

FATAL EXCEPTION: Fk0 Dispatcher
Process: moe.tarsin.ehviewer, PID: 15300
java.lang.IllegalArgumentException: Network.fromNetworkHandle refusing to instantiate NETID_UNSET Network.
at android.net.Network.fromNetworkHandle(Network.java:454)
at android.net.NetworkUtils.getDnsNetwork(Native Method)
at android.net.DnsResolver.query(DnsResolver.java:446)
at androidx.core.view.accessibility.AccessibilityNodeInfoCompat$AccessibilityActionCompat$$ExternalSyntheticApiModelOutline0.okhttp3.android.AndroidAsyncDns$$InternalSyntheticApiModelOutline$3$35a061a2cc0cd61f309f9ef6762365afe3ab899f49c617dd39c713b2b5cbf4a6$1.m(Unknown Source:8)
at okhttp3.AsyncDns$Companion$$ExternalSyntheticLambda0.okhttp3.android.AndroidAsyncDns.query(Unknown Source:62)
okhttp3.AsyncDns$Companion.toDns$lambda-2
okhttp3.AsyncDns$Companion$$InternalSyntheticLambda$2$735e48dcfeef7c6089ec1b11c51d38d7562a166fce77b3d92ac8f3e6f0a65025$0.lookup
at okhttp3.internal.connection.RealRoutePlanner.okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(Unknown Source:442)
okhttp3.internal.connection.RouteSelector.nextProxy
okhttp3.internal.connection.RouteSelector.next
okhttp3.internal.connection.RealRoutePlanner.planConnect
plan
at okhttp3.internal.connection.FastFallbackExchangeFinder.launchTcpConnect(Unknown Source:9)
at okhttp3.internal.connection.FastFallbackExchangeFinder.find(Unknown Source:68)
at okhttp3.internal.connection.ConnectInterceptor.okhttp3.internal.connection.RealCall.initExchange$okhttp(Unknown Source:27)
intercept
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source:125)
at okhttp3.internal.cache.CacheInterceptor.intercept(Unknown Source:966)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source:125)
at okhttp3.internal.http.BridgeInterceptor.intercept(Unknown Source:213)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source:125)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(Unknown Source:163)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source:125)
at com.chuckerteam.chucker.api.ChuckerInterceptor.intercept(Unknown Source:2)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source:125)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(Unknown Source:95)
at okhttp3.internal.connection.RealCall$AsyncCall.run(Unknown Source:47)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)

~/new

@FooIbar
Copy link
Contributor

FooIbar commented Aug 2, 2023

java.lang.IllegalArgumentException: Network.fromNetworkHandle refusing to instantiate NETID_UNSET Network.
	at android.net.Network.fromNetworkHandle(Network.java:454)
	at android.net.NetworkUtils.getDnsNetwork(Native Method)
	at android.net.DnsResolver.query(DnsResolver.java:446)
	at okhttp3.android.AndroidAsyncDns.query(AndroidAsyncDns.kt:47)
	at okhttp3.AsyncDns$Companion.toDns$lambda-2(AsyncDns.kt:80)
	at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.kt:169)
	at okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.kt:132)
	at okhttp3.internal.connection.RouteSelector.next(RouteSelector.kt:74)
	at okhttp3.internal.connection.RealRoutePlanner.planConnect(RealRoutePlanner.kt:147)
	at okhttp3.internal.connection.RealRoutePlanner.plan(RealRoutePlanner.kt:67)
	at okhttp3.internal.connection.FastFallbackExchangeFinder.launchTcpConnect(FastFallbackExchangeFinder.kt:118)
	at okhttp3.internal.connection.FastFallbackExchangeFinder.find(FastFallbackExchangeFinder.kt:62)
	at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:267)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:84)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:65)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at com.chuckerteam.chucker.api.ChuckerInterceptor.intercept(ChuckerInterceptor.kt:28)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:205)
	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:537)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
	at java.lang.Thread.run(Thread.java:1012)

按理说这里应该捕获了啊
https://github.com/square/okhttp/blob/d54ef742fc43e8917edc233760c20fbbdda8ee52/okhttp/src/jvmMain/kotlin/okhttp3/internal/connection/FastFallbackExchangeFinder.kt#L117-L121

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

3 participants