Program: 70553
Project: 70553
Buggy source:
private synchronized byte[] generateTsFiles(final String reqFileName,final long streamId) throws InterruptedException {
  final String wavFileName=reqFileName.replace("String_Node_Str","String_Node_Str");
  final OssUtil ossOperation=new OssUtil();
  ObjectMetadata objectMetadata=ossOperation.getObjectMetadata(wavFileName,streamId);
  final AacTranscodingTsSegmenter tsSegmenter=new AacTranscodingTsSegmenter();
  final int tsNum=tsSegmenter.calcTsNum((int)objectMetadata.getContentLength());
  StringBuilder m3u8=new StringBuilder();
  m3u8.append("String_Node_Str" + AacTranscodingTsSegmenter.TS_DURATION + "String_Node_Str"+ 1);
  for (int i=0; i < tsNum; i++) {
    m3u8.append("String_Node_Str" + tsSegmenter.getTsSegTime() + "String_Node_Str"+ reqFileName.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ i+ "String_Node_Str");
  }
  m3u8.append("String_Node_Str");
  ossOperation.uploadObject(m3u8.toString().getBytes(),reqFileName,streamId);
  executor.execute(new Runnable(){
    private int readBytes(    InputStream inputStream,    byte[] outputBuf) throws IOException {
      int length=outputBuf.length;
      int frameBufPtr=0;
      int len;
      while (frameBufPtr < length) {
        len=inputStream.read(outputBuf,frameBufPtr,length - frameBufPtr);
        if (len == -1) {
          if (frameBufPtr == 0) {
            return -1;
          }
          Arrays.fill(outputBuf,frameBufPtr,length,(byte)0x0);
          break;
        }
        frameBufPtr+=len;
      }
      return frameBufPtr;
    }
    @Override public void run(){
      List<String> cachedTsName=new ArrayList<>();
      byte[] frameBuf=new byte[2048];
      byte[] tsSegment;
      InputStream inputStream=ossOperation.readObject(wavFileName,streamId);
      try {
        long beginTime=System.currentTimeMillis();
        for (int i=0; i < tsNum; ) {
          if (readBytes(inputStream,frameBuf) > 0) {
            tsSegment=tsSegmenter.getTsBuf(V5PacketType.PCM_STREAM,frameBuf,null);
          }
 else {
            tsSegment=tsSegmenter.getTsBuf(V5PacketType.PCM_STREAM,FaacUtils.ZERO_PCM_DATA,null);
          }
          if (tsSegment != null) {
            StringBuffer tsNameSb=new StringBuffer();
            tsNameSb.append(reqFileName.replace("String_Node_Str","String_Node_Str")).append("String_Node_Str").append(i).append("String_Node_Str");
            String tsName=tsNameSb.toString();
            if (i < 5) {
              cachedTsName.add(tsName);
              cachedVodTsFiles.put(tsName,tsSegment);
              if (i == 4) {
synchronized (_lock) {
                  _lock.notifyAll();
                }
              }
            }
 else {
              ossOperation.uploadObject(tsSegment,tsName,streamId);
            }
            i++;
          }
        }
synchronized (_lock) {
          _lock.notifyAll();
        }
        for (        String name : cachedTsName) {
          byte[] ts=cachedVodTsFiles.get(name);
          ossOperation.uploadObject(ts,name,streamId);
          cachedVodTsFiles.remove(name);
        }
        long endTime=System.currentTimeMillis();
        LOGGER.debug("String_Node_Str" + reqFileName + "String_Node_Str"+ tsNum+ "String_Node_Str"+ ((endTime - beginTime) / 1000.0)+ "String_Node_Str");
      }
 catch (      IOException e1) {
        LOGGER.error("String_Node_Str",e1);
        ossOperation.deleteObject(reqFileName,streamId);
      }
 finally {
        ossOperation.closeOSSClient();
        tsSegmenter.close();
      }
    }
  }
);
synchronized (_lock) {
    _lock.wait(1000);
  }
synchronized (m3u8WaiteSet) {
    m3u8WaiteSet.remove(reqFileName);
    m3u8WaiteSet.notifyAll();
  }
  return m3u8.toString().getBytes();
}

