Program: 110919
Project: 110919
Buggy source:
@Override public void run(){
  NodeEntry state=Preconditions.checkNotNull(graph.get(skyKey),skyKey);
  Preconditions.checkState(state.isReady(),"String_Node_Str",skyKey,state);
  if (maybeHandleDirtyNode(state) == DirtyOutcome.ALREADY_PROCESSED) {
    return;
  }
  Set<SkyKey> directDeps=state.getTemporaryDirectDeps();
  Preconditions.checkState(!directDeps.contains(ErrorTransienceValue.KEY),"String_Node_Str",skyKey,state);
  SkyFunctionEnvironment env=new SkyFunctionEnvironment(skyKey,directDeps,visitor);
  SkyFunctionName functionName=skyKey.functionName();
  SkyFunction factory=skyFunctions.get(functionName);
  Preconditions.checkState(factory != null,"String_Node_Str",functionName,state);
  SkyValue value=null;
  long startTime=BlazeClock.instance().nanoTime();
  try {
    value=factory.compute(skyKey,env);
  }
 catch (  final SkyFunctionException builderException) {
    ReifiedSkyFunctionException reifiedBuilderException=new ReifiedSkyFunctionException(builderException,skyKey);
    if (reifiedBuilderException.getRootCauseSkyKey().equals(skyKey)) {
      boolean shouldFailFast=!keepGoing || builderException.isCatastrophic();
      if (shouldFailFast) {
        if (!visitor.preventNewEvaluations()) {
          return;
        }
      }
      Map<SkyKey,NodeEntry> newlyRequestedDeps=graph.getBatch(env.newlyRequestedDeps);
      boolean isTransitivelyTransient=reifiedBuilderException.isTransient();
      for (      NodeEntry depEntry : Iterables.concat(env.directDeps.values(),newlyRequestedDeps.values())) {
        if (!isDoneForBuild(depEntry)) {
          continue;
        }
        ErrorInfo depError=depEntry.getErrorInfo();
        if (depError != null) {
          isTransitivelyTransient|=depError.isTransient();
        }
      }
      ErrorInfo errorInfo=ErrorInfo.fromException(reifiedBuilderException,isTransitivelyTransient);
      registerNewlyDiscoveredDepsForDoneEntry(skyKey,state,newlyRequestedDeps,env);
      env.setError(errorInfo,reifiedBuilderException.isTransient());
      env.commit(keepGoing);
      if (!shouldFailFast) {
        return;
      }
      throw SchedulerException.ofError(errorInfo,skyKey);
    }
  }
catch (  InterruptedException ie) {
    throw SchedulerException.ofInterruption(ie,skyKey);
  }
catch (  RuntimeException re) {
    String msg=prepareCrashMessage(skyKey,state.getInProgressReverseDeps());
    RuntimeException ex=new RuntimeException(msg,re);
    visitor.noteCrash(ex);
    throw ex;
  }
 finally {
    env.doneBuilding();
    long elapsedTimeNanos=BlazeClock.instance().nanoTime() - startTime;
    if (elapsedTimeNanos > 0) {
      if (progressReceiver != null) {
        progressReceiver.computed(skyKey,elapsedTimeNanos);
      }
      Profiler.instance().logSimpleTaskDuration(startTime,elapsedTimeNanos,ProfilerTask.SKYFUNCTION,skyKey);
    }
  }
  GroupedListHelper<SkyKey> newDirectDeps=env.newlyRequestedDeps;
  if (value != null) {
    Preconditions.checkState(!env.valuesMissing(),"String_Node_Str" + "String_Node_Str",skyKey,newDirectDeps,state);
    env.setValue(value);
    registerNewlyDiscoveredDepsForDoneEntry(skyKey,state,graph.getBatch(env.newlyRequestedDeps),env);
    env.commit(true);
    return;
  }
  if (env.getDepErrorKey() != null) {
    Preconditions.checkState(!keepGoing,"String_Node_Str",skyKey,state,env.getDepErrorKey());
    SkyKey childErrorKey=env.getDepErrorKey();
    NodeEntry childErrorEntry=Preconditions.checkNotNull(graph.get(childErrorKey),"String_Node_Str",skyKey,state,childErrorKey);
    Preconditions.checkState(!state.getTemporaryDirectDeps().contains(childErrorKey),"String_Node_Str",skyKey,state,childErrorKey,childErrorEntry);
    Preconditions.checkState(newDirectDeps.contains(childErrorKey),"String_Node_Str",state,childErrorKey,newDirectDeps);
    state.addTemporaryDirectDeps(GroupedListHelper.create(ImmutableList.of(childErrorKey)));
    DependencyState childErrorState=childErrorEntry.addReverseDepAndCheckIfDone(skyKey);
    Preconditions.checkState(childErrorState == DependencyState.DONE,"String_Node_Str",skyKey,state,childErrorKey,childErrorEntry);
    ErrorInfo childErrorInfo=Preconditions.checkNotNull(childErrorEntry.getErrorInfo());
    visitor.preventNewEvaluations();
    throw SchedulerException.ofError(childErrorInfo,childErrorKey);
  }
  state.addTemporaryDirectDeps(newDirectDeps);
  if (newDirectDeps.isEmpty()) {
    Preconditions.checkState(!env.childErrorInfos.isEmpty(),"String_Node_Str",skyKey,state);
    Preconditions.checkState(keepGoing,"String_Node_Str",skyKey,state,env.childErrorInfos);
    env.commit(true);
    return;
  }
  for (  Map.Entry<SkyKey,NodeEntry> e : graph.createIfAbsentBatch(newDirectDeps).entrySet()) {
    SkyKey newDirectDep=e.getKey();
    NodeEntry newDirectDepEntry=e.getValue();
    enqueueChild(skyKey,state,newDirectDep,newDirectDepEntry,false);
  }
}

