Opened 3 months ago

Closed 2 months ago

#2439 closed defect (worksforme)

Disabling NTCP1 causes NPEs

Reported by: Reportage Owned by: zzz
Priority: blocker Milestone: 0.9.39
Component: router/transport Version: 0.9.38
Keywords: NTCP1, NPE Cc:
Parent Tickets:

Description

    CRIT […Establisher] …blishmentManager: Error in the establisher
         java.lang.NullPointerException
         at net.i2p.router.transport.TransportManager.getNextBid(TransportManager.java:740)
         at net.i2p.router.transport.GetBidsJob.getBids(GetBidsJob.java:68)
         at net.i2p.router.transport.CommSystemFacadeImpl.processMessage(CommSystemFacadeImpl.java:154)
         at net.i2p.router.OutNetMessagePool.add(OutNetMessagePool.java:49)
         at net.i2p.router.transport.TransportImpl.afterSend(TransportImpl.java:323)
         at net.i2p.router.transport.TransportImpl.afterSend(TransportImpl.java:228)
         at net.i2p.router.transport.udp.UDPTransport.failed(UDPTransport.java:2618)
         at net.i2p.router.transport.udp.EstablishmentManager.processExpired(EstablishmentManager.java:1397)
         at net.i2p.router.transport.udp.EstablishmentManager.handleOutbound(EstablishmentManager.java:1320)
         at net.i2p.router.transport.udp.EstablishmentManager.access$1200(EstablishmentManager.java:40)
         at net.i2p.router.transport.udp.EstablishmentManager$Establisher.doPass(EstablishmentManager.java:1476)
         at net.i2p.router.transport.udp.EstablishmentManager$Establisher.run(EstablishmentManager.java:1436)
         at java.lang.Thread.run(Thread.java:748)

    CRIT […Handler 4/4] …ool.BuildHandler: B0rked in the tunnel handler
         java.lang.NullPointerException
         at net.i2p.router.transport.TransportManager.getNextBid(TransportManager.java:740)
         at net.i2p.router.transport.GetBidsJob.getBids(GetBidsJob.java:68)
         at net.i2p.router.transport.CommSystemFacadeImpl.processMessage(CommSystemFacadeImpl.java:154)
         at net.i2p.router.OutNetMessagePool.add(OutNetMessagePool.java:49)
         at net.i2p.router.tunnel.pool.BuildHandler.handleReq(BuildHandler.java:976)
         at net.i2p.router.tunnel.pool.BuildHandler.handleRequest(BuildHandler.java:534)
         at net.i2p.router.tunnel.pool.BuildHandler.handleInboundRequest(BuildHandler.java:274)
         at net.i2p.router.tunnel.pool.BuildHandler.run(BuildHandler.java:225)
         at java.lang.Thread.run(Thread.java:748)
         at net.i2p.util.I2PThread.run(I2PThread.java:103)

    CRIT […eTimer2 3/4] …til.SimpleTimer2: SimpleTimer2: Timed task net.i2p.router.tunnel.TunnelGateway$DelayedFlush@2c4b443e exited unexpectedly, please report
         java.lang.NullPointerException
         at net.i2p.router.transport.TransportManager.getNextBid(TransportManager.java:740)
         at net.i2p.router.transport.GetBidsJob.getBids(GetBidsJob.java:68)
         at net.i2p.router.transport.CommSystemFacadeImpl.processMessage(CommSystemFacadeImpl.java:154)
         at net.i2p.router.OutNetMessagePool.add(OutNetMessagePool.java:49)
         at net.i2p.router.tunnel.OutboundReceiver.send(OutboundReceiver.java:75)
         at net.i2p.router.tunnel.OutboundReceiver.receiveEncrypted(OutboundReceiver.java:49)
         at net.i2p.router.tunnel.OutboundSender.sendPreprocessed(OutboundSender.java:34)
         at net.i2p.router.tunnel.BatchedPreprocessor.send(BatchedPreprocessor.java:392)
         at net.i2p.router.tunnel.BatchedPreprocessor.preprocessQueue(BatchedPreprocessor.java:231)
         at net.i2p.router.tunnel.TunnelGateway$DelayedFlush.timeReached(TunnelGateway.java:214)
         at net.i2p.util.SimpleTimer2$TimedEvent.run2(SimpleTimer2.java:473)
         at net.i2p.util.SimpleTimer2$TimedEvent.run(SimpleTimer2.java:412)
         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
         at java.lang.Thread.run(Thread.java:748)

Subtickets

Change History (5)

comment:1 Changed 3 months ago by zzz

  • Status changed from new to infoneeded_new

Can't reproduce here, and TransportManager? line 740 is in the middle of a debug line, so that doesn't look right. Perhaps you have local changes in that file, or I'm looking at a different rev than you are? Or maybe the jars got overwritten while running?

comment:2 Changed 3 months ago by Reportage

  • Status changed from infoneeded_new to new

Line 740 here looks like this:
+ " (winning latency: " + rv.getLatencyMs() + " / " + rv + ")");

The errors don't appear immediately, only after the router has been running some time, and when they do occur, the router requires a restart as all tunnels catastrophically fail.

comment:3 Changed 3 months ago by zzz

Yeah that was the line for me as well. It doesn't look possible to me because:

  • Java would report line 739, not 740, as 740 is the 2nd half of the statement
  • It could only occur if you had DEBUG logging enabled for TransportManager? (did you?)
  • From looking at the code, I don't see how an NPE is possible. The variables t, bid,and rv cannot be null.

comment:4 Changed 3 months ago by Reportage

Don't recall if debug was enabled for TransportManager? logging, and the line indicated in the log doesn't of itself help much. When I looked for the source of the bug, the comment at the top of that section in the code was the only thing that seemed like it might have a bearing on things:
// we always want to try all transports, in case there is a faster bidirectional one

Are we still trying to bid on all transports even though NTCP1 is disabled?

comment:5 Changed 2 months ago by zzz

  • Resolution set to worksforme
  • Status changed from new to closed

Unable to reproduce, been running with NTCP1 disabled for weeks. As explained in comments 1 and 3, doesn't seem to be possible either, barring some odd JRE bug or jar corruption Please reopen if you figure it out.

Note: See TracTickets for help on using tickets.