Program: 179516
Project: 179516
Buggy source:
@Override public void run(){
  while (!stopOperation) {
    try {
      NetworkMessage msg=messageQueue.take();
      Schema schema;
      byte classType;
      if (msg instanceof PlayerRegistrationMessage) {
        schema=playerRegSchema;
        classType=1;
      }
 else       if (msg instanceof NetworkMessageMedium) {
        schema=mediumMsgSchema;
        classType=2;
      }
 else       if (msg instanceof NetworkMessageLarge) {
        schema=largeMsgSchema;
        classType=3;
      }
 else {
        schema=networkMsgSchema;
        classType=0;
      }
      byte[] serializedObject=ProtostuffIOUtil.toByteArray(msg,schema,buffer);
      b.clear();
      b.putInt(serializedObject.length);
      byte[] lengthField=b.array();
      byte[] message=new byte[serializedObject.length + lengthField.length + 1];
      message[0]=classType;
      System.arraycopy(lengthField,0,message,1,lengthField.length);
      System.arraycopy(serializedObject,0,message,lengthField.length + 1,serializedObject.length);
      os.write(message);
      os.flush();
    }
 catch (    IOException e) {
      System.err.println("String_Node_Str" + e);
    }
catch (    InterruptedException e) {
    }
catch (    Exception e) {
      System.err.println("String_Node_Str");
      e.printStackTrace(System.err);
    }
 finally {
      buffer.clear();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (!stopOperation) {
    try {
      NetworkMessage msg=messageQueue.take();
      Schema schema;
      byte classType;
      if (msg instanceof PlayerRegistrationMessage) {
        schema=playerRegSchema;
        classType=1;
      }
 else       if (msg instanceof NetworkMessageMedium) {
        schema=mediumMsgSchema;
        classType=2;
      }
 else       if (msg instanceof NetworkMessageLarge) {
        schema=largeMsgSchema;
        classType=3;
      }
 else {
        schema=networkMsgSchema;
        classType=0;
      }
      byte[] serializedObject=ProtostuffIOUtil.toByteArray(msg,schema,buffer);
      b.clear();
      b.putInt(serializedObject.length);
      byte[] lengthField=b.array();
      byte[] message=new byte[serializedObject.length + lengthField.length + 1];
      message[0]=classType;
      System.arraycopy(lengthField,0,message,1,lengthField.length);
      System.arraycopy(serializedObject,0,message,lengthField.length + 1,serializedObject.length);
      if (message.length > 8000) {
        System.out.println("String_Node_Str" + message.length + "String_Node_Str");
        int bytesWriten=0;
        while (bytesWriten != message.length) {
          if (message.length - bytesWriten > 4096) {
            os.write(message,bytesWriten,4096);
            bytesWriten+=4096;
            System.out.println("String_Node_Str" + bytesWriten + "String_Node_Str"+ message.length+ "String_Node_Str");
          }
 else {
            os.write(message,bytesWriten,message.length - bytesWriten);
            bytesWriten+=message.length - bytesWriten;
            System.out.println("String_Node_Str" + bytesWriten + "String_Node_Str"+ message.length+ "String_Node_Str");
          }
        }
      }
 else {
        os.write(message);
      }
      os.flush();
    }
 catch (    IOException e) {
      System.err.println("String_Node_Str" + e);
    }
catch (    InterruptedException e) {
    }
catch (    Exception e) {
      System.err.println("String_Node_Str");
      e.printStackTrace(System.err);
    }
 finally {
      buffer.clear();
    }
  }
}