Fixed version (ground truth):
@Override public void run(){
  NodeEntry state=Preconditions.checkNotNull(graph.get(skyKey),skyKey);
  Preconditions.checkState(state.isReady(),"String_Node_Str",skyKey,state);
  if (maybeHandleDirtyNode(state) == DirtyOutcome.ALREADY_PROCESSED) {
    return;
  }
  Set<SkyKey> directDeps=state.getTemporaryDirectDeps();
  Preconditions.checkState(!directDeps.contains(ErrorTransienceValue.KEY),"String_Node_Str",skyKey,state);
  SkyFunctionEnvironment env=new SkyFunctionEnvironment(skyKey,directDeps,visitor);
  SkyFunctionName functionName=skyKey.functionName();
  SkyFunction factory=skyFunctions.get(functionName);
  Preconditions.checkState(factory != null,"String_Node_Str",functionName,skyKey,state);
  SkyValue value=null;
  long startTime=BlazeClock.instance().nanoTime();
  try {
    value=factory.compute(skyKey,env);
  }
 catch (  final SkyFunctionException builderException) {
    ReifiedSkyFunctionException reifiedBuilderException=new ReifiedSkyFunctionException(builderException,skyKey);
    if (reifiedBuilderException.getRootCauseSkyKey().equals(skyKey)) {
      boolean shouldFailFast=!keepGoing || builderException.isCatastrophic();
      if (shouldFailFast) {
        if (!visitor.preventNewEvaluations()) {
          return;
        }
      }
      Map<SkyKey,NodeEntry> newlyRequestedDeps=graph.getBatch(env.newlyRequestedDeps);
      boolean isTransitivelyTransient=reifiedBuilderException.isTransient();
      for (      NodeEntry depEntry : Iterables.concat(env.directDeps.values(),newlyRequestedDeps.values())) {
        if (!isDoneForBuild(depEntry)) {
          continue;
        }
        ErrorInfo depError=depEntry.getErrorInfo();
        if (depError != null) {
          isTransitivelyTransient|=depError.isTransient();
        }
      }
      ErrorInfo errorInfo=ErrorInfo.fromException(reifiedBuilderException,isTransitivelyTransient);
      registerNewlyDiscoveredDepsForDoneEntry(skyKey,state,newlyRequestedDeps,env);
      env.setError(errorInfo,reifiedBuilderException.isTransient());
      env.commit(keepGoing);
      if (!shouldFailFast) {
        return;
      }
      throw SchedulerException.ofError(errorInfo,skyKey);
    }
  }
catch (  InterruptedException ie) {
    throw SchedulerException.ofInterruption(ie,skyKey);
  }
catch (  RuntimeException re) {
    String msg=prepareCrashMessage(skyKey,state.getInProgressReverseDeps());
    RuntimeException ex=new RuntimeException(msg,re);
    visitor.noteCrash(ex);
    throw ex;
  }
 finally {
    env.doneBuilding();
    long elapsedTimeNanos=BlazeClock.instance().nanoTime() - startTime;
    if (elapsedTimeNanos > 0) {
      if (progressReceiver != null) {
        progressReceiver.computed(skyKey,elapsedTimeNanos);
      }
      Profiler.instance().logSimpleTaskDuration(startTime,elapsedTimeNanos,ProfilerTask.SKYFUNCTION,skyKey);
    }
  }
  GroupedListHelper<SkyKey> newDirectDeps=env.newlyRequestedDeps;
  if (value != null) {
    Preconditions.checkState(!env.valuesMissing(),"String_Node_Str" + "String_Node_Str",skyKey,newDirectDeps,state);
    env.setValue(value);
    registerNewlyDiscoveredDepsForDoneEntry(skyKey,state,graph.getBatch(env.newlyRequestedDeps),env);
    env.commit(true);
    return;
  }
  if (env.getDepErrorKey() != null) {
    Preconditions.checkState(!keepGoing,"String_Node_Str",skyKey,state,env.getDepErrorKey());
    SkyKey childErrorKey=env.getDepErrorKey();
    NodeEntry childErrorEntry=Preconditions.checkNotNull(graph.get(childErrorKey),"String_Node_Str",skyKey,state,childErrorKey);
    Preconditions.checkState(!state.getTemporaryDirectDeps().contains(childErrorKey),"String_Node_Str",skyKey,state,childErrorKey,childErrorEntry);
    Preconditions.checkState(newDirectDeps.contains(childErrorKey),"String_Node_Str",state,childErrorKey,newDirectDeps);
    state.addTemporaryDirectDeps(GroupedListHelper.create(ImmutableList.of(childErrorKey)));
    DependencyState childErrorState=childErrorEntry.addReverseDepAndCheckIfDone(skyKey);
    Preconditions.checkState(childErrorState == DependencyState.DONE,"String_Node_Str",skyKey,state,childErrorKey,childErrorEntry);
    ErrorInfo childErrorInfo=Preconditions.checkNotNull(childErrorEntry.getErrorInfo());
    visitor.preventNewEvaluations();
    throw SchedulerException.ofError(childErrorInfo,childErrorKey);
  }
  state.addTemporaryDirectDeps(newDirectDeps);
  if (newDirectDeps.isEmpty()) {
    Preconditions.checkState(!env.childErrorInfos.isEmpty(),"String_Node_Str",skyKey,state);
    Preconditions.checkState(keepGoing,"String_Node_Str",skyKey,state,env.childErrorInfos);
    env.commit(true);
    return;
  }
  for (  Map.Entry<SkyKey,NodeEntry> e : graph.createIfAbsentBatch(newDirectDeps).entrySet()) {
    SkyKey newDirectDep=e.getKey();
    NodeEntry newDirectDepEntry=e.getValue();
    enqueueChild(skyKey,state,newDirectDep,newDirectDepEntry,false);
  }
}