Opened 7 years ago

Closed 7 years ago

#703 closed defect (fixed)

AL-OOBE in netdb FloodfillPeerSelector

Reported by: sponge Owned by: sponge
Priority: major Milestone: 0.9.2
Component: router/netdb Version: 0.9.1
Keywords: AL-OOBE neddb FloodfillPeerSelector Cc:
Parent Tickets: Sensitive: no

Description

0.9.1-20

Been seeing these since at least 0.9.1-15ish

INFO: Locally optimized native BigInteger library loaded from file
Warning - No client config file /data/data/net.i2p.android.router/files/clients.config
Warning - No client apps or router console configured - we are just a router
ERROR [JobQueue 1/1] uter.startup.LoadClientAppsJob: Warning - No client apps or router console configured - we are just a router
INFO:BOB is now running.
CRIT  [JobQueue 3/3] net.i2p.router.JobQueueRunner : Error processing job [Update Reply Found for Kademlia Search] on thread 2: Invalid index 128, size is 67
java.lang.IndexOutOfBoundsException: Invalid index 128, size is 67
        at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
        at java.util.ArrayList.get(ArrayList.java:304)
        at net.i2p.router.util.RandomIterator.next(RandomIterator.java:136)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector$FloodfillSelectionCollector.get(FloodfillPeerSelector.java:353)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector.selectNearestExplicitThin(FloodfillPeerSelector.java:88)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector.selectNearestExplicitThin(FloodfillPeerSelector.java:67)
        at net.i2p.router.networkdb.kademlia.PeerSelector.selectNearestExplicit(PeerSelector.java:58)
        at net.i2p.router.networkdb.kademlia.SearchJob.getClosestRouters(SearchJob.java:367)
        at net.i2p.router.networkdb.kademlia.SearchJob.continueSearch(SearchJob.java:269)
        at net.i2p.router.networkdb.kademlia.SearchJob.searchNext(SearchJob.java:219)
        at net.i2p.router.networkdb.kademlia.SearchUpdateReplyFoundJob.runJob(SearchUpdateReplyFoundJob.java:118)
        at net.i2p.router.JobQueueRunner.runCurrentJob(JobQueueRunner.java:138)
        at net.i2p.router.JobQueueRunner.run(JobQueueRunner.java:79)
        at java.lang.Thread.run(Thread.java:856)
        at net.i2p.util.I2PThread.run(I2PThread.java:85)
CRIT  [JobQueue 1/1] net.i2p.router.JobQueueRunner : Error processing job [Update Reply Found for Kademlia Search] on thread 0: n must be positive
java.lang.IllegalArgumentException: n must be positive
        at net.i2p.util.FortunaRandomSource.signedNextInt(FortunaRandomSource.java:86)
        at net.i2p.util.FortunaRandomSource.nextInt(FortunaRandomSource.java:71)
        at net.i2p.router.util.RandomIterator.next(RandomIterator.java:116)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector$FloodfillSelectionCollector.get(FloodfillPeerSelector.java:353)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector.selectNearestExplicitThin(FloodfillPeerSelector.java:88)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector.selectNearestExplicitThin(FloodfillPeerSelector.java:67)
        at net.i2p.router.networkdb.kademlia.PeerSelector.selectNearestExplicit(PeerSelector.java:58)
        at net.i2p.router.networkdb.kademlia.ExploreJob.buildMessage(ExploreJob.java:121)
        at net.i2p.router.networkdb.kademlia.SearchJob.sendLeaseSearch(SearchJob.java:424)
        at net.i2p.router.networkdb.kademlia.SearchJob.sendSearch(SearchJob.java:390)
        at net.i2p.router.networkdb.kademlia.SearchJob.continueSearch(SearchJob.java:312)
        at net.i2p.router.networkdb.kademlia.SearchJob.searchNext(SearchJob.java:219)
        at net.i2p.router.networkdb.kademlia.SearchUpdateReplyFoundJob.runJob(SearchUpdateReplyFoundJob.java:118)
        at net.i2p.router.JobQueueRunner.runCurrentJob(JobQueueRunner.java:138)
        at net.i2p.router.JobQueueRunner.run(JobQueueRunner.java:79)
        at java.lang.Thread.run(Thread.java:856)
        at net.i2p.util.I2PThread.run(I2PThread.java:85)
CRIT  [JobQueue 1/1] net.i2p.router.JobQueueRunner : Error processing job [Kademlia NetDb Explore] on thread 0: Invalid index 128, size is 68
java.lang.IndexOutOfBoundsException: Invalid index 128, size is 68
        at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
        at java.util.ArrayList.get(ArrayList.java:304)
        at net.i2p.router.util.RandomIterator.next(RandomIterator.java:136)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector$FloodfillSelectionCollector.get(FloodfillPeerSelector.java:353)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector.selectNearestExplicitThin(FloodfillPeerSelector.java:88)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector.selectNearestExplicitThin(FloodfillPeerSelector.java:67)
        at net.i2p.router.networkdb.kademlia.PeerSelector.selectNearestExplicit(PeerSelector.java:58)
        at net.i2p.router.networkdb.kademlia.ExploreJob.buildMessage(ExploreJob.java:121)
        at net.i2p.router.networkdb.kademlia.SearchJob.sendLeaseSearch(SearchJob.java:424)
        at net.i2p.router.networkdb.kademlia.SearchJob.sendSearch(SearchJob.java:390)
        at net.i2p.router.networkdb.kademlia.SearchJob.continueSearch(SearchJob.java:312)
        at net.i2p.router.networkdb.kademlia.SearchJob.searchNext(SearchJob.java:219)
        at net.i2p.router.networkdb.kademlia.SearchJob.runJob(SearchJob.java:111)
        at net.i2p.router.JobQueueRunner.runCurrentJob(JobQueueRunner.java:138)
        at net.i2p.router.JobQueueRunner.run(JobQueueRunner.java:79)
        at java.lang.Thread.run(Thread.java:856)
        at net.i2p.util.I2PThread.run(I2PThread.java:85)
