Program: 59967
Project: 59967
Buggy source:
protected void skipHeapRecord(int tag,InputStream in) throws IOException {
switch (tag) {
case HeapTag.ROOT_UNKNOWN:
    in.skip(4);
  break;
case HeapTag.ROOT_JNI_GLOBAL:
in.skip(8);
break;
case HeapTag.ROOT_JNI_LOCAL:
in.skip(12);
break;
case HeapTag.ROOT_JAVA_FRAME:
in.skip(12);
break;
case HeapTag.ROOT_NATIVE_STACK:
in.skip(8);
break;
case HeapTag.ROOT_STICKY_CLASS:
in.skip(4);
break;
case HeapTag.ROOT_THREAD_BLOCK:
in.skip(8);
break;
case HeapTag.ROOT_MONITOR_USED:
in.skip(4);
break;
case HeapTag.ROOT_THREAD_OBJECT:
in.skip(12);
break;
case HeapTag.CLASS_DUMP:
{
in.skip(36);
short constantCount=readShort(in);
for (int i=0; i < constantCount; i++) {
in.skip(2);
BasicType type=BasicType.fromType(in.read());
in.skip(type.size);
}
short staticCount=readShort(in);
for (int i=0; i < staticCount; i++) {
in.skip(4);
BasicType type=BasicType.fromType(in.read());
in.skip(type.size);
}
short fieldCount=readShort(in);
for (int i=0; i < fieldCount; i++) {
in.skip(4);
in.skip(1);
}
break;
}
case HeapTag.INSTANCE_DUMP:
{
in.skip(12);
int size=readInt(in);
in.skip(size);
break;
}
case HeapTag.OBJECT_ARRAY_DUMP:
{
in.skip(8);
int count=readInt(in);
in.skip(4);
in.skip(4 * count);
break;
}
case HeapTag.PRIMITIVE_ARRAY_DUMP:
{
in.skip(8);
int count=readInt(in);
BasicType type=BasicType.fromType(in.read());
in.skip(type.size * count);
break;
}
case HeapTag.HPROF_HEAP_DUMP_INFO:
in.skip(8);
break;
case HeapTag.HPROF_ROOT_INTERNED_STRING:
in.skip(4);
break;
case HeapTag.HPROF_ROOT_FINALIZING:
in.skip(4);
break;
case HeapTag.HPROF_ROOT_DEBUGGER:
in.skip(4);
break;
case HeapTag.HPROF_ROOT_REFERENCE_CLEANUP:
in.skip(4);
break;
case HeapTag.HPROF_ROOT_VM_INTERNAL:
in.skip(4);
break;
case HeapTag.HPROF_ROOT_JNI_MONITOR:
in.skip(12);
break;
case HeapTag.HPROF_UNREACHABLE:
in.skip(4);
break;
case HeapTag.HPROF_PRIMITIVE_ARRAY_NODATA_DUMP:
in.skip(13);
break;
default :
System.out.println("String_Node_Str" + Integer.toHexString(tag));
throw new IllegalArgumentException("String_Node_Str" + Integer.toHexString(tag) + "String_Node_Str");
}
}

Fixed version (ground truth):
protected void skipHeapRecord(int tag,InputStream in) throws IOException {
switch (tag) {
case HeapTag.ROOT_UNKNOWN:
    skip(in,4);
  break;
case HeapTag.ROOT_JNI_GLOBAL:
skip(in,8);
break;
case HeapTag.ROOT_JNI_LOCAL:
skip(in,12);
break;
case HeapTag.ROOT_JAVA_FRAME:
skip(in,12);
break;
case HeapTag.ROOT_NATIVE_STACK:
skip(in,8);
break;
case HeapTag.ROOT_STICKY_CLASS:
skip(in,4);
break;
case HeapTag.ROOT_THREAD_BLOCK:
skip(in,8);
break;
case HeapTag.ROOT_MONITOR_USED:
skip(in,4);
break;
case HeapTag.ROOT_THREAD_OBJECT:
skip(in,12);
break;
case HeapTag.CLASS_DUMP:
{
skip(in,36);
short constantCount=readShort(in);
for (int i=0; i < constantCount; i++) {
skip(in,2);
BasicType type=BasicType.fromType(in.read());
skip(in,type.size);
}
short staticCount=readShort(in);
for (int i=0; i < staticCount; i++) {
skip(in,4);
BasicType type=BasicType.fromType(in.read());
skip(in,type.size);
}
short fieldCount=readShort(in);
for (int i=0; i < fieldCount; i++) {
skip(in,4);
skip(in,1);
}
break;
}
case HeapTag.INSTANCE_DUMP:
{
skip(in,12);
int size=readInt(in);
skip(in,size);
break;
}
case HeapTag.OBJECT_ARRAY_DUMP:
{
skip(in,8);
int count=readInt(in);
skip(in,4);
skip(in,4 * count);
break;
}
case HeapTag.PRIMITIVE_ARRAY_DUMP:
{
skip(in,8);
int count=readInt(in);
BasicType type=BasicType.fromType(in.read());
skip(in,type.size * count);
break;
}
case HeapTag.HPROF_HEAP_DUMP_INFO:
skip(in,8);
break;
case HeapTag.HPROF_ROOT_INTERNED_STRING:
skip(in,4);
break;
case HeapTag.HPROF_ROOT_FINALIZING:
skip(in,4);
break;
case HeapTag.HPROF_ROOT_DEBUGGER:
skip(in,4);
break;
case HeapTag.HPROF_ROOT_REFERENCE_CLEANUP:
skip(in,4);
break;
case HeapTag.HPROF_ROOT_VM_INTERNAL:
skip(in,4);
break;
case HeapTag.HPROF_ROOT_JNI_MONITOR:
skip(in,12);
break;
case HeapTag.HPROF_UNREACHABLE:
skip(in,4);
break;
case HeapTag.HPROF_PRIMITIVE_ARRAY_NODATA_DUMP:
skip(in,13);
break;
default :
System.out.println("String_Node_Str" + Integer.toHexString(tag));
throw new IllegalArgumentException("String_Node_Str" + Integer.toHexString(tag) + "String_Node_Str");
}
}