Program: 153911
Project: 153911
Buggy source:
/** 
 * Starts the slave process.
 * @param computer         The computer.
 * @param listener         The listener.
 * @param java             The full path name of the java executable to use.
 * @param workingDirectory The working directory from which to start the java process.
 * @throws IOException If something goes wrong.
 */
private void startSlave(SlaveComputer computer,final StreamTaskListener listener,String java,String workingDirectory) throws IOException {
  final Session session=connection.openSession();
  session.execCommand("String_Node_Str" + workingDirectory + "String_Node_Str"+ java+ (jvmOptions == null ? "String_Node_Str" : "String_Node_Str" + jvmOptions)+ "String_Node_Str");
  final StreamGobbler out=new StreamGobbler(session.getStdout());
  final StreamGobbler err=new StreamGobbler(session.getStderr());
  new StreamCopyThread("String_Node_Str" + computer.getDisplayName(),err,listener.getLogger()).start();
  try {
    computer.setChannel(out,session.getStdin(),listener.getLogger(),new Channel.Listener(){
      public void onClosed(      Channel channel,      IOException cause){
        if (cause != null) {
          cause.printStackTrace(listener.error(hudson.model.Messages.Slave_Terminated(getTimestamp())));
        }
        try {
          session.close();
        }
 catch (        Throwable t) {
          t.printStackTrace(listener.error(Messages.SSHLauncher_ErrorWhileClosingConnection()));
        }
        try {
          out.close();
        }
 catch (        Throwable t) {
          t.printStackTrace(listener.error(Messages.SSHLauncher_ErrorWhileClosingConnection()));
        }
        try {
          err.close();
        }
 catch (        Throwable t) {
          t.printStackTrace(listener.error(Messages.SSHLauncher_ErrorWhileClosingConnection()));
        }
      }
    }
);
  }
 catch (  InterruptedException e) {
    session.close();
    throw new IOException2(Messages.SSHLauncher_AbortedDuringConnectionOpen(),e);
  }
}

Fixed version (ground truth):
/** 
 * Starts the slave process.
 * @param computer         The computer.
 * @param listener         The listener.
 * @param java             The full path name of the java executable to use.
 * @param workingDirectory The working directory from which to start the java process.
 * @throws IOException If something goes wrong.
 */
private void startSlave(SlaveComputer computer,final StreamTaskListener listener,String java,String workingDirectory) throws IOException {
  final Session session=connection.openSession();
  String cmd="String_Node_Str" + workingDirectory + "String_Node_Str"+ java+ (jvmOptions == null ? "String_Node_Str" : "String_Node_Str" + jvmOptions)+ "String_Node_Str";
  listener.getLogger().println(Messages.SSHLauncher_StartingSlaveProcess(getTimestamp(),cmd));
  session.execCommand(cmd);
  final StreamGobbler out=new StreamGobbler(session.getStdout());
  final StreamGobbler err=new StreamGobbler(session.getStderr());
  new StreamCopyThread("String_Node_Str" + computer.getDisplayName(),err,listener.getLogger()).start();
  try {
    computer.setChannel(out,session.getStdin(),listener.getLogger(),new Channel.Listener(){
      public void onClosed(      Channel channel,      IOException cause){
        if (cause != null) {
          cause.printStackTrace(listener.error(hudson.model.Messages.Slave_Terminated(getTimestamp())));
        }
        try {
          session.close();
        }
 catch (        Throwable t) {
          t.printStackTrace(listener.error(Messages.SSHLauncher_ErrorWhileClosingConnection()));
        }
        try {
          out.close();
        }
 catch (        Throwable t) {
          t.printStackTrace(listener.error(Messages.SSHLauncher_ErrorWhileClosingConnection()));
        }
        try {
          err.close();
        }
 catch (        Throwable t) {
          t.printStackTrace(listener.error(Messages.SSHLauncher_ErrorWhileClosingConnection()));
        }
      }
    }
);
  }
 catch (  InterruptedException e) {
    session.close();
    throw new IOException2(Messages.SSHLauncher_AbortedDuringConnectionOpen(),e);
  }
}