Program: 149859
Project: 149859
Buggy source:
/** 
 * Return the stack trace 
 */
StackTraceElement[] getStackTrace(Throwable parent){
  if (stackTrace == null) {
    return zeroLengthStackTrace;
  }
 else   if (VM_Scheduler.getCurrentThread().getThreadForStackTrace().isGCThread()) {
    VM.sysWriteln("String_Node_Str");
    VM_Scheduler.dumpStack();
    return zeroLengthStackTrace;
  }
  VM_StackTrace.Element[] vmElements;
  try {
    vmElements=stackTrace.getStackTrace(parent);
  }
 catch (  Throwable t) {
    VM.sysWriteln("String_Node_Str");
    VM_Scheduler.dumpStack();
    return zeroLengthStackTrace;
  }
  if (vmElements == null) {
    VM.sysWriteln("String_Node_Str");
    VM_Scheduler.dumpStack();
    return zeroLengthStackTrace;
  }
  if (VM.fullyBooted) {
    try {
      StackTraceElement[] elements=new StackTraceElement[vmElements.length];
      for (int i=0; i < vmElements.length; i++) {
        VM_StackTrace.Element vmElement=vmElements[i];
        String fileName=vmElement.getFileName();
        int lineNumber=vmElement.getLineNumber();
        String className=vmElement.getClassName();
        String methodName=vmElement.getMethodName();
        boolean isNative=vmElement.isNative();
        elements[i]=new StackTraceElement(fileName,lineNumber,className,methodName,isNative);
      }
      return elements;
    }
 catch (    Throwable t) {
      VM.sysWriteln("String_Node_Str");
    }
  }
 else {
    VM.sysWriteln("String_Node_Str");
  }
  for (  VM_StackTrace.Element vmElement : vmElements) {
    if (vmElement == null) {
      VM.sysWriteln("String_Node_Str");
      VM_Scheduler.dumpStack();
      return zeroLengthStackTrace;
    }
    String fileName=vmElement.getFileName();
    int lineNumber=vmElement.getLineNumber();
    String className=vmElement.getClassName();
    String methodName=vmElement.getMethodName();
    VM.sysWrite("String_Node_Str");
    if (className != null) {
      VM.sysWrite(className);
      VM.sysWrite("String_Node_Str");
    }
    VM.sysWrite(methodName);
    if (fileName != null) {
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(fileName);
      if (lineNumber > 0) {
        VM.sysWrite("String_Node_Str");
        VM.sysWrite(vmElement.getLineNumber());
      }
      VM.sysWrite("String_Node_Str");
    }
    VM.sysWriteln();
  }
  return zeroLengthStackTrace;
}

Fixed version (ground truth):
/** 
 * Return the stack trace 
 */
StackTraceElement[] getStackTrace(Throwable parent){
  if (stackTrace == null) {
    return zeroLengthStackTrace;
  }
 else   if (VM_Scheduler.getCurrentThread().getThreadForStackTrace().isGCThread()) {
    VM.sysWriteln("String_Node_Str");
    VM_Scheduler.dumpStack();
    return zeroLengthStackTrace;
  }
  VM_StackTrace.Element[] vmElements;
  try {
    vmElements=stackTrace.getStackTrace(parent);
  }
 catch (  Throwable t) {
    VM.sysWriteln("String_Node_Str");
    VM_Scheduler.dumpStack();
    return zeroLengthStackTrace;
  }
  if (vmElements == null) {
    VM.sysWriteln("String_Node_Str");
    VM_Scheduler.dumpStack();
    return zeroLengthStackTrace;
  }
  if (VM.fullyBooted) {
    try {
      StackTraceElement[] elements=new StackTraceElement[vmElements.length];
      for (int i=0; i < vmElements.length; i++) {
        VM_StackTrace.Element vmElement=vmElements[i];
        String fileName=vmElement.getFileName();
        int lineNumber=vmElement.getLineNumber();
        String className=vmElement.getClassName();
        String methodName=vmElement.getMethodName();
        boolean isNative=vmElement.isNative();
        elements[i]=new StackTraceElement(fileName,lineNumber,className,methodName,isNative);
      }
      return elements;
    }
 catch (    Throwable t) {
      VM.sysWriteln("String_Node_Str");
    }
  }
 else {
    VM.sysWriteln("String_Node_Str");
  }
  for (  VM_StackTrace.Element vmElement : vmElements) {
    if (vmElement == null) {
      VM.sysWriteln("String_Node_Str");
      VM_Scheduler.dumpStack();
      return zeroLengthStackTrace;
    }
    String fileName=vmElement.getFileName();
    int lineNumber=vmElement.getLineNumber();
    String className=vmElement.getClassName();
    String methodName=vmElement.getMethodName();
    VM.sysWrite("String_Node_Str");
    if (className != "String_Node_Str") {
      VM.sysWrite(className);
      VM.sysWrite("String_Node_Str");
    }
    VM.sysWrite(methodName);
    if (fileName != null) {
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(fileName);
      if (lineNumber > 0) {
        VM.sysWrite("String_Node_Str");
        VM.sysWrite(vmElement.getLineNumber());
      }
      VM.sysWrite("String_Node_Str");
    }
    VM.sysWriteln();
  }
  return zeroLengthStackTrace;
}