Program: 91789
Project: 91789
Buggy source:
@Override public void launch(final ILaunchConfiguration config,String mode,final ILaunch launch,IProgressMonitor m) throws CoreException {
  if (m == null) {
    m=new NullProgressMonitor();
  }
  process=null;
  SubMonitor monitor=SubMonitor.convert(m,Messages.getString("String_Node_Str"),10);
  if (monitor.isCanceled()) {
    return;
  }
  this.config=config;
  this.launch=launch;
  try {
    ValgrindUIPlugin.getDefault().resetView();
    getPlugin().setCurrentLaunchConfiguration(null);
    getPlugin().setCurrentLaunch(null);
    this.configUtils=new ConfigUtils(config);
    IProject project=configUtils.getProject();
    ValgrindUIPlugin.getDefault().setProfiledProject(project);
    URI exeURI=new URI(configUtils.getExecutablePath());
    RemoteConnection exeRC=new RemoteConnection(exeURI);
    monitor.worked(1);
    String valgrindPathString=RuntimeProcessFactory.getFactory().whichCommand(VALGRIND_CMD,project);
    IPath valgrindFullPath=Path.fromOSString(valgrindPathString);
    boolean copyExecutable=configUtils.getCopyExecutable();
    if (copyExecutable) {
      URI copyExeURI=new URI(configUtils.getCopyFromExecutablePath());
      RemoteConnection copyExeRC=new RemoteConnection(copyExeURI);
      IRemoteFileProxy copyExeRFP=copyExeRC.getRmtFileProxy();
      IFileStore copyExeFS=copyExeRFP.getResource(copyExeURI.getPath());
      IRemoteFileProxy exeRFP=exeRC.getRmtFileProxy();
      IFileStore exeFS=exeRFP.getResource(exeURI.getPath());
      IFileInfo exeFI=exeFS.fetchInfo();
      if (exeFI.isDirectory()) {
        IPath copyExePath=Path.fromOSString(copyExeURI.getPath());
        IPath newExePath=Path.fromOSString(exeURI.getPath()).append(copyExePath.lastSegment());
        exeURI=new URI(exeURI.getScheme(),exeURI.getAuthority(),newExePath.toString(),exeURI.getQuery(),exeURI.getFragment());
        exeFS=exeRFP.getResource(exeURI.getPath());
      }
      copyExeFS.copy(exeFS,EFS.OVERWRITE | EFS.SHALLOW,new SubProgressMonitor(monitor,1));
    }
    valgrindVersion=getValgrindVersion(project);
    IPath remoteBinFile=Path.fromOSString(exeURI.getPath());
    String configWorkingDir=configUtils.getWorkingDirectory();
    IFileStore workingDir;
    if (configWorkingDir == null) {
      IPath workingDirPath=remoteBinFile.removeLastSegments(1);
      IRemoteFileProxy workingDirRFP=exeRC.getRmtFileProxy();
      workingDir=workingDirRFP.getResource(workingDirPath.toOSString());
    }
 else {
      URI workingDirURI=new URI(configUtils.getWorkingDirectory());
      RemoteConnection workingDirRC=new RemoteConnection(workingDirURI);
      IRemoteFileProxy workingDirRFP=workingDirRC.getRmtFileProxy();
      workingDir=workingDirRFP.getResource(workingDirURI.getPath());
    }
    IPath remoteLogDir=Path.fromOSString("String_Node_Str");
    outputPath=remoteLogDir.append("String_Node_Str" + System.currentTimeMillis());
    exeRC.createFolder(outputPath,new SubProgressMonitor(monitor,1));
    IValgrindOutputDirectoryProvider provider=getPlugin().getOutputDirectoryProvider();
    IPath localOutputDir=null;
    try {
      localOutputDir=provider.getOutputPath();
      createDirectory(localOutputDir);
    }
 catch (    IOException e2) {
      throw new CoreException(new Status(IStatus.ERROR,ValgrindLaunchPlugin.PLUGIN_ID,IStatus.OK,"String_Node_Str",e2));
    }
    toolID=getTool(config);
    dynamicDelegate=getDynamicDelegate(toolID);
    String[] valgrindArgs=getValgrindArgumentsArray(config);
    String[] executableArgs=getProgramArgumentsArray(config);
    String[] allArgs=new String[executableArgs.length + valgrindArgs.length + 2];
    int idx=0;
    allArgs[idx++]=VALGRIND_CMD;
    for (    String valgrindArg : valgrindArgs) {
      allArgs[idx++]=valgrindArg;
    }
    allArgs[idx++]=remoteBinFile.toOSString();
    for (    String executableArg : executableArgs) {
      allArgs[idx++]=executableArg;
    }
    Process p=RuntimeProcessFactory.getFactory().exec(allArgs,new String[0],workingDir,project);
    int state=p.waitFor();
    if (state != IRemoteCommandLauncher.OK) {
      abort(Messages.getString("String_Node_Str") + "String_Node_Str" + state+ "String_Node_Str"+ NLS.bind(Messages.getString("String_Node_Str"),"String_Node_Str")+ "String_Node_Str",null,ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
    }
    if (p.exitValue() != 0) {
      String line=null;
      StringBuilder valgrindOutSB=new StringBuilder();
      BufferedReader valgrindOut=new BufferedReader(new InputStreamReader(p.getInputStream()));
      while ((line=valgrindOut.readLine()) != null) {
        valgrindOutSB.append(line);
      }
      StringBuilder valgrindErrSB=new StringBuilder();
      BufferedReader valgrindErr=new BufferedReader(new InputStreamReader(p.getErrorStream()));
      while ((line=valgrindErr.readLine()) != null) {
        valgrindErrSB.append(line);
      }
      abort(NLS.bind("String_Node_Str",valgrindOutSB.toString()) + "String_Node_Str" + NLS.bind("String_Node_Str",valgrindErrSB.toString()),null,ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
    }
    exeRC.download(outputPath,localOutputDir,new SubProgressMonitor(monitor,1));
    exeRC.delete(outputPath,new SubProgressMonitor(monitor,1));
    getPlugin().setCurrentLaunchConfiguration(config);
    getPlugin().setCurrentLaunch(launch);
    IValgrindMessage[] messages=parseLogs(localOutputDir);
    launchStr=createLaunchStr(valgrindFullPath);
    ValgrindUIPlugin.getDefault().createView(launchStr,toolID);
    ValgrindViewPart view=ValgrindUIPlugin.getDefault().getView();
    view.setMessages(messages);
    monitor.worked(1);
    dynamicDelegate.handleLaunch(config,launch,localOutputDir,monitor.newChild(2));
    dynamicDelegate.initializeView(view.getDynamicView(),launchStr,monitor.newChild(1));
    ValgrindUIPlugin.getDefault().refreshView();
    ValgrindUIPlugin.getDefault().showView();
    monitor.worked(1);
  }
 catch (  URISyntaxException|IOException|RemoteConnectionException|InterruptedException e) {
    abort(e.getLocalizedMessage(),null,ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
  }
 finally {
    monitor.done();
    m.done();
  }
}

Fixed version (ground truth):
@Override public void launch(final ILaunchConfiguration config,String mode,final ILaunch launch,IProgressMonitor m) throws CoreException {
  if (m == null) {
    m=new NullProgressMonitor();
  }
  process=null;
  SubMonitor monitor=SubMonitor.convert(m,Messages.getString("String_Node_Str"),10);
  if (monitor.isCanceled()) {
    return;
  }
  this.config=config;
  this.launch=launch;
  try {
    ValgrindUIPlugin.getDefault().resetView();
    getPlugin().setCurrentLaunchConfiguration(null);
    getPlugin().setCurrentLaunch(null);
    this.configUtils=new ConfigUtils(config);
    IProject project=configUtils.getProject();
    ValgrindUIPlugin.getDefault().setProfiledProject(project);
    URI exeURI=new URI(configUtils.getExecutablePath());
    RemoteConnection exeRC=new RemoteConnection(exeURI);
    monitor.worked(1);
    String valgrindPathString=RuntimeProcessFactory.getFactory().whichCommand(VALGRIND_CMD,project);
    IPath valgrindFullPath=Path.fromOSString(valgrindPathString);
    boolean copyExecutable=configUtils.getCopyExecutable();
    if (copyExecutable) {
      URI copyExeURI=new URI(configUtils.getCopyFromExecutablePath());
      RemoteConnection copyExeRC=new RemoteConnection(copyExeURI);
      IRemoteFileProxy copyExeRFP=copyExeRC.getRmtFileProxy();
      IFileStore copyExeFS=copyExeRFP.getResource(copyExeURI.getPath());
      IRemoteFileProxy exeRFP=exeRC.getRmtFileProxy();
      IFileStore exeFS=exeRFP.getResource(exeURI.getPath());
      IFileInfo exeFI=exeFS.fetchInfo();
      if (exeFI.isDirectory()) {
        IPath copyExePath=Path.fromOSString(copyExeURI.getPath());
        IPath newExePath=Path.fromOSString(exeURI.getPath()).append(copyExePath.lastSegment());
        exeURI=new URI(exeURI.getScheme(),exeURI.getAuthority(),newExePath.toString(),exeURI.getQuery(),exeURI.getFragment());
        exeFS=exeRFP.getResource(exeURI.getPath());
      }
      copyExeFS.copy(exeFS,EFS.OVERWRITE | EFS.SHALLOW,new SubProgressMonitor(monitor,1));
    }
    valgrindVersion=getValgrindVersion(project);
    IPath remoteBinFile=Path.fromOSString(exeURI.getPath());
    String configWorkingDir=configUtils.getWorkingDirectory();
    IFileStore workingDir;
    if (configWorkingDir == null) {
      IPath workingDirPath=remoteBinFile.removeLastSegments(1);
      IRemoteFileProxy workingDirRFP=exeRC.getRmtFileProxy();
      workingDir=workingDirRFP.getResource(workingDirPath.toOSString());
    }
 else {
      URI workingDirURI=new URI(configUtils.getWorkingDirectory());
      RemoteConnection workingDirRC=new RemoteConnection(workingDirURI);
      IRemoteFileProxy workingDirRFP=workingDirRC.getRmtFileProxy();
      workingDir=workingDirRFP.getResource(workingDirURI.getPath());
    }
    IPath remoteLogDir=Path.fromOSString("String_Node_Str");
    outputPath=remoteLogDir.append("String_Node_Str" + System.currentTimeMillis());
    exeRC.createFolder(outputPath,new SubProgressMonitor(monitor,1));
    IValgrindOutputDirectoryProvider provider=getPlugin().getOutputDirectoryProvider();
    setOutputPath(config,provider.getOutputPath());
    IPath localOutputDir=null;
    try {
      localOutputDir=provider.getOutputPath();
      createDirectory(localOutputDir);
    }
 catch (    IOException e2) {
      throw new CoreException(new Status(IStatus.ERROR,ValgrindLaunchPlugin.PLUGIN_ID,IStatus.OK,"String_Node_Str",e2));
    }
    toolID=getTool(config);
    dynamicDelegate=getDynamicDelegate(toolID);
    String[] valgrindArgs=getValgrindArgumentsArray(config);
    String[] executableArgs=getProgramArgumentsArray(config);
    String[] allArgs=new String[executableArgs.length + valgrindArgs.length + 2];
    int idx=0;
    allArgs[idx++]=VALGRIND_CMD;
    for (    String valgrindArg : valgrindArgs) {
      allArgs[idx++]=valgrindArg;
    }
    allArgs[idx++]=remoteBinFile.toOSString();
    for (    String executableArg : executableArgs) {
      allArgs[idx++]=executableArg;
    }
    Process p=RuntimeProcessFactory.getFactory().exec(allArgs,new String[0],workingDir,project);
    int state=p.waitFor();
    if (state != IRemoteCommandLauncher.OK) {
      abort(Messages.getString("String_Node_Str") + "String_Node_Str" + state+ "String_Node_Str"+ NLS.bind(Messages.getString("String_Node_Str"),"String_Node_Str")+ "String_Node_Str",null,ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
    }
    if (p.exitValue() != 0) {
      String line=null;
      StringBuilder valgrindOutSB=new StringBuilder();
      BufferedReader valgrindOut=new BufferedReader(new InputStreamReader(p.getInputStream()));
      while ((line=valgrindOut.readLine()) != null) {
        valgrindOutSB.append(line);
      }
      StringBuilder valgrindErrSB=new StringBuilder();
      BufferedReader valgrindErr=new BufferedReader(new InputStreamReader(p.getErrorStream()));
      while ((line=valgrindErr.readLine()) != null) {
        valgrindErrSB.append(line);
      }
      abort(NLS.bind("String_Node_Str",valgrindOutSB.toString()) + "String_Node_Str" + NLS.bind("String_Node_Str",valgrindErrSB.toString()),null,ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
    }
    exeRC.download(outputPath,localOutputDir,new SubProgressMonitor(monitor,1));
    exeRC.delete(outputPath,new SubProgressMonitor(monitor,1));
    getPlugin().setCurrentLaunchConfiguration(config);
    getPlugin().setCurrentLaunch(launch);
    IValgrindMessage[] messages=parseLogs(localOutputDir);
    launchStr=createLaunchStr(valgrindFullPath);
    ValgrindUIPlugin.getDefault().createView(launchStr,toolID);
    ValgrindViewPart view=ValgrindUIPlugin.getDefault().getView();
    view.setMessages(messages);
    monitor.worked(1);
    dynamicDelegate.handleLaunch(config,launch,localOutputDir,monitor.newChild(2));
    dynamicDelegate.initializeView(view.getDynamicView(),launchStr,monitor.newChild(1));
    ValgrindUIPlugin.getDefault().refreshView();
    ValgrindUIPlugin.getDefault().showView();
    monitor.worked(1);
  }
 catch (  URISyntaxException|IOException|RemoteConnectionException|InterruptedException e) {
    abort(e.getLocalizedMessage(),null,ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
  }
 finally {
    monitor.done();
    m.done();
  }
}