Program: 191584
Project: 191584
Buggy source:
void dumpTotalsLocked(PrintWriter pw,long now){
  pw.println("String_Node_Str");
  DumpUtils.dumpSingleTime(pw,"String_Node_Str",mMemFactorDurations,mMemFactor,mStartTime,now);
  pw.println();
  pw.println("String_Node_Str");
  TotalMemoryUseCollection totalMem=new TotalMemoryUseCollection(ALL_SCREEN_ADJ,ALL_MEM_ADJ);
  computeTotalMemoryUse(totalMem,now);
  long totalPss=0;
  totalPss=printMemoryCategory(pw,"String_Node_Str","String_Node_Str",totalMem.sysMemKernelWeight,totalMem.totalTime,totalPss,totalMem.sysMemSamples);
  totalPss=printMemoryCategory(pw,"String_Node_Str","String_Node_Str",totalMem.sysMemNativeWeight,totalMem.totalTime,totalPss,totalMem.sysMemSamples);
  for (int i=0; i < STATE_COUNT; i++) {
    if (i != STATE_SERVICE_RESTARTING) {
      totalPss=printMemoryCategory(pw,"String_Node_Str",DumpUtils.STATE_NAMES[i],totalMem.processStateWeight[i],totalMem.totalTime,totalPss,totalMem.processStateSamples[i]);
    }
  }
  totalPss=printMemoryCategory(pw,"String_Node_Str","String_Node_Str",totalMem.sysMemCachedWeight,totalMem.totalTime,totalPss,totalMem.sysMemSamples);
  totalPss=printMemoryCategory(pw,"String_Node_Str","String_Node_Str",totalMem.sysMemFreeWeight,totalMem.totalTime,totalPss,totalMem.sysMemSamples);
  totalPss=printMemoryCategory(pw,"String_Node_Str","String_Node_Str",totalMem.sysMemZRamWeight,totalMem.totalTime,totalPss,totalMem.sysMemSamples);
  pw.print("String_Node_Str");
  DebugUtils.printSizeValue(pw,totalPss);
  pw.println();
  printMemoryCategory(pw,"String_Node_Str",DumpUtils.STATE_NAMES[STATE_SERVICE_RESTARTING],totalMem.processStateWeight[STATE_SERVICE_RESTARTING],totalMem.totalTime,totalPss,totalMem.processStateSamples[STATE_SERVICE_RESTARTING]);
  pw.println();
  pw.print("String_Node_Str");
  pw.print(DateFormat.format("String_Node_Str",mTimePeriodStartClock));
  pw.println();
  pw.print("String_Node_Str");
  TimeUtils.formatDuration((mRunning ? SystemClock.elapsedRealtime() : mTimePeriodEndRealtime) - mTimePeriodStartRealtime,pw);
  boolean partial=true;
  if ((mFlags & FLAG_SHUTDOWN) != 0) {
    pw.print("String_Node_Str");
    partial=false;
  }
  if ((mFlags & FLAG_SYSPROPS) != 0) {
    pw.print("String_Node_Str");
    partial=false;
  }
  if ((mFlags & FLAG_COMPLETE) != 0) {
    pw.print("String_Node_Str");
    partial=false;
  }
  if (partial) {
    pw.print("String_Node_Str");
  }
  pw.print(' ');
  pw.print(mRuntime);
  pw.println();
}

Fixed version (ground truth):
void dumpTotalsLocked(PrintWriter pw,long now){
  pw.println("String_Node_Str");
  DumpUtils.dumpSingleTime(pw,"String_Node_Str",mMemFactorDurations,mMemFactor,mStartTime,now);
  pw.println();
  pw.println("String_Node_Str");
  TotalMemoryUseCollection totalMem=new TotalMemoryUseCollection(ALL_SCREEN_ADJ,ALL_MEM_ADJ);
  computeTotalMemoryUse(totalMem,now);
  long totalPss=0;
  totalPss=printMemoryCategory(pw,"String_Node_Str","String_Node_Str",totalMem.sysMemKernelWeight,totalMem.totalTime,totalPss,totalMem.sysMemSamples);
  totalPss=printMemoryCategory(pw,"String_Node_Str","String_Node_Str",totalMem.sysMemNativeWeight,totalMem.totalTime,totalPss,totalMem.sysMemSamples);
  for (int i=0; i < STATE_COUNT; i++) {
    if (i != STATE_SERVICE_RESTARTING) {
      totalPss=printMemoryCategory(pw,"String_Node_Str",DumpUtils.STATE_NAMES[i],totalMem.processStateWeight[i],totalMem.totalTime,totalPss,totalMem.processStateSamples[i]);
    }
  }
  totalPss=printMemoryCategory(pw,"String_Node_Str","String_Node_Str",totalMem.sysMemCachedWeight,totalMem.totalTime,totalPss,totalMem.sysMemSamples);
  totalPss=printMemoryCategory(pw,"String_Node_Str","String_Node_Str",totalMem.sysMemFreeWeight,totalMem.totalTime,totalPss,totalMem.sysMemSamples);
  totalPss=printMemoryCategory(pw,"String_Node_Str","String_Node_Str",totalMem.sysMemZRamWeight,totalMem.totalTime,totalPss,totalMem.sysMemSamples);
  pw.print("String_Node_Str");
  DebugUtils.printSizeValue(pw,totalPss);
  pw.println();
  printMemoryCategory(pw,"String_Node_Str",DumpUtils.STATE_NAMES[STATE_SERVICE_RESTARTING],totalMem.processStateWeight[STATE_SERVICE_RESTARTING],totalMem.totalTime,totalPss,totalMem.processStateSamples[STATE_SERVICE_RESTARTING]);
  pw.println();
  pw.print("String_Node_Str");
  pw.print(DateFormat.format("String_Node_Str",mTimePeriodStartClock));
  pw.println();
  pw.print("String_Node_Str");
  TimeUtils.formatDuration((mRunning ? SystemClock.elapsedRealtime() : mTimePeriodEndRealtime) - mTimePeriodStartRealtime,pw);
  boolean partial=true;
  if ((mFlags & FLAG_SHUTDOWN) != 0) {
    pw.print("String_Node_Str");
    partial=false;
  }
  if ((mFlags & FLAG_SYSPROPS) != 0) {
    pw.print("String_Node_Str");
    partial=false;
  }
  if ((mFlags & FLAG_COMPLETE) != 0) {
    pw.print("String_Node_Str");
    partial=false;
  }
  if (partial) {
    pw.print("String_Node_Str");
  }
  if (mHasSwappedOutPss) {
    pw.print("String_Node_Str");
  }
  pw.print(' ');
  pw.print(mRuntime);
  pw.println();
}