question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Application got Freezed on Network disconnection in Android N (7.0) device

See original GitHub issue

Hi 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:open
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

4reactions
krishnamncommented, Feb 7, 2017

Sorry for the late reply…In my case it got solved by handling the below cases in Connect SDk – > SSDPClient class --> Close method

    if(this.datagramSocket != null) {
        if(this.datagramSocket.isConnected()) {
            this.datagramSocket.disconnect();
        }

        if(!this.datagramSocket.isClosed()) {
            this.datagramSocket.close();
        }
0reactions
nrkdrkcommented, Jun 19, 2018

Hello, I tried the solutions mentioned above, but I still could not solve the problem. Can you help me?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix an Android device that freezes or won't respond
Try the following steps if your phone: Freezes Stops responding Is stuck with the screen on After each step, restart your phone to...
Read more >
How to Fix Android 7.0 Nougat WiFi disconnect issues for ...
Open Settings, and then scroll down to find and tap on the Backup & reset option. Now, tap on 'Network settings reset', and...
Read more >
Reading network state | Android Developers
When the network disconnects, the Network object stops being usable; even if the device later reconnects to the same appliance, a new Network...
Read more >
Wi-Fi freqently loses connection and doesn't reestablish it ...
By default, Android is set to disconnect from wifi whenever the screen ... I ONLY had this issue after installing a wireless scanner...
Read more >
Android emulator not able to access the internet - Stack Overflow
It must of had my old wifi connection cached, because I moved to another wifi location and this issue started happening. I wiped...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found