Program: 46532
Project: 46532
Buggy source:
public void save(Vm vm,VmModel model) throws VmException {
  lock.lock();
  try {
    IMachine machine=getIMachineReference(vm.getId());
    ISession session=mgr.getSessionObject();
    machine.lockMachine(session,LockType.Shared);
    machine=session.getMachine();
    try {
      IProgress progress=session.getConsole().saveState();
      long to=System.currentTimeMillis() + MAX_SAVE_TIME;
      while (!progress.getCompleted()) {
        if (System.currentTimeMillis() > to) {
          LOG.error("String_Node_Str");
          break;
        }
        LOG.debug("String_Node_Str",progress.getOperationPercent());
        vm.setProgress(progress.getOperationPercent().intValue());
        model.fireVmStateUpdatedEvent(vm);
        Thread.sleep(500);
      }
      LOG.debug("String_Node_Str");
      File mp=vm.getRuntimeContainer().getMountpoint();
      ShellUtil su=new ShellUtil();
      su.run(null,ShellUtil.NO_TIMEOUT,"String_Node_Str","String_Node_Str",new File(mp,"String_Node_Str" + vm.getId() + "String_Node_Str").getAbsolutePath(),new File(mp,"String_Node_Str").getAbsolutePath());
      machine=lockMachine(vm.getId(),session);
      session.getConsole().discardSavedState(true);
    }
  finally {
      unlockSession(session);
    }
    vm.setProgress(100);
    vm.setProgressMessage("String_Node_Str");
    model.fireVmStateUpdatedEvent(vm);
  }
 catch (  Exception e) {
    throw new VmException("String_Node_Str",e);
  }
 finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
public void save(Vm vm,VmModel model) throws VmException {
  lock.lock();
  try {
    IMachine machine=getIMachineReference(vm.getId());
    ISession session=mgr.getSessionObject();
    machine.lockMachine(session,LockType.Shared);
    machine=session.getMachine();
    try {
      IProgress progress=session.getConsole().saveState();
      long to=System.currentTimeMillis() + MAX_SAVE_TIME;
      while (!progress.getCompleted()) {
        if (System.currentTimeMillis() > to) {
          LOG.error("String_Node_Str");
          break;
        }
        LOG.debug("String_Node_Str",progress.getOperationPercent());
        vm.setProgress(progress.getOperationPercent().intValue());
        model.fireVmStateUpdatedEvent(vm);
        Thread.sleep(500);
      }
      LOG.debug("String_Node_Str");
      File mp=vm.getRuntimeContainer().getMountpoint();
      for (      File f : mp.listFiles()) {
        if (f.getName().endsWith("String_Node_Str")) {
          LOG.debug("String_Node_Str",f.getAbsolutePath());
          ShellUtil su=new ShellUtil();
          su.run(null,ShellUtil.NO_TIMEOUT,"String_Node_Str","String_Node_Str",f.getAbsolutePath(),new File(mp,"String_Node_Str").getAbsolutePath());
          break;
        }
 else {
          LOG.debug("String_Node_Str",f.getAbsolutePath());
        }
      }
      machine=lockMachine(vm.getId(),session);
      session.getConsole().discardSavedState(true);
    }
  finally {
      unlockSession(session);
    }
    vm.setProgress(100);
    vm.setProgressMessage("String_Node_Str");
    model.fireVmStateUpdatedEvent(vm);
  }
 catch (  Exception e) {
    throw new VmException("String_Node_Str",e);
  }
 finally {
    lock.unlock();
  }
}