Program: 113328
Project: 113328
Buggy source:
/** 
 * Sends a RPC for reading the object on another OSD.
 * @param attachObjectSet
 * @throws UnknownUUIDException
 */
private void sendFetchObjectRequest(final long objectNo,final ServiceUUID osd,boolean attachObjectSet) throws UnknownUUIDException, IOException {
  try {
    checkCap();
  }
 catch (  IOException e1) {
    Logging.logMessage(Logging.LEVEL_ERROR,Category.misc,this,"String_Node_Str" + e1.getLocalizedMessage(),fileID);
  }
  assert(objectsInProgress.size() <= MAX_MAX_OBJECTS_IN_PROGRESS);
  OSDServiceClient client=master.getOSDClientForReplication();
  FileCredentials fcred=FileCredentials.newBuilder().setXcap(cap.getXCap()).setXlocs(xLoc.getXLocSet()).build();
  RPCResponse<InternalReadLocalResponse> response=client.xtreemfs_internal_read_local(osd.getAddress(),RPCAuthentication.authNone,RPCAuthentication.userService,fcred,fileID,objectNo,0,0,xLoc.getLocalReplica().getStripingPolicy().getStripeSizeForObject(objectNo),attachObjectSet,new ArrayList(0));
  response.registerListener(new RPCResponseAvailableListener<InternalReadLocalResponse>(){
    @Override public void responseAvailable(    RPCResponse<InternalReadLocalResponse> r){
      InternalReadLocalResponse internalReadLocalResponse=null;
      try {
        internalReadLocalResponse=r.get();
        ObjectData metadata=internalReadLocalResponse.getData();
        InternalObjectData data=new InternalObjectData(metadata,r.getData());
        ObjectList objectList=null;
        if (internalReadLocalResponse.getObjectSetCount() == 1)         objectList=internalReadLocalResponse.getObjectSet(0);
        master.getReplicationStage().internalObjectFetched(fileID,objectNo,osd,data,objectList,null);
      }
 catch (      PBRPCException e) {
        osdAvailability.setServiceWasNotAvailable(osd);
        master.getReplicationStage().internalObjectFetched(fileID,objectNo,osd,null,null,e.getErrorResponse());
      }
catch (      IOException e) {
        osdAvailability.setServiceWasNotAvailable(osd);
        master.getReplicationStage().internalObjectFetched(fileID,objectNo,osd,null,null,ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EIO,e.toString()));
      }
catch (      InterruptedException e) {
      }
 finally {
        r.freeBuffers();
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Sends a RPC for reading the object on another OSD.
 * @param attachObjectSet
 * @throws UnknownUUIDException
 */
private void sendFetchObjectRequest(final long objectNo,final ServiceUUID osd,boolean attachObjectSet) throws UnknownUUIDException, IOException {
  try {
    checkCap();
  }
 catch (  IOException e1) {
    Logging.logMessage(Logging.LEVEL_ERROR,Category.misc,this,"String_Node_Str" + e1.getLocalizedMessage(),fileID);
  }
  assert(objectsInProgress.size() <= MAX_MAX_OBJECTS_IN_PROGRESS);
  OSDServiceClient client=master.getOSDClientForReplication();
  FileCredentials fcred=FileCredentials.newBuilder().setXcap(cap.getXCap()).setXlocs(xLoc.getXLocSet()).build();
  RPCResponse<InternalReadLocalResponse> response=client.xtreemfs_internal_read_local(osd.getAddress(),RPCAuthentication.authNone,RPCAuthentication.userService,fcred,fileID,objectNo,0,0,xLoc.getLocalReplica().getStripingPolicy().getStripeSizeForObject(objectNo),attachObjectSet,new ArrayList(0));
  response.registerListener(new RPCResponseAvailableListener<InternalReadLocalResponse>(){
    @Override public void responseAvailable(    RPCResponse<InternalReadLocalResponse> r){
      InternalReadLocalResponse internalReadLocalResponse=null;
      try {
        internalReadLocalResponse=r.get();
        ObjectData metadata=internalReadLocalResponse.getData();
        InternalObjectData data=new InternalObjectData(metadata,r.getData());
        ObjectList objectList=null;
        if (internalReadLocalResponse.getObjectSetCount() == 1)         objectList=internalReadLocalResponse.getObjectSet(0);
        master.getReplicationStage().internalObjectFetched(fileID,objectNo,osd,data,objectList,null);
      }
 catch (      PBRPCException e) {
        if (e.getErrorType() != ErrorType.INVALID_VIEW) {
          osdAvailability.setServiceWasNotAvailable(osd);
        }
        master.getReplicationStage().internalObjectFetched(fileID,objectNo,osd,null,null,e.getErrorResponse());
      }
catch (      IOException e) {
        osdAvailability.setServiceWasNotAvailable(osd);
        master.getReplicationStage().internalObjectFetched(fileID,objectNo,osd,null,null,ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EIO,e.toString()));
      }
catch (      InterruptedException e) {
      }
 finally {
        r.freeBuffers();
      }
    }
  }
);
}