Program: 17307
Project: 17307
Buggy source:
/** 
 * Create the common   {@link ContainerLaunchContext} for all attempts.
 * @param applicationACLs
 */
private static ContainerLaunchContext createCommonContainerLaunchContext(Map<ApplicationAccessType,String> applicationACLs,TezConfiguration conf,Token<JobTokenIdentifier> jobToken,TezVertexID vertexId,Credentials credentials){
  Map<String,LocalResource> localResources=new HashMap<String,LocalResource>();
  Map<String,String> environment=new HashMap<String,String>();
  Map<String,ByteBuffer> serviceData=new HashMap<String,ByteBuffer>();
  ByteBuffer taskCredentialsBuffer=ByteBuffer.wrap(new byte[]{});
  try {
    Credentials taskCredentials=new Credentials();
    if (UserGroupInformation.isSecurityEnabled()) {
      LOG.info("String_Node_Str" + credentials.numberOfTokens() + "String_Node_Str"+ credentials.numberOfSecretKeys()+ "String_Node_Str");
      taskCredentials.addAll(credentials);
    }
    TokenCache.setJobToken(jobToken,taskCredentials);
    DataOutputBuffer containerTokens_dob=new DataOutputBuffer();
    LOG.info("String_Node_Str" + taskCredentials.numberOfTokens());
    taskCredentials.writeTokenStorageToStream(containerTokens_dob);
    taskCredentialsBuffer=ByteBuffer.wrap(containerTokens_dob.getData(),0,containerTokens_dob.getLength());
    LOG.info("String_Node_Str");
    serviceData.put(ShuffleHandler.MAPREDUCE_SHUFFLE_SERVICEID,ShuffleHandler.serializeServiceData(jobToken));
  }
 catch (  IOException e) {
    throw new YarnException(e);
  }
  ContainerLaunchContext container=BuilderUtils.newContainerLaunchContext(conf.get(TezConfiguration.USER_NAME),localResources,environment,null,serviceData,taskCredentialsBuffer,applicationACLs);
  return container;
}

Fixed version (ground truth):
/** 
 * Create the common   {@link ContainerLaunchContext} for all attempts.
 * @param applicationACLs
 */
private static ContainerLaunchContext createCommonContainerLaunchContext(Map<ApplicationAccessType,String> applicationACLs,TezConfiguration conf,Token<JobTokenIdentifier> jobToken,TezVertexID vertexId,Credentials credentials,AppContext appContext){
  Map<String,LocalResource> localResources=new HashMap<String,LocalResource>();
  Map<String,String> environment=new HashMap<String,String>();
  Map<String,ByteBuffer> serviceData=new HashMap<String,ByteBuffer>();
  ByteBuffer taskCredentialsBuffer=ByteBuffer.wrap(new byte[]{});
  try {
    Credentials taskCredentials=new Credentials();
    if (UserGroupInformation.isSecurityEnabled()) {
      LOG.info("String_Node_Str" + credentials.numberOfTokens() + "String_Node_Str"+ credentials.numberOfSecretKeys()+ "String_Node_Str");
      taskCredentials.addAll(credentials);
    }
    TokenCache.setJobToken(jobToken,taskCredentials);
    DataOutputBuffer containerTokens_dob=new DataOutputBuffer();
    LOG.info("String_Node_Str" + taskCredentials.numberOfTokens());
    taskCredentials.writeTokenStorageToStream(containerTokens_dob);
    taskCredentialsBuffer=ByteBuffer.wrap(containerTokens_dob.getData(),0,containerTokens_dob.getLength());
    LOG.info("String_Node_Str");
    serviceData.put(ShuffleHandler.MAPREDUCE_SHUFFLE_SERVICEID,ShuffleHandler.serializeServiceData(jobToken));
  }
 catch (  IOException e) {
    throw new YarnException(e);
  }
  ContainerLaunchContext container=BuilderUtils.newContainerLaunchContext(appContext.getDAG().getUserName(),localResources,environment,null,serviceData,taskCredentialsBuffer,applicationACLs);
  return container;
}