Fixed version (ground truth):
private synchronized byte[] generateTsFiles(final String reqFileName,final long streamId) throws InterruptedException {
  final String wavFileName=reqFileName.replace("String_Node_Str","String_Node_Str");
  final OssUtil ossOperation=new OssUtil();
  ObjectMetadata objectMetadata=ossOperation.getObjectMetadata(wavFileName,streamId);
  final AacTranscodingTsSegmenter tsSegmenter=new AacTranscodingTsSegmenter();
  final int tsNum=tsSegmenter.calcTsNum((int)objectMetadata.getContentLength());
  HlsLiveStream stream=HlsLiveStreamMagr.INSTANCE().getHlsLiveStreamById(streamId);
  float sampleRate=stream != null ? stream.getSampleRate() : 8000F;
  StringBuilder m3u8=new StringBuilder();
  m3u8.append("String_Node_Str" + AacTranscodingTsSegmenter.TS_DURATION + "String_Node_Str"+ 1);
  for (int i=0; i < tsNum; i++) {
    m3u8.append("String_Node_Str" + tsSegmenter.calcTsSegTime(sampleRate) + "String_Node_Str"+ reqFileName.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ i+ "String_Node_Str");
  }
  m3u8.append("String_Node_Str");
  ossOperation.uploadObject(m3u8.toString().getBytes(),reqFileName,streamId);
  executor.execute(new Runnable(){
    private int readBytes(    InputStream inputStream,    byte[] outputBuf) throws IOException {
      int length=outputBuf.length;
      int frameBufPtr=0;
      int len;
      while (frameBufPtr < length) {
        len=inputStream.read(outputBuf,frameBufPtr,length - frameBufPtr);
        if (len == -1) {
          if (frameBufPtr == 0) {
            return -1;
          }
          Arrays.fill(outputBuf,frameBufPtr,length,(byte)0x0);
          break;
        }
        frameBufPtr+=len;
      }
      return frameBufPtr;
    }
    @Override public void run(){
      List<String> cachedTsName=new ArrayList<>();
      byte[] frameBuf=new byte[2048];
      byte[] tsSegment;
      InputStream inputStream=ossOperation.readObject(wavFileName,streamId);
      try {
        long beginTime=System.currentTimeMillis();
        for (int i=0; i < tsNum; ) {
          if (readBytes(inputStream,frameBuf) > 0) {
            tsSegment=tsSegmenter.getTsBuf(V5PacketType.PCM_STREAM,frameBuf,null);
          }
 else {
            tsSegment=tsSegmenter.getTsBuf(V5PacketType.PCM_STREAM,FaacUtils.ZERO_PCM_DATA,null);
          }
          if (tsSegment != null) {
            StringBuffer tsNameSb=new StringBuffer();
            tsNameSb.append(reqFileName.replace("String_Node_Str","String_Node_Str")).append("String_Node_Str").append(i).append("String_Node_Str");
            String tsName=tsNameSb.toString();
            if (i < 5) {
              cachedTsName.add(tsName);
              cachedVodTsFiles.put(tsName,tsSegment);
              if (i == 4) {
synchronized (_lock) {
                  _lock.notifyAll();
                }
              }
            }
 else {
              ossOperation.uploadObject(tsSegment,tsName,streamId);
            }
            i++;
          }
        }
synchronized (_lock) {
          _lock.notifyAll();
        }
        for (        String name : cachedTsName) {
          byte[] ts=cachedVodTsFiles.get(name);
          ossOperation.uploadObject(ts,name,streamId);
          cachedVodTsFiles.remove(name);
        }
        long endTime=System.currentTimeMillis();
        LOGGER.debug("String_Node_Str" + reqFileName + "String_Node_Str"+ tsNum+ "String_Node_Str"+ ((endTime - beginTime) / 1000.0)+ "String_Node_Str");
      }
 catch (      IOException e1) {
        LOGGER.error("String_Node_Str",e1);
        ossOperation.deleteObject(reqFileName,streamId);
      }
 finally {
        ossOperation.closeOSSClient();
        tsSegmenter.close();
      }
    }
  }
);
synchronized (_lock) {
    _lock.wait(1000);
  }
synchronized (m3u8WaiteSet) {
    m3u8WaiteSet.remove(reqFileName);
    m3u8WaiteSet.notifyAll();
  }
  return m3u8.toString().getBytes();
}