Application got Freezed on Network disconnection in Android N (7.0) device
See original GitHub issueHi Application got freezed (ANR state) when the network got disconnected after opening the app in Nexus 9 (Android 7.0 ) . It was observed in the trace logs that a dead lock occured on com.connectsdk.discovery.provider.ssdp.SSDPClient.close . Below is the partial trace lock. Please check
`“main” prio=5 tid=1 Blocked | group=“main” sCount=1 dsCount=0 obj=0x73799530 self=0xe5b04400 | sysTid=2217 nice=-4 cgrp=default sched=0/0 handle=0xe878e534 | state=S schedstat=( 3867775484 1969408624 9506 ) utm=305 stm=80 core=0 HZ=100 | stack=0xff378000-0xff37a000 stackSize=8MB | held mutexes= at java.net.DatagramSocket.disconnect(DatagramSocket.java:506)
-
waiting to lock <0x01d93268> (a java.net.DatagramSocket) held by thread 68 at com.connectsdk.discovery.provider.ssdp.SSDPClient.close(SSDPClient.java:135) at com.connectsdk.discovery.provider.SSDPDiscoveryProvider.stop(SSDPDiscoveryProvider.java:177) at com.connectsdk.discovery.provider.SSDPDiscoveryProvider.reset(SSDPDiscoveryProvider.java:190) at com.connectsdk.discovery.DiscoveryManager$1.onReceive(DiscoveryManager.java:237) at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:1122) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6077) at java.lang.reflect.Method.invoke!(Native method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Thread-18" prio=5 tid=68 Native | group=“main” sCount=1 dsCount=0 obj=0x12d5e0d0 self=0xcacefa00 | sysTid=2339 nice=0 cgrp=default sched=0/0 handle=0xbdcff920 | state=S schedstat=( 29062667 12680420 32 ) utm=1 stm=0 core=1 HZ=100 | stack=0xbdbfd000-0xbdbff000 stackSize=1038KB | held mutexes= kernel: __switch_to+0x74/0x8c kernel: __skb_recv_datagram+0x328/0x360 kernel: udpv6_recvmsg+0xb8/0x700 kernel: inet_recvmsg+0x38/0x50 kernel: sock_recvmsg+0xd0/0xf4 kernel: SyS_recvfrom+0xdc/0x26c kernel: compat_sys_recvfrom+0x10/0x18 kernel: ret_fast_syscall+0x0/0x24 native: #00 pc 00049854 /system/lib/libc.so (recvfrom+16) native: #01 pc 0004fbb5 /system/lib/libc.so (__recvfrom_chk+20) native: #02 pc 0000e30f /system/lib/libopenjdk.so (NET_RecvFrom+70) native: #03 pc 0001a4ab /system/lib/libopenjdk.so (PlainDatagramSocketImpl_receive0+294) native: #04 pc 000b56d9 /system/framework/arm/boot.oat (Java_java_net_PlainDatagramSocketImpl_receive0__Ljava_net_DatagramPacket_2+108) at java.net.PlainDatagramSocketImpl.receive0(Native method)
- locked <0x09086947> (a java.net.PlainDatagramSocketImpl) at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:147)
- locked <0x09086947> (a java.net.PlainDatagramSocketImpl) at java.net.DatagramSocket.receive(DatagramSocket.java:811)
- locked <0x01d93268> (a java.net.DatagramSocket)
- locked <0x0c92a574> (a java.net.DatagramPacket) at com.connectsdk.discovery.provider.ssdp.SSDPClient.responseReceive(SSDPClient.java:99) at com.connectsdk.discovery.provider.SSDPDiscoveryProvider$3.run(SSDPDiscoveryProvider.java:251) at java.lang.Thread.run(Thread.java:761)`
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top GitHub Comments
Sorry for the late reply…In my case it got solved by handling the below cases in Connect SDk – > SSDPClient class --> Close method
Hello, I tried the solutions mentioned above, but I still could not solve the problem. Can you help me?