Program: 92007
Project: 92007
Buggy source:
@Override public void launch(ILaunchConfiguration config,String mode,ILaunch launch,IProgressMonitor monitor) throws CoreException {
  this.config=config;
  Oprofile.OprofileProject.setProject(getProject());
  LaunchOptions options=new LaunchOptions();
  options.loadConfiguration(config);
  IPath exePath=getExePath(config);
  options.setBinaryImage(exePath.toOSString());
  OprofileDaemonEvent[] daemonEvents=null;
  ArrayList<OprofileDaemonEvent> events=new ArrayList<OprofileDaemonEvent>();
  if (!config.getAttribute(OprofileLaunchPlugin.ATTR_USE_DEFAULT_EVENT,false)) {
    OprofileCounter[] counters=oprofileCounters(config);
    for (int i=0; i < counters.length; ++i) {
      if (counters[i].getEnabled())       events.add(counters[i].getDaemonEvent());
    }
    daemonEvents=new OprofileDaemonEvent[events.size()];
    events.toArray(daemonEvents);
  }
  if (!preExec(options,daemonEvents,launch))   return;
  Process process=null;
  if (OprofileProject.getProfilingBinary().equals(OprofileProject.OPCONTROL_BINARY)) {
    String arguments[]=getProgramArgumentsArray(config);
    IRemoteCommandLauncher launcher=RemoteProxyManager.getInstance().getLauncher(oprofileProject());
    IPath workingDirPath=new Path(oprofileWorkingDirURI(config).getPath());
    for (int i=0; i < options.getExecutionsNumber(); i++) {
      process=launcher.execute(exePath,arguments,getEnvironment(config),workingDirPath,monitor);
      DebugPlugin.newProcess(launch,process,renderProcessLabel(exePath.toOSString()));
      try {
        process.waitFor();
      }
 catch (      InterruptedException e) {
        process.destroy();
        Status status=new Status(IStatus.ERROR,OprofileLaunchPlugin.PLUGIN_ID,OprofileLaunchMessages.getString("String_Node_Str"));
        throw new CoreException(status);
      }
    }
  }
  if (OprofileProject.getProfilingBinary().equals(OprofileProject.OPERF_BINARY)) {
    String eventsString=EVENTS;
    for (int i=0; i < events.size(); i++) {
      eventsString+=events.get(i).getEvent().getText() + "String_Node_Str" + events.get(i).getEvent().getMinCount()+ "String_Node_Str";
    }
    ArrayList<String> argArray=new ArrayList<String>(Arrays.asList(getProgramArgumentsArray(config)));
    IFolder dataFolder=Oprofile.OprofileProject.getProject().getFolder(OPROFILE_DATA);
    if (!dataFolder.exists()) {
      dataFolder.create(false,true,null);
    }
    argArray.add(0,exePath.toOSString());
    if (events.size() > 0)     argArray.add(0,eventsString);
    argArray.add(0,SESSION_DIR + oprofileWorkingDirURI(config).getPath() + IPath.SEPARATOR+ OPROFILE_DATA);
    argArray.add(0,OprofileProject.OPERF_BINARY);
    for (int i=0; i < options.getExecutionsNumber(); i++) {
      if (i != 0)       argArray.add(APPEND);
      String[] arguments=new String[argArray.size()];
      arguments=argArray.toArray(arguments);
      try {
        process=RuntimeProcessFactory.getFactory().exec(arguments,OprofileProject.getProject());
      }
 catch (      IOException e1) {
        process.destroy();
        Status status=new Status(IStatus.ERROR,OprofileLaunchPlugin.PLUGIN_ID,OprofileLaunchMessages.getString("String_Node_Str"));
        throw new CoreException(status);
      }
      DebugPlugin.newProcess(launch,process,renderProcessLabel(exePath.toOSString()));
      try {
        process.waitFor();
      }
 catch (      InterruptedException e) {
        process.destroy();
        Status status=new Status(IStatus.ERROR,OprofileLaunchPlugin.PLUGIN_ID,OprofileLaunchMessages.getString("String_Node_Str"));
        throw new CoreException(status);
      }
    }
  }
  postExec(options,daemonEvents,process);
}