CRIT  [JobQueue 3/3] net.i2p.router.JobQueueRunner : Error processing job [Update Reply Found for Kademlia Search] on thread 2: Invalid index 128, size is 66
java.lang.IndexOutOfBoundsException: Invalid index 128, size is 66
        at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
        at java.util.ArrayList.get(ArrayList.java:304)
        at net.i2p.router.util.RandomIterator.next(RandomIterator.java:136)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector$FloodfillSelectionCollector.get(FloodfillPeerSelector.java:353)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector.selectNearestExplicitThin(FloodfillPeerSelector.java:88)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector.selectNearestExplicitThin(FloodfillPeerSelector.java:67)
        at net.i2p.router.networkdb.kademlia.PeerSelector.selectNearestExplicit(PeerSelector.java:58)
        at net.i2p.router.networkdb.kademlia.ExploreJob.buildMessage(ExploreJob.java:121)
        at net.i2p.router.networkdb.kademlia.SearchJob.sendLeaseSearch(SearchJob.java:424)
        at net.i2p.router.networkdb.kademlia.SearchJob.sendSearch(SearchJob.java:390)
        at net.i2p.router.networkdb.kademlia.SearchJob.continueSearch(SearchJob.java:312)
        at net.i2p.router.networkdb.kademlia.SearchJob.searchNext(SearchJob.java:219)
        at net.i2p.router.networkdb.kademlia.SearchUpdateReplyFoundJob.runJob(SearchUpdateReplyFoundJob.java:118)
        at net.i2p.router.JobQueueRunner.runCurrentJob(JobQueueRunner.java:138)
        at net.i2p.router.JobQueueRunner.run(JobQueueRunner.java:79)
        at java.lang.Thread.run(Thread.java:856)
        at net.i2p.util.I2PThread.run(I2PThread.java:85)
CRIT  [JobQueue 3/3] net.i2p.router.JobQueueRunner : Error processing job [Update Reply Found for Kademlia Search] on thread 2: Invalid index 128, size is 67
java.lang.IndexOutOfBoundsException: Invalid index 128, size is 67
        at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
        at java.util.ArrayList.get(ArrayList.java:304)
        at net.i2p.router.util.RandomIterator.next(RandomIterator.java:136)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector$FloodfillSelectionCollector.get(FloodfillPeerSelector.java:353)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector.selectNearestExplicitThin(FloodfillPeerSelector.java:88)
        at net.i2p.router.networkdb.kademlia.FloodfillPeerSelector.selectNearestExplicitThin(FloodfillPeerSelector.java:67)
        at net.i2p.router.networkdb.kademlia.PeerSelector.selectNearestExplicit(PeerSelector.java:58)
        at net.i2p.router.networkdb.kademlia.ExploreJob.buildMessage(ExploreJob.java:121)
        at net.i2p.router.networkdb.kademlia.SearchJob.sendLeaseSearch(SearchJob.java:424)
        at net.i2p.router.networkdb.kademlia.SearchJob.sendSearch(SearchJob.java:390)

Subtickets

Change History (5)

comment:1 Changed 7 years ago by zzz

Appears to be an ICS-only Android bug, unrelated to any recent router change: http://code.google.com/p/android/issues/detail?id=31036 - please confirm ICS only?

If so, this workaround should fix it (untested) http://pastethis.i2p/show/1741/ - please test.

comment:2 Changed 7 years ago by zzz

@sponge

You reported on IRC that it is, for now, Android-only and ICS-only. As your trace is always at a multiple of 64 (e.g. 128) it's pretty clear to me this is exactly the android bug above, and not some wider problem as you have speculated on IRC.

I've included the workaround from paste 1741 in 0.9.1-21.

Also, to make it super-easy, I've included the test case from the android ticket above. It will run once on class load. It will indicate if it has run in System.out. If it detects the bug it will report on System.err.

Reassigning to you for testing. Please close on success or assign back to me on failure.

comment:3 Changed 7 years ago by zzz

Owner: changed from zzz to sponge
Status: newassigned

comment:4 Changed 7 years ago by Zlatin Balevsky

Wouldn't it be easier to just use http://zzz.i2p/topics/1114

comment:5 Changed 7 years ago by sponge

Resolution: fixed
Status: assignedclosed

patch/detection works

Note: See TracTickets for help on using tickets.