Opened 19 months ago

Last modified 19 months ago

#2097 open defect

ANR in RouterClock.now()

Reported by: str4d Owned by:
Priority: minor Milestone: undecided
Component: router/general Version: 0.9.31
Keywords: I2P Android, hang, time Cc:
Parent Tickets: Sensitive: no

Description

Spotted on an LGE LG Magna (my90ds), 1024MB RAM, Android 5.0 (two reports from the same user):

"main" prio=5 tid=1 Waiting
  | group="main" sCount=1 dsCount=0 obj=0x7442a2c8 self=0xb738df48
  | sysTid=5377 nice=-6 cgrp=apps sched=0/0 handle=0xb6fa5ec8
  | state=S schedstat=( 0 0 0 ) utm=1938 stm=538 core=2 HZ=100
  | stack=0xbe749000-0xbe74b000 stackSize=8MB
  | held mutexes=
  at java.lang.Object.wait! (Native method)
- waiting on <0x1f078bb8> (a java.lang.Object)
  at java.lang.Thread.parkFor (Thread.java:1220)
- locked <0x1f078bb8> (a java.lang.Object)
  at sun.misc.Unsafe.park (Unsafe.java:299)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:157)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2016)
  at java.util.concurrent.LinkedBlockingQueue.put (LinkedBlockingQueue.java:318)
  at net.i2p.util.LogManager.addRecord (LogManager.java:300)
  at net.i2p.util.Log.log (Log.java:113)
  at net.i2p.router.RouterClock.notifyMassive (RouterClock.java:298)
- locked <@addr=0x12c0d080> (a net.i2p.router.RouterClock)
  at net.i2p.router.RouterClock.now (RouterClock.java:258)
  at net.i2p.android.apps.NewsFetcher.status (NewsFetcher.java:118)
  at net.i2p.android.router.NewsFragment.onResume (NewsFragment.java:40)

I don't think we ever want RouterClock.now() to block on logging.

Subtickets

Change History (1)

comment:1 Changed 19 months ago by zzz

Status: newopen

Can't figured out why it blocked there, unless just bad luck.

We could pull the logging out of the lock, but, notifyMassive is about to soft-restart the whole router, so the wait is just beginning.

This is a side-effect of our clock management scheme, where we don't have a separate thread doing the slewing and shift detection (that would be a lot harder). So anybody could get stuck in now(), but it hardly ever happens.

We did confirm that the log LBQ is 1024, so it's almost impossible that it filled up, especially on Android with default settings.

Note: See TracTickets for help on using tickets.