java.lang.ArithmeticException: / by zero

JIRA | Olaf Freyer | 10 years ago
  1. 0

    java.lang.ArithmeticException: / by zero Stacktrace: java.lang.ArithmeticException: / by zero at org.archive.io.RecordingOutputStream.checkLimits(RecordingOutputStream.java:271) at org.archive.io.RecordingOutputStream.write(RecordingOutputStream.java:225) at org.archive.io.RecordingInputStream.read(RecordingInputStream.java:104) at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78) at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106) at org.apache.commons.httpclient.HttpParser.parseHeaders(HttpParser.java:166) at org.apache.commons.httpclient.HttpMethodBase.readResponseHeaders(HttpMethodBase.java:1810) at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1614) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1002) at org.archive.httpclient.HttpRecorderGetMethod.execute(HttpRecorderGetMethod.java:116) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) at org.archive.crawler.fetcher.FetchHTTP.innerProcess(FetchHTTP.java:500) at org.archive.crawler.framework.Processor.process(Processor.java:109) at org.archive.crawler.framework.ToeThread.processCrawlUri(ToeThread.java:302) at org.archive.crawler.framework.ToeThread.run(ToeThread.java:151) At first I considered that exception impossible to happen... Unfortunatly its not ;-) Here is basically what happened: long startTime = System.currentTimeMillis(); --> System time gets corrected via ntp a few (milli)seconds into the past long duration = System.currentTimeMillis() - startTime + 1; // !divzero if(position/duration > maxRateBytesPerMs) { --> kaboom (cause duration was 0 even though we thought we were smart and simply added 1) Thanks alot for attending this lecture of "don't consider time a strictly monotonic increasing function"... Regards Olaf Freyer

    JIRA | 10 years ago | Olaf Freyer
    java.lang.ArithmeticException: / by zero
  2. 0

    java.lang.ArithmeticException: / by zero Stacktrace: java.lang.ArithmeticException: / by zero at org.archive.io.RecordingOutputStream.checkLimits(RecordingOutputStream.java:271) at org.archive.io.RecordingOutputStream.write(RecordingOutputStream.java:225) at org.archive.io.RecordingInputStream.read(RecordingInputStream.java:104) at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78) at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106) at org.apache.commons.httpclient.HttpParser.parseHeaders(HttpParser.java:166) at org.apache.commons.httpclient.HttpMethodBase.readResponseHeaders(HttpMethodBase.java:1810) at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1614) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1002) at org.archive.httpclient.HttpRecorderGetMethod.execute(HttpRecorderGetMethod.java:116) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) at org.archive.crawler.fetcher.FetchHTTP.innerProcess(FetchHTTP.java:500) at org.archive.crawler.framework.Processor.process(Processor.java:109) at org.archive.crawler.framework.ToeThread.processCrawlUri(ToeThread.java:302) at org.archive.crawler.framework.ToeThread.run(ToeThread.java:151) At first I considered that exception impossible to happen... Unfortunatly its not ;-) Here is basically what happened: long startTime = System.currentTimeMillis(); --> System time gets corrected via ntp a few (milli)seconds into the past long duration = System.currentTimeMillis() - startTime + 1; // !divzero if(position/duration > maxRateBytesPerMs) { --> kaboom (cause duration was 0 even though we thought we were smart and simply added 1) Thanks alot for attending this lecture of "don't consider time a strictly monotonic increasing function"... Regards Olaf Freyer

    JIRA | 10 years ago | Olaf Freyer
    java.lang.ArithmeticException: / by zero
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Report

    GitHub | 1 year ago | jsql-robot
    java.lang.ArithmeticException: / by zero
  5. 0

    [1.10.2] Crash on loading world

    GitHub | 3 months ago | Messorix
    java.lang.ArithmeticException: / by zero

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ArithmeticException

      / by zero

      at org.archive.io.RecordingOutputStream.checkLimits()
    2. webarchive-commons
      RecordingInputStream.read
      1. org.archive.io.RecordingOutputStream.checkLimits(RecordingOutputStream.java:271)
      2. org.archive.io.RecordingOutputStream.write(RecordingOutputStream.java:225)
      3. org.archive.io.RecordingInputStream.read(RecordingInputStream.java:104)
      3 frames
    3. HttpClient
      HttpMethodBase.execute
      1. org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
      2. org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
      3. org.apache.commons.httpclient.HttpParser.parseHeaders(HttpParser.java:166)
      4. org.apache.commons.httpclient.HttpMethodBase.readResponseHeaders(HttpMethodBase.java:1810)
      5. org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1614)
      6. org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1002)
      6 frames
    4. webarchive-commons
      HttpRecorderGetMethod.execute
      1. org.archive.httpclient.HttpRecorderGetMethod.execute(HttpRecorderGetMethod.java:116)
      1 frame
    5. HttpClient
      HttpClient.executeMethod
      1. org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
      2. org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
      3. org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
      4. org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
      4 frames
    6. org.archive.crawler
      ToeThread.run
      1. org.archive.crawler.fetcher.FetchHTTP.innerProcess(FetchHTTP.java:500)
      2. org.archive.crawler.framework.Processor.process(Processor.java:109)
      3. org.archive.crawler.framework.ToeThread.processCrawlUri(ToeThread.java:302)
      4. org.archive.crawler.framework.ToeThread.run(ToeThread.java:151)
      4 frames