Program: 42746
Project: 42746
Buggy source:
private final void handleRelaunchActivity(ActivityRecord tmp,int configChanges){
  unscheduleGcIdler();
  Configuration changedConfig=null;
  if (DEBUG_CONFIGURATION)   Log.v(TAG,"String_Node_Str" + tmp.token + "String_Node_Str"+ Integer.toHexString(configChanges));
synchronized (mRelaunchingActivities) {
    int N=mRelaunchingActivities.size();
    IBinder token=tmp.token;
    tmp=null;
    for (int i=0; i < N; i++) {
      ActivityRecord r=mRelaunchingActivities.get(i);
      if (r.token == token) {
        tmp=r;
        mRelaunchingActivities.remove(i);
        i--;
        N--;
      }
    }
    if (tmp == null) {
      if (DEBUG_CONFIGURATION)       Log.v(TAG,"String_Node_Str");
      return;
    }
    if (mPendingConfiguration != null) {
      changedConfig=mPendingConfiguration;
      mPendingConfiguration=null;
    }
  }
  if (DEBUG_CONFIGURATION)   Log.v(TAG,"String_Node_Str" + tmp.token + "String_Node_Str"+ changedConfig);
  if (changedConfig != null) {
    handleConfigurationChanged(changedConfig);
  }
  ActivityRecord r=mActivities.get(tmp.token);
  if (DEBUG_CONFIGURATION)   Log.v(TAG,"String_Node_Str" + r);
  if (r == null) {
    return;
  }
  r.activity.mConfigChangeFlags|=configChanges;
  Intent currentIntent=r.activity.mIntent;
  Bundle savedState=null;
  if (!r.paused) {
    savedState=performPauseActivity(r.token,false,true);
  }
  handleDestroyActivity(r.token,false,configChanges,true);
  r.activity=null;
  r.window=null;
  r.hideForNow=false;
  r.nextIdle=null;
  if (tmp.pendingResults != null) {
    if (r.pendingResults == null) {
      r.pendingResults=tmp.pendingResults;
    }
 else {
      r.pendingResults.addAll(tmp.pendingResults);
    }
  }
  if (tmp.pendingIntents != null) {
    if (r.pendingIntents == null) {
      r.pendingIntents=tmp.pendingIntents;
    }
 else {
      r.pendingIntents.addAll(tmp.pendingIntents);
    }
  }
  r.startsNotResumed=tmp.startsNotResumed;
  if (savedState != null) {
    r.state=savedState;
  }
  handleLaunchActivity(r,currentIntent);
}

Fixed version (ground truth):
private final void handleRelaunchActivity(ActivityRecord tmp,int configChanges){
  unscheduleGcIdler();
  Configuration changedConfig=null;
  if (DEBUG_CONFIGURATION)   Log.v(TAG,"String_Node_Str" + tmp.token + "String_Node_Str"+ Integer.toHexString(configChanges));
synchronized (mRelaunchingActivities) {
    int N=mRelaunchingActivities.size();
    IBinder token=tmp.token;
    tmp=null;
    for (int i=0; i < N; i++) {
      ActivityRecord r=mRelaunchingActivities.get(i);
      if (r.token == token) {
        tmp=r;
        mRelaunchingActivities.remove(i);
        i--;
        N--;
      }
    }
    if (tmp == null) {
      if (DEBUG_CONFIGURATION)       Log.v(TAG,"String_Node_Str");
      return;
    }
    if (mPendingConfiguration != null) {
      changedConfig=mPendingConfiguration;
      mPendingConfiguration=null;
    }
  }
  if (tmp.createdConfig != null) {
    if (mConfiguration == null || mConfiguration.diff(tmp.createdConfig) != 0) {
      changedConfig=tmp.createdConfig;
    }
  }
  if (DEBUG_CONFIGURATION)   Log.v(TAG,"String_Node_Str" + tmp.token + "String_Node_Str"+ changedConfig);
  if (changedConfig != null) {
    handleConfigurationChanged(changedConfig);
  }
  ActivityRecord r=mActivities.get(tmp.token);
  if (DEBUG_CONFIGURATION)   Log.v(TAG,"String_Node_Str" + r);
  if (r == null) {
    return;
  }
  r.activity.mConfigChangeFlags|=configChanges;
  Intent currentIntent=r.activity.mIntent;
  Bundle savedState=null;
  if (!r.paused) {
    savedState=performPauseActivity(r.token,false,true);
  }
  handleDestroyActivity(r.token,false,configChanges,true);
  r.activity=null;
  r.window=null;
  r.hideForNow=false;
  r.nextIdle=null;
  if (tmp.pendingResults != null) {
    if (r.pendingResults == null) {
      r.pendingResults=tmp.pendingResults;
    }
 else {
      r.pendingResults.addAll(tmp.pendingResults);
    }
  }
  if (tmp.pendingIntents != null) {
    if (r.pendingIntents == null) {
      r.pendingIntents=tmp.pendingIntents;
    }
 else {
      r.pendingIntents.addAll(tmp.pendingIntents);
    }
  }
  r.startsNotResumed=tmp.startsNotResumed;
  if (savedState != null) {
    r.state=savedState;
  }
  handleLaunchActivity(r,currentIntent);
}