Program: 41976
Project: 41976
Buggy source:
private boolean handleAppCrashLocked(ProcessRecord app){
  long now=SystemClock.uptimeMillis();
  Long crashTime=mProcessCrashTimes.get(app.info.processName,app.info.uid);
  if (crashTime != null && now < crashTime + MIN_CRASH_INTERVAL) {
    Slog.w(TAG,"String_Node_Str" + app.info.processName + "String_Node_Str");
    EventLog.writeEvent(EventLogTags.AM_PROCESS_CRASHED_TOO_MUCH,app.info.processName,app.info.uid);
    killServicesLocked(app,false);
    for (int i=mHistory.size() - 1; i >= 0; i--) {
      HistoryRecord r=(HistoryRecord)mHistory.get(i);
      if (r.app == app) {
        Slog.w(TAG,"String_Node_Str" + r.intent.getComponent().flattenToShortString());
        finishActivityLocked(r,i,Activity.RESULT_CANCELED,null,"String_Node_Str");
      }
    }
    if (!app.persistent) {
      EventLog.writeEvent(EventLogTags.AM_PROC_BAD,app.info.uid,app.info.processName);
      mBadProcesses.put(app.info.processName,app.info.uid,now);
      app.bad=true;
      mProcessCrashTimes.remove(app.info.processName,app.info.uid);
      app.removed=true;
      removeProcessLocked(app,false);
      return false;
    }
  }
  if (app.services.size() != 0) {
    Iterator it=app.services.iterator();
    while (it.hasNext()) {
      ServiceRecord sr=(ServiceRecord)it.next();
      sr.crashCount++;
    }
  }
  mProcessCrashTimes.put(app.info.processName,app.info.uid,now);
  return true;
}

Fixed version (ground truth):
private boolean handleAppCrashLocked(ProcessRecord app){
  long now=SystemClock.uptimeMillis();
  Long crashTime=mProcessCrashTimes.get(app.info.processName,app.info.uid);
  if (crashTime != null && now < crashTime + MIN_CRASH_INTERVAL) {
    Slog.w(TAG,"String_Node_Str" + app.info.processName + "String_Node_Str");
    EventLog.writeEvent(EventLogTags.AM_PROCESS_CRASHED_TOO_MUCH,app.info.processName,app.info.uid);
    killServicesLocked(app,false);
    for (int i=mHistory.size() - 1; i >= 0; i--) {
      HistoryRecord r=(HistoryRecord)mHistory.get(i);
      if (r.app == app) {
        Slog.w(TAG,"String_Node_Str" + r.intent.getComponent().flattenToShortString());
        finishActivityLocked(r,i,Activity.RESULT_CANCELED,null,"String_Node_Str");
      }
    }
    if (!app.persistent) {
      EventLog.writeEvent(EventLogTags.AM_PROC_BAD,app.info.uid,app.info.processName);
      mBadProcesses.put(app.info.processName,app.info.uid,now);
      app.bad=true;
      mProcessCrashTimes.remove(app.info.processName,app.info.uid);
      app.removed=true;
      removeProcessLocked(app,false);
      return false;
    }
  }
 else {
    HistoryRecord r=topRunningActivityLocked(null);
    if (r.app == app) {
      Slog.w(TAG,"String_Node_Str" + r.intent.getComponent().flattenToShortString());
      int index=indexOfTokenLocked(r);
      finishActivityLocked(r,index,Activity.RESULT_CANCELED,null,"String_Node_Str");
      index--;
      if (index >= 0) {
        r=(HistoryRecord)mHistory.get(index);
        if (r.state == ActivityState.RESUMED || r.state == ActivityState.PAUSING || r.state == ActivityState.PAUSED) {
          if (!r.isHomeActivity) {
            Slog.w(TAG,"String_Node_Str" + r.intent.getComponent().flattenToShortString());
            finishActivityLocked(r,index,Activity.RESULT_CANCELED,null,"String_Node_Str");
          }
        }
      }
    }
  }
  if (app.services.size() != 0) {
    Iterator it=app.services.iterator();
    while (it.hasNext()) {
      ServiceRecord sr=(ServiceRecord)it.next();
      sr.crashCount++;
    }
  }
  mProcessCrashTimes.put(app.info.processName,app.info.uid,now);
  return true;
}