Fixed version (ground truth):
@Override public void launch(ILaunchConfiguration config,String mode,ILaunch launch,IProgressMonitor monitor) throws CoreException {
  this.config=config;
  Oprofile.OprofileProject.setProject(getProject());
  LaunchOptions options=new LaunchOptions();
  options.loadConfiguration(config);
  IPath exePath=getExePath(config);
  options.setBinaryImage(exePath.toOSString());
  Oprofile.OprofileProject.setProfilingBinary(options.getOprofileComboText());
  OprofileDaemonEvent[] daemonEvents=null;
  ArrayList<OprofileDaemonEvent> events=new ArrayList<OprofileDaemonEvent>();
  if (!config.getAttribute(OprofileLaunchPlugin.ATTR_USE_DEFAULT_EVENT,false)) {
    OprofileCounter[] counters=oprofileCounters(config);
    for (int i=0; i < counters.length; ++i) {
      if (counters[i].getEnabled())       events.add(counters[i].getDaemonEvent());
    }
    daemonEvents=new OprofileDaemonEvent[events.size()];
    events.toArray(daemonEvents);
  }
  if (!preExec(options,daemonEvents,launch))   return;
  Process process=null;
  if (OprofileProject.getProfilingBinary().equals(OprofileProject.OPCONTROL_BINARY)) {
    String arguments[]=getProgramArgumentsArray(config);
    IRemoteCommandLauncher launcher=RemoteProxyManager.getInstance().getLauncher(oprofileProject());
    IPath workingDirPath=new Path(oprofileWorkingDirURI(config).getPath());
    for (int i=0; i < options.getExecutionsNumber(); i++) {
      process=launcher.execute(exePath,arguments,getEnvironment(config),workingDirPath,monitor);
      DebugPlugin.newProcess(launch,process,renderProcessLabel(exePath.toOSString()));
      try {
        process.waitFor();
      }
 catch (      InterruptedException e) {
        process.destroy();
        Status status=new Status(IStatus.ERROR,OprofileLaunchPlugin.PLUGIN_ID,OprofileLaunchMessages.getString("String_Node_Str"));
        throw new CoreException(status);
      }
    }
  }
  if (OprofileProject.getProfilingBinary().equals(OprofileProject.OPERF_BINARY)) {
    String eventsString=EVENTS;
    for (int i=0; i < events.size(); i++) {
      eventsString+=events.get(i).getEvent().getText() + "String_Node_Str" + events.get(i).getEvent().getMinCount()+ "String_Node_Str";
    }
    ArrayList<String> argArray=new ArrayList<String>(Arrays.asList(getProgramArgumentsArray(config)));
    IFolder dataFolder=Oprofile.OprofileProject.getProject().getFolder(OPROFILE_DATA);
    if (!dataFolder.exists()) {
      dataFolder.create(false,true,null);
    }
    argArray.add(0,exePath.toOSString());
    if (events.size() > 0)     argArray.add(0,eventsString);
    argArray.add(0,SESSION_DIR + oprofileWorkingDirURI(config).getPath() + IPath.SEPARATOR+ OPROFILE_DATA);
    argArray.add(0,OprofileProject.OPERF_BINARY);
    for (int i=0; i < options.getExecutionsNumber(); i++) {
      if (i != 0)       argArray.add(APPEND);
      String[] arguments=new String[argArray.size()];
      arguments=argArray.toArray(arguments);
      try {
        process=RuntimeProcessFactory.getFactory().exec(arguments,OprofileProject.getProject());
      }
 catch (      IOException e1) {
        process.destroy();
        Status status=new Status(IStatus.ERROR,OprofileLaunchPlugin.PLUGIN_ID,OprofileLaunchMessages.getString("String_Node_Str"));
        throw new CoreException(status);
      }
      DebugPlugin.newProcess(launch,process,renderProcessLabel(exePath.toOSString()));
      try {
        process.waitFor();
      }
 catch (      InterruptedException e) {
        process.destroy();
        Status status=new Status(IStatus.ERROR,OprofileLaunchPlugin.PLUGIN_ID,OprofileLaunchMessages.getString("String_Node_Str"));
        throw new CoreException(status);
      }
    }
  }
  postExec(options,daemonEvents,process);
}