[tor-bugs] #19259 [Metrics/Onionoo]: uncaught NFE

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Jun 4 10:39:33 UTC 2016


#19259: uncaught NFE
---------------------------------+-----------------
     Reporter:  iwakeh           |      Owner:
         Type:  defect           |     Status:  new
     Priority:  High             |  Milestone:
    Component:  Metrics/Onionoo  |    Version:
     Severity:  Major            |   Keywords:
Actual Points:                   |  Parent ID:
       Points:                   |   Reviewer:
      Sponsor:                   |
---------------------------------+-----------------
 While waiting for OOM in #19249 I encountered this
 {{{
 Exception in thread "main" java.lang.NumberFormatException: For input
 string: "0,000086161974"
         at
 sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1250)
         at java.lang.Double.parseDouble(Double.java:540)
         at
 org.torproject.onionoo.docs.WeightsStatus.setFromDocumentString(WeightsStatus.java:71)
         at
 org.torproject.onionoo.docs.DocumentStore.retrieveParsedStatusFile(DocumentStore.java:500)
         at
 org.torproject.onionoo.docs.DocumentStore.retrieveDocumentFile(DocumentStore.java:484)
         at
 org.torproject.onionoo.docs.DocumentStore.retrieve(DocumentStore.java:363)
         at
 org.torproject.onionoo.updater.WeightsStatusUpdater.updateWeightsHistory(WeightsStatusUpdater.java:64)
         at
 org.torproject.onionoo.updater.WeightsStatusUpdater.processRelayNetworkConsensus(WeightsStatusUpdater.java:54)
         at
 org.torproject.onionoo.updater.WeightsStatusUpdater.processDescriptor(WeightsStatusUpdater.java:39)
         at
 org.torproject.onionoo.updater.DescriptorSource.readArchivedDescriptors(DescriptorSource.java:197)
         at
 org.torproject.onionoo.updater.DescriptorSource.readDescriptors(DescriptorSource.java:83)
         at org.torproject.onionoo.cron.Main.updateStatuses(Main.java:188)
         at org.torproject.onionoo.cron.Main.run(Main.java:122)
         at
 org.torproject.onionoo.cron.Main.runOrScheduleExecutions(Main.java:96)
         at org.torproject.onionoo.cron.Main.main(Main.java:32)

 }}}

 The code is
 [https://gitweb.torproject.org/onionoo.git/tree/src/main/java/org/torproject/onionoo/docs/WeightsStatus.java#n70
 here]:
 {{{
    double[] weights = new double[] { -1.0,
             Double.parseDouble(parts[5]),
             Double.parseDouble(parts[6]),
             Double.parseDouble(parts[7]),
             Double.parseDouble(parts[8]), -1.0, -1.0 };
 }}}

 Might be due to the locale of the server, but should be caught and logged.

 Maybe, use this ticket to scan the code for similar things?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/19259>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list