Program: 89502
Project: 89502
Buggy source:
public synchronized void updateCrawlLog(byte[] tmpBuf){
  long pos;
  long to;
  int idx;
  boolean bLoop;
  ByteRange byteRange;
  try {
    if (bActive && !bInitialized) {
      init();
    }
    if (bActive && bInitialized) {
      bLoop=true;
      while (bLoop) {
        idxRaf.seek(idxRaf.length());
        pos=logRaf.length();
        to=pos;
        if (jobResult != null && jobResult.job != null && jobResult.job.crawlLogFilePath != null) {
          StreamResult anypathResult=h3wrapper.anypath(jobResult.job.crawlLogFilePath,pos,pos + tmpBuf.length - 1);
          if (anypathResult != null && anypathResult.byteRange != null && anypathResult.in != null) {
            byteRange=anypathResult.byteRange;
            if (byteRange.contentLength > 0) {
              logRaf.seek(pos);
              int read;
              try {
                while ((read=anypathResult.in.read(tmpBuf)) != -1) {
                  logRaf.write(tmpBuf,0,read);
                  to+=read;
                  idx=0;
                  while (read > 0) {
                    ++pos;
                    --read;
                    if (tmpBuf[idx++] == '\n') {
                      idxRaf.writeLong(pos);
                      lastIndexed=pos;
                      totalCachedLines++;
                    }
                  }
                }
              }
 catch (              IOException e) {
                e.printStackTrace();
              }
              IOUtils.closeQuietly(anypathResult);
              if (byteRange.contentLength == to) {
                bLoop=false;
              }
            }
 else {
              bLoop=false;
            }
          }
 else {
            bLoop=false;
          }
        }
 else {
          bLoop=false;
        }
      }
    }
  }
 catch (  Throwable t) {
  }
}

Fixed version (ground truth):
public synchronized void updateCrawlLog(byte[] tmpBuf){
  long pos;
  long to;
  int idx;
  boolean bLoop;
  ByteRange byteRange;
  try {
    if (bActive && !bInitialized) {
      init();
    }
    if (bActive && bInitialized) {
      bLoop=true;
      while (bLoop) {
        idxRaf.seek(idxRaf.length());
        pos=logRaf.length();
        to=pos;
        if (jobResult != null && jobResult.job != null && jobResult.job.crawlLogFilePath != null) {
          long rangeFrom=pos;
          long rangeTo=pos + tmpBuf.length - 1;
          StreamResult anypathResult=h3wrapper.anypath(jobResult.job.crawlLogFilePath,null,null,true);
          LOG.info("String_Node_Str",jobId,anypathResult.contentLength);
          if (anypathResult != null && rangeFrom < anypathResult.contentLength) {
            if (rangeTo > anypathResult.contentLength) {
              rangeTo=anypathResult.contentLength;
            }
            anypathResult=h3wrapper.anypath(jobResult.job.crawlLogFilePath,rangeFrom,rangeTo);
            LOG.info("String_Node_Str",jobId,rangeFrom,rangeTo);
            if (anypathResult != null && anypathResult.byteRange != null && anypathResult.in != null) {
              byteRange=anypathResult.byteRange;
              if (byteRange.contentLength > 0) {
                logRaf.seek(pos);
                int read;
                try {
                  while ((read=anypathResult.in.read(tmpBuf)) != -1) {
                    logRaf.write(tmpBuf,0,read);
                    to+=read;
                    idx=0;
                    while (read > 0) {
                      ++pos;
                      --read;
                      if (tmpBuf[idx++] == '\n') {
                        idxRaf.writeLong(pos);
                        lastIndexed=pos;
                        totalCachedLines++;
                      }
                    }
                  }
                }
 catch (                IOException e) {
                  e.printStackTrace();
                }
                IOUtils.closeQuietly(anypathResult);
                if (byteRange.contentLength == to) {
                  bLoop=false;
                }
              }
 else {
                bLoop=false;
              }
            }
 else {
              bLoop=false;
            }
          }
 else {
            bLoop=false;
          }
        }
 else {
          bLoop=false;
        }
      }
    }
  }
 catch (  Throwable t) {
  }
}