Program: 5765
Project: 5765
Buggy source:
public MapTable getMap(){
  MapTable map=new MapTable();
  ELFSection name=sections[symTable.link];
  int len=symTable.size;
  int count=len / symTable.entSize;
  int addr=symTable.offset;
  String currentFile="String_Node_Str";
  if (DEBUG) {
    System.out.println("String_Node_Str" + count);
  }
  int currentAddress=0;
  for (int i=0, n=count; i < n; i++) {
    pos=addr;
    int nI=readElf32();
    String sn=name.getName(nI);
    int sAddr=readElf32();
    int size=readElf32();
    int info=readElf8();
    int bind=info >> 4;
    int type=info & 0xf;
    if (type == 0 && "String_Node_Str".equals(sn)) {
      if (currentFile != null) {
        System.out.println("String_Node_Str" + currentFile + "String_Node_Str"+ Utils.hex16(currentAddress)+ "String_Node_Str"+ Utils.hex16(sAddr));
        files.add(new FileInfo(currentFile,currentAddress,sAddr));
        currentAddress=sAddr;
      }
    }
    if (type == ELFSection.SYMTYPE_FILE) {
      currentFile=sn;
    }
    if (DEBUG) {
      System.out.println("String_Node_Str" + sn + "String_Node_Str"+ Integer.toString(sAddr,16)+ "String_Node_Str"+ bind+ "String_Node_Str"+ type+ "String_Node_Str"+ size);
    }
    if (sAddr > 0 && sAddr < 0x10000) {
      String symbolName=sn;
      if ("String_Node_Str".equals(symbolName)) {
        map.setHeapStart(sAddr);
      }
 else       if ("String_Node_Str".equals(symbolName)) {
        map.setStackStart(sAddr);
      }
      if (type == ELFSection.SYMTYPE_FUNCTION) {
        String file=lookupFile(sAddr);
        if (file == null)         file=currentFile;
        map.setEntry(new MapEntry(MapEntry.TYPE.function,sAddr,symbolName,file,bind == ELFSection.SYMBIND_LOCAL));
      }
 else       if (type == ELFSection.SYMTYPE_OBJECT) {
        String file=lookupFile(sAddr);
        if (file == null)         file=currentFile;
        map.setEntry(new MapEntry(MapEntry.TYPE.variable,sAddr,symbolName,file,bind == ELFSection.SYMBIND_LOCAL));
      }
 else {
        if (DEBUG) {
          System.out.println("String_Node_Str" + symbolName + "String_Node_Str"+ Integer.toString(sAddr,16)+ "String_Node_Str"+ currentFile+ "String_Node_Str");
        }
      }
    }
    addr+=symTable.entSize;
  }
  return map;
}

Fixed version (ground truth):
public MapTable getMap(){
  MapTable map=new MapTable();
  ELFSection name=sections[symTable.link];
  int len=symTable.size;
  int count=len / symTable.entSize;
  int addr=symTable.offset;
  String currentFile="String_Node_Str";
  if (DEBUG) {
    System.out.println("String_Node_Str" + count);
  }
  int currentAddress=0;
  for (int i=0, n=count; i < n; i++) {
    pos=addr;
    int nI=readElf32();
    String sn=name.getName(nI);
    int sAddr=readElf32();
    int size=readElf32();
    int info=readElf8();
    int bind=info >> 4;
    int type=info & 0xf;
    if (type == ELFSection.SYMTYPE_NONE && sn != null) {
      if ("String_Node_Str".equals(sn)) {
        if (currentFile != null) {
          System.out.println("String_Node_Str" + currentFile + "String_Node_Str"+ Utils.hex16(currentAddress)+ "String_Node_Str"+ Utils.hex16(sAddr));
          files.add(new FileInfo(currentFile,currentAddress,sAddr));
          currentAddress=sAddr;
        }
      }
 else       if (!sn.startsWith("String_Node_Str")) {
        System.out.println("String_Node_Str" + sn + "String_Node_Str"+ sAddr);
        map.setEntry(new MapEntry(MapEntry.TYPE.variable,sAddr,sn,currentFile,false));
      }
    }
    if (type == ELFSection.SYMTYPE_FILE) {
      currentFile=sn;
    }
    if (DEBUG) {
      System.out.println("String_Node_Str" + sn + "String_Node_Str"+ Integer.toString(sAddr,16)+ "String_Node_Str"+ bind+ "String_Node_Str"+ type+ "String_Node_Str"+ size);
    }
    if (sAddr > 0 && sAddr < 0x10000) {
      String symbolName=sn;
      if ("String_Node_Str".equals(symbolName)) {
        map.setHeapStart(sAddr);
      }
 else       if ("String_Node_Str".equals(symbolName)) {
        map.setStackStart(sAddr);
      }
      if (type == ELFSection.SYMTYPE_FUNCTION) {
        String file=lookupFile(sAddr);
        if (file == null)         file=currentFile;
        map.setEntry(new MapEntry(MapEntry.TYPE.function,sAddr,symbolName,file,bind == ELFSection.SYMBIND_LOCAL));
      }
 else       if (type == ELFSection.SYMTYPE_OBJECT) {
        String file=lookupFile(sAddr);
        if (file == null)         file=currentFile;
        map.setEntry(new MapEntry(MapEntry.TYPE.variable,sAddr,symbolName,file,bind == ELFSection.SYMBIND_LOCAL));
      }
 else {
        if (DEBUG) {
          System.out.println("String_Node_Str" + symbolName + "String_Node_Str"+ Integer.toString(sAddr,16)+ "String_Node_Str"+ currentFile+ "String_Node_Str");
        }
      }
    }
    addr+=symTable.entSize;
  }
  return map;
}