ANR when getting RouterInfo
Opened 3 years ago
Last modified 2 years ago
#2096assigneddefect
ANR when getting RouterInfo
Reported by:str4dOwned by:Meeh Priority: minor Milestone: 0.9.42 Component: apps/android Version: 0.9.31 Keywords: I2P Android, hang Cc:
Parent Tickets:
Sensitive: no
Description
Seen on various Android devices:
"main" prio=5 tid=1 Blocked
| group="main" sCount=1 dsCount=0 obj=0x7626f000 self=0xb4827800
| sysTid=14023 nice=-11 cgrp=default sched=0/0 handle=0xb6f56bec
| state=S schedstat=( 0 0 0 ) utm=811 stm=143 core=1 HZ=100
| stack=0xbe784000-0xbe786000 stackSize=8MB
| held mutexes=
at net.i2p.router.Router.getRouterInfo (Router.java:519)
- waiting to lock <0x20b029bd> (a java.lang.Object) held by thread 85
at net.i2p.android.router.util.Util.getNetStatus (Util.java:436)
at net.i2p.android.router.MainFragment.updateStatus (MainFragment.java:359)
at net.i2p.android.router.MainFragment.access$600 (MainFragment.java:49)
at net.i2p.android.router.MainFragment$OneShotUpdate.run (MainFragment.java:270)
The thread holding the lock isn't shown in any of the reports, but I'm guessing it is a call to Router.rebuildRouterInfo(blockingRebuild=true)
.
Would it make sense to move the publishing of the RouterInfo? outside the lock? Publishing happens after a call to Router.setRouterInfo(ri)
, at which point other callers to Router.getRouterInfo()
should be able to proceed fine (and the publisher is one such caller).