Program: 170979
Project: 170979
Buggy source:
@Override protected OperationContext tick(OperationContext operationContext){
  final String operationName=operationContext.operation.getName();
  Poller poller=new Poller(worker.config.getOperationPollPeriod(),() -> {
    boolean success=worker.instance.pollOperation(operationName,ExecuteOperationMetadata.Stage.EXECUTING);
    return success;
  }
);
  new Thread(poller).start();
  ActionResult.Builder resultBuilder;
  try {
    resultBuilder=operationContext.operation.getResponse().unpack(ExecuteResponse.class).getResult().toBuilder();
  }
 catch (  InvalidProtocolBufferException ex) {
    poller.stop();
    return null;
  }
  int inlineContentBytes=0;
  ImmutableList.Builder<ByteString> contents=new ImmutableList.Builder<>();
  CASInsertionPolicy policy=worker.config.getFileCasPolicy();
  for (  String outputFile : operationContext.action.getOutputFilesList()) {
    Path outputPath=operationContext.execDir.resolve(outputFile);
    if (!Files.exists(outputPath)) {
      continue;
    }
    ByteString content;
    try {
      InputStream inputStream=Files.newInputStream(outputPath);
      content=ByteString.readFrom(inputStream);
      inputStream.close();
    }
 catch (    IOException ex) {
      continue;
    }
    OutputFile.Builder outputFileBuilder=resultBuilder.addOutputFilesBuilder().setPath(outputFile).setIsExecutable(Files.isExecutable(outputPath));
    inlineContentBytes=inlineOrDigest(content,worker.config.getFileCasPolicy(),contents,inlineContentBytes,worker.config.getInlineContentLimit(),() -> outputFileBuilder.setContent(content),(fileContent) -> outputFileBuilder.setDigest(getDigestUtil().compute(fileContent)));
  }
  inlineContentBytes+=updateActionResultStdOutputs(resultBuilder,contents,inlineContentBytes);
  try {
    worker.instance.putAllBlobs(contents.build());
  }
 catch (  IOException ex) {
  }
catch (  InterruptedException ex) {
    poller.stop();
    return null;
  }
  ActionResult result=resultBuilder.build();
  if (!operationContext.action.getDoNotCache() && resultBuilder.getExitCode() == 0) {
    worker.instance.putActionResult(digestUtil.asActionKey(operationContext.metadata.getActionDigest()),result);
  }
  ExecuteOperationMetadata metadata=operationContext.metadata.toBuilder().setStage(ExecuteOperationMetadata.Stage.COMPLETED).build();
  Operation operation=operationContext.operation.toBuilder().setDone(true).setMetadata(Any.pack(metadata)).setResponse(Any.pack(ExecuteResponse.newBuilder().setResult(result).setCachedResult(false).build())).build();
  poller.stop();
  if (!worker.instance.putOperation(operation)) {
    return null;
  }
  return new OperationContext(operation,operationContext.execDir,metadata,operationContext.action,operationContext.inputFiles);
}

Fixed version (ground truth):
@Override protected OperationContext tick(OperationContext operationContext){
  final String operationName=operationContext.operation.getName();
  Poller poller=new Poller(worker.config.getOperationPollPeriod(),() -> {
    boolean success=worker.instance.pollOperation(operationName,ExecuteOperationMetadata.Stage.EXECUTING);
    return success;
  }
);
  new Thread(poller).start();
  ActionResult.Builder resultBuilder;
  try {
    resultBuilder=operationContext.operation.getResponse().unpack(ExecuteResponse.class).getResult().toBuilder();
  }
 catch (  InvalidProtocolBufferException ex) {
    poller.stop();
    return null;
  }
  int inlineContentBytes=0;
  ImmutableList.Builder<ByteString> contents=new ImmutableList.Builder<>();
  CASInsertionPolicy policy=worker.config.getFileCasPolicy();
  for (  String outputFile : operationContext.action.getOutputFilesList()) {
    Path outputPath=operationContext.execDir.resolve(outputFile);
    if (!Files.exists(outputPath)) {
      continue;
    }
    ByteString content;
    try {
      InputStream inputStream=Files.newInputStream(outputPath);
      content=ByteString.readFrom(inputStream);
      inputStream.close();
    }
 catch (    IOException ex) {
      continue;
    }
    OutputFile.Builder outputFileBuilder=resultBuilder.addOutputFilesBuilder().setPath(outputFile).setIsExecutable(Files.isExecutable(outputPath));
    inlineContentBytes=inlineOrDigest(content,worker.config.getFileCasPolicy(),contents,inlineContentBytes,worker.config.getInlineContentLimit(),() -> outputFileBuilder.setContent(content),(fileContent) -> outputFileBuilder.setDigest(getDigestUtil().compute(fileContent)));
  }
  inlineContentBytes+=updateActionResultStdOutputs(resultBuilder,contents,inlineContentBytes);
  try {
    worker.instance.putAllBlobs(contents.build());
  }
 catch (  IOException ex) {
  }
catch (  InterruptedException ex) {
    poller.stop();
    return null;
  }
  ActionResult result=resultBuilder.build();
  if (!operationContext.action.getDoNotCache() && resultBuilder.getExitCode() == 0) {
    worker.instance.putActionResult(getDigestUtil().asActionKey(operationContext.metadata.getActionDigest()),result);
  }
  ExecuteOperationMetadata metadata=operationContext.metadata.toBuilder().setStage(ExecuteOperationMetadata.Stage.COMPLETED).build();
  Operation operation=operationContext.operation.toBuilder().setDone(true).setMetadata(Any.pack(metadata)).setResponse(Any.pack(ExecuteResponse.newBuilder().setResult(result).setCachedResult(false).build())).build();
  poller.stop();
  if (!worker.instance.putOperation(operation)) {
    return null;
  }
  return new OperationContext(operation,operationContext.execDir,metadata,operationContext.action,operationContext.inputFiles);
}