Program: 22663
Project: 22663
Buggy source:
private void loadMediaPackages(HashMap<SdInstallArgs,String> processCids,int uidArr[],HashSet<String> removeCids){
  ArrayList<String> pkgList=new ArrayList<String>();
  Set<SdInstallArgs> keys=processCids.keySet();
  boolean doGc=false;
  for (  SdInstallArgs args : keys) {
    String codePath=processCids.get(args);
    if (DEBUG_SD_INSTALL)     Log.i(TAG,"String_Node_Str" + args.cid);
    int retCode=PackageManager.INSTALL_FAILED_CONTAINER_ERROR;
    try {
      if (args.doPreInstall(PackageManager.INSTALL_SUCCEEDED) != PackageManager.INSTALL_SUCCEEDED) {
        Slog.e(TAG,"String_Node_Str" + args.cid + "String_Node_Str");
        continue;
      }
      if (codePath == null || !codePath.equals(args.getCodePath())) {
        Slog.e(TAG,"String_Node_Str" + args.cid + "String_Node_Str"+ args.getCodePath()+ "String_Node_Str"+ codePath);
        continue;
      }
      int parseFlags=PackageParser.PARSE_CHATTY | PackageParser.PARSE_ON_SDCARD | mDefParseFlags;
      PackageParser pp=new PackageParser(codePath);
      pp.setSeparateProcesses(mSeparateProcesses);
      final PackageParser.Package pkg=pp.parsePackage(new File(codePath),codePath,mMetrics,parseFlags);
      pp=null;
      doGc=true;
      if (pkg == null) {
        Slog.e(TAG,"String_Node_Str" + args.cid + "String_Node_Str"+ args.cachePath);
        continue;
      }
      setApplicationInfoPaths(pkg,codePath,codePath);
synchronized (mInstallLock) {
        if (scanPackageLI(pkg,parseFlags,SCAN_MONITOR) != null) {
synchronized (mPackages) {
            retCode=PackageManager.INSTALL_SUCCEEDED;
            pkgList.add(pkg.packageName);
            args.doPostInstall(PackageManager.INSTALL_SUCCEEDED);
          }
        }
 else {
          Slog.i(TAG,"String_Node_Str" + pkg.packageName + "String_Node_Str");
        }
      }
    }
  finally {
      if (retCode != PackageManager.INSTALL_SUCCEEDED) {
        removeCids.add(args.cid);
      }
    }
  }
synchronized (mPackages) {
    mSettings.writeLP();
  }
  if (pkgList.size() > 0) {
    sendResourcesChangedBroadcast(true,pkgList,uidArr);
  }
  if (doGc) {
    Runtime.getRuntime().gc();
  }
  if (removeCids != null) {
    for (    String cid : removeCids) {
      Log.w(TAG,"String_Node_Str" + cid + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void loadMediaPackages(HashMap<SdInstallArgs,String> processCids,int uidArr[],HashSet<String> removeCids){
  ArrayList<String> pkgList=new ArrayList<String>();
  Set<SdInstallArgs> keys=processCids.keySet();
  boolean doGc=false;
  for (  SdInstallArgs args : keys) {
    String codePath=processCids.get(args);
    if (DEBUG_SD_INSTALL)     Log.i(TAG,"String_Node_Str" + args.cid);
    int retCode=PackageManager.INSTALL_FAILED_CONTAINER_ERROR;
    try {
      if (args.doPreInstall(PackageManager.INSTALL_SUCCEEDED) != PackageManager.INSTALL_SUCCEEDED) {
        Slog.e(TAG,"String_Node_Str" + args.cid + "String_Node_Str");
        continue;
      }
      if (codePath == null || !codePath.equals(args.getCodePath())) {
        Slog.e(TAG,"String_Node_Str" + args.cid + "String_Node_Str"+ args.getCodePath()+ "String_Node_Str"+ codePath);
        continue;
      }
      int parseFlags=PackageParser.PARSE_CHATTY | PackageParser.PARSE_ON_SDCARD | mDefParseFlags;
      PackageParser pp=new PackageParser(codePath);
      pp.setSeparateProcesses(mSeparateProcesses);
      final PackageParser.Package pkg=pp.parsePackage(new File(codePath),codePath,mMetrics,parseFlags);
      pp=null;
      doGc=true;
      if (pkg == null) {
        Slog.e(TAG,"String_Node_Str" + args.cid + "String_Node_Str"+ args.cachePath);
        continue;
      }
      setApplicationInfoPaths(pkg,codePath,codePath);
synchronized (mInstallLock) {
        if (scanPackageLI(pkg,parseFlags,SCAN_MONITOR) != null) {
synchronized (mPackages) {
            retCode=PackageManager.INSTALL_SUCCEEDED;
            pkgList.add(pkg.packageName);
            args.doPostInstall(PackageManager.INSTALL_SUCCEEDED);
          }
        }
 else {
          Slog.i(TAG,"String_Node_Str" + pkg.packageName + "String_Node_Str");
        }
      }
    }
  finally {
      if (retCode != PackageManager.INSTALL_SUCCEEDED) {
        removeCids.add(args.cid);
      }
    }
  }
synchronized (mPackages) {
    updatePermissionsLP(null,null,true,false);
    mSettings.writeLP();
  }
  if (pkgList.size() > 0) {
    sendResourcesChangedBroadcast(true,pkgList,uidArr);
  }
  if (doGc) {
    Runtime.getRuntime().gc();
  }
  if (removeCids != null) {
    for (    String cid : removeCids) {
      Log.w(TAG,"String_Node_Str" + cid + "String_Node_Str");
    }
  }
}