Program: 1167
Project: 1167
Buggy source:
public ProcessState getProcessStateLocked(String packageName,int uid,String processName){
  final PackageState pkgState=getPackageStateLocked(packageName,uid);
  ProcessState ps=pkgState.mProcesses.get(processName);
  if (ps != null) {
    return ps;
  }
  ProcessState commonProc=mProcesses.get(processName,uid);
  if (commonProc == null) {
    commonProc=new ProcessState(this,packageName,uid,processName);
    mProcesses.put(processName,uid,commonProc);
  }
  if (!commonProc.mMultiPackage) {
    if (packageName.equals(commonProc.mPackage)) {
      ps=commonProc;
    }
 else {
      commonProc.mMultiPackage=true;
      long now=SystemClock.uptimeMillis();
      final PackageState commonPkgState=getPackageStateLocked(commonProc.mPackage,uid);
      if (commonPkgState != null) {
        commonPkgState.mProcesses.put(commonProc.mName,commonProc.clone(commonProc.mPackage,now));
      }
 else {
        Slog.w(TAG,"String_Node_Str" + commonProc.mPackage + "String_Node_Str"+ uid+ "String_Node_Str"+ commonProc.mName);
      }
      ps=new ProcessState(commonProc,packageName,uid,processName,now);
    }
  }
 else {
    ps=new ProcessState(commonProc,packageName,uid,processName,SystemClock.uptimeMillis());
  }
  pkgState.mProcesses.put(processName,ps);
  return ps;
}

Fixed version (ground truth):
public ProcessState getProcessStateLocked(String packageName,int uid,String processName){
  final PackageState pkgState=getPackageStateLocked(packageName,uid);
  ProcessState ps=pkgState.mProcesses.get(processName);
  if (ps != null) {
    return ps;
  }
  ProcessState commonProc=mProcesses.get(processName,uid);
  if (commonProc == null) {
    commonProc=new ProcessState(this,packageName,uid,processName);
    mProcesses.put(processName,uid,commonProc);
    if (DEBUG)     Slog.d(TAG,"String_Node_Str" + commonProc);
  }
  if (!commonProc.mMultiPackage) {
    if (packageName.equals(commonProc.mPackage)) {
      ps=commonProc;
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + commonProc);
    }
 else {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str");
      commonProc.mMultiPackage=true;
      long now=SystemClock.uptimeMillis();
      final PackageState commonPkgState=getPackageStateLocked(commonProc.mPackage,uid);
      if (commonPkgState != null) {
        ProcessState cloned=commonProc.clone(commonProc.mPackage,now);
        if (DEBUG)         Slog.d(TAG,"String_Node_Str" + commonProc.mPackage + "String_Node_Str"+ cloned);
        commonPkgState.mProcesses.put(commonProc.mName,cloned);
        for (int i=commonPkgState.mServices.size() - 1; i >= 0; i--) {
          ServiceState ss=commonPkgState.mServices.valueAt(i);
          if (ss.mProc == commonProc) {
            if (DEBUG)             Slog.d(TAG,"String_Node_Str" + ss);
            ss.mProc=cloned;
          }
 else           if (DEBUG) {
            Slog.d(TAG,"String_Node_Str" + ss);
          }
        }
      }
 else {
        Slog.w(TAG,"String_Node_Str" + commonProc.mPackage + "String_Node_Str"+ uid+ "String_Node_Str"+ commonProc.mName);
      }
      ps=new ProcessState(commonProc,packageName,uid,processName,now);
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + ps);
    }
  }
 else {
    ps=new ProcessState(commonProc,packageName,uid,processName,SystemClock.uptimeMillis());
    if (DEBUG)     Slog.d(TAG,"String_Node_Str" + ps);
  }
  pkgState.mProcesses.put(processName,ps);
  if (DEBUG)   Slog.d(TAG,"String_Node_Str" + ps);
  return ps;
}