#2196 closed defect (fixed)

Fresh installation of I2P on Raspberry Pi cannot seed any nodes (ConcurrentModificationException on removeBlacklistedCerts)

Reported by: foobar Owned by: zzz
Priority: blocker Milestone: 0.9.34
Component: api/crypto Version: 0.9.33
Keywords: Cc:
Parent Tickets: Sensitive: no

Description

Hi,

I installed I2P on a fresh installation of a Raspberry Pi 3. It runs newest Raspbian:

# cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

I use the official debian packages:

# cat /etc/apt/sources.list.d/i2p.list 
deb https://deb.i2p2.de/ stretch main
deb-src https://deb.i2p2.de/ stretch main

It runs 0.9.33:

# dpkg --list | grep i2p
ii  i2p                             0.9.33-1ubuntu1              all          Anonymous network (I2P)
ii  i2p-keyring                     2017.09.21                   all          GnuPG keys of the I2P package repository
ii  i2p-router                      0.9.33-1ubuntu1              all          Router for I2P

Now when I2P starts the first time, it tries to seed from the default list of URls. This fails:

2018/03/31 19:36:34 | --> Wrapper Started as Daemon
2018/03/31 19:36:34 | Java Service Wrapper Community Edition 32-bit 3.5.30
2018/03/31 19:36:34 |   Copyright (C) 1999-2016 Tanuki Software, Ltd. All Rights Reserved.
2018/03/31 19:36:34 |     http://wrapper.tanukisoftware.com
2018/03/31 19:36:34 | 
2018/03/31 19:36:34 | Launching a JVM...
2018/03/31 19:36:35 | WrapperManager: Initializing...
2018/03/31 19:36:37 | Starting I2P 0.9.33-0-1ubuntu1
2018/03/31 19:36:38 | INFO: Locally optimized native BigInteger library loaded from file
2018/03/31 19:36:39 | Warning: Java version: 9-Raspbian OS: Linux arm 4.14.30-v7+
2018/03/31 19:36:39 | Warning: OpenJDK is not recommended for ARM. Use Oracle Java 8
2018/03/31 19:36:39 | Warning: Java 9 support is beta, and not recommended for general use
2018/03/31 19:36:40 | Reseed start
2018/03/31 19:36:40 | Reseeding from https://i2p.mooo.com/netDb/i2pseeds.su3
2018/03/31 19:36:42 | Error reseeding from https://i2p.mooo.com/netDb/i2pseeds.su3: java.util.ConcurrentModificationException
2018/03/31 19:36:42 | Reseed got 0 router infos from https://i2p.mooo.com/netDb/i2pseeds.su3 with 1 errors
......repeats for every source......

From the router log:

31/03/2018, 19:56:22 ERROR [Reseed      ] uter.networkdb.reseed.Reseeder: Error reseeding from https://reseed.onion.im/i2pseeds.su3
java.util.ConcurrentModificationException
	at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:719)
	at java.base/java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:741)
	at java.base/java.util.Collections$3.nextElement(Collections.java:5251)
	at net.i2p.crypto.KeyStoreUtil.removeBlacklistedCerts(KeyStoreUtil.java:297)
	at net.i2p.crypto.KeyStoreUtil.loadSystemKeyStore(KeyStoreUtil.java:214)
	at net.i2p.util.SSLEepGet.initSSLContext(SSLEepGet.java:371)
	at net.i2p.util.SSLEepGet.<init>(SSLEepGet.java:247)
	at net.i2p.util.SSLEepGet.<init>(SSLEepGet.java:144)
	at net.i2p.util.SSLEepGet.<init>(SSLEepGet.java:134)
	at net.i2p.router.networkdb.reseed.Reseeder$ReseedRunner.fetchURL(Reseeder.java:1032)
	at net.i2p.router.networkdb.reseed.Reseeder$ReseedRunner.reseedSU3OrZip(Reseeder.java:781)
	at net.i2p.router.networkdb.reseed.Reseeder$ReseedRunner.reseedSU3(Reseeder.java:743)
	at net.i2p.router.networkdb.reseed.Reseeder$ReseedRunner.run2(Reseeder.java:345)
	at net.i2p.router.networkdb.reseed.Reseeder$ReseedRunner.run(Reseeder.java:329)
	at java.base/java.lang.Thread.run(Thread.java:844)
	at net.i2p.util.I2PThread.run(I2PThread.java:103)

Without looking at the code, looks like a removal from a Map without using an iterator.

This happens also if I manually add a URL. This means, I cannot bootstrap my router at all right now on this vanilla Raspberry Pi installation.

Subtickets

Change History (3)

comment:1 Changed 19 months ago by zzz

Component: unspecifiedapi/crypto
Milestone: undecided0.9.34
Owner: set to zzz
Status: newaccepted

Haven't seen before. I think Java 9 contains a reworked Keystore implementation. As it says in the logs, Java 9 support is beta.

I see what we're doing wrong, we're deleting certs inside the iterator. I'll get a fix in at the last minute for 0.9.34. As a workaround you could try Java 8, but no guarantees.

comment:2 Changed 19 months ago by zzz

Please provide full version information from top of /logs in the console.

comment:3 Changed 19 months ago by zzz

Resolution: fixed
Status: acceptedclosed

Could not reproduce with x86 OpenJDK build 9-Ubuntu+0-9b181-4 or build 1.8.0_151-8u151-b12-0ubuntu0.17.10.2-b12 before or after fix
Fixed in 8565203da08bdc697d0c755787df25f240527535 0.9.33-22-rc

Note: See TracTickets for help on using tickets.