Program: 12450
Project: 12450
Buggy source:
/** 
 * 读取新消息 LengthFieldBasedFrameDecoder 自动解包
 */
@Override public void channelRead(ChannelHandlerContext ctx,Object msg){
  if (logger.isDebugEnabled()) {
    logger.info("String_Node_Str" + ctx.channel().hashCode());
  }
  MetricBuilder.requestMeter.mark();
  final PBAPNSEvent cc;
  try {
    byte[] bytes=(byte[])msg;
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",bytes.length);
      logger.debug("String_Node_Str",bytes);
    }
    cc=PBAPNSEvent.newBuilder().mergeFrom(bytes).build();
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    ack(ctx,null);
    return;
  }
  ReferenceCountUtil.release(msg);
  if (cc.getTypeId() == PBAPNSEvent.DeviceTypes.Android_VALUE) {
    MetricBuilder.clientAndroidMeter.mark();
  }
 else   if (cc.getTypeId() == PBAPNSEvent.DeviceTypes.iOS_VALUE) {
    MetricBuilder.clientIOSMeter.mark();
  }
  if (cc.getOp() == PBAPNSEvent.Ops.Online_VALUE) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",cc);
    }
    ConnectionKeeper.add(cc.getAppKey(),cc.getUserId(),new Connection(ctx.channel()));
    MessageHandlerPoolTasks.instance.getExecutor().submit(new OnNewlyAddThread(cc));
    ack(ctx,cc);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",cc);
    }
  }
 else   if (cc.getOp() == PBAPNSEvent.Ops.KeepAlive_VALUE) {
    ack(ctx,cc);
  }
 else   if (cc.getOp() == PBAPNSEvent.Ops.PushAck_VALUE) {
    ack(ctx,cc);
  }
 else   if (cc.getOp() == PBAPNSEvent.Ops.Offline_VALUE) {
    MessageHandlerPoolTasks.instance.getExecutor().submit(new Runnable(){
      @Override public void run(){
        Client c0=ClientServiceImpl.instance.findByUserId(cc.getUserId());
        if (c0 != null) {
          ClientServiceImpl.instance.updateOnlineTs(c0.getId());
        }
      }
    }
);
    ctx.close();
  }
}

Fixed version (ground truth):
/** 
 * 读取新消息 LengthFieldBasedFrameDecoder 自动解包
 */
@Override public void channelRead(ChannelHandlerContext ctx,Object msg){
  if (logger.isDebugEnabled()) {
    logger.info("String_Node_Str" + ctx.channel().hashCode());
  }
  MetricBuilder.requestMeter.mark();
  final PBAPNSEvent cc;
  try {
    byte[] bytes=(byte[])msg;
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",bytes.length);
      logger.debug("String_Node_Str",bytes);
    }
    cc=PBAPNSEvent.newBuilder().mergeFrom(bytes).build();
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    ack(ctx,null);
    return;
  }
  ReferenceCountUtil.release(msg);
  if (cc.getTypeId() == PBAPNSEvent.DeviceTypes.Android_VALUE) {
    MetricBuilder.clientAndroidMeter.mark();
  }
 else   if (cc.getTypeId() == PBAPNSEvent.DeviceTypes.iOS_VALUE) {
    MetricBuilder.clientIOSMeter.mark();
  }
  if (cc.getOp() == PBAPNSEvent.Ops.Online_VALUE) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",cc);
    }
    Connection conn=new Connection(ctx.channel());
    conn.setUserId(cc.getUserId());
    conn.setAppKey(cc.getAppKey());
    ConnectionKeeper.add(cc.getAppKey(),cc.getUserId(),conn);
    MessageHandlerPoolTasks.instance.getExecutor().submit(new OnNewlyAddThread(cc));
    ack(ctx,cc);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",cc);
    }
  }
 else   if (cc.getOp() == PBAPNSEvent.Ops.KeepAlive_VALUE) {
    ack(ctx,cc);
  }
 else   if (cc.getOp() == PBAPNSEvent.Ops.PushAck_VALUE) {
    ack(ctx,cc);
  }
 else   if (cc.getOp() == PBAPNSEvent.Ops.Offline_VALUE) {
    MessageHandlerPoolTasks.instance.getExecutor().submit(new Runnable(){
      @Override public void run(){
        Client c0=ClientServiceImpl.instance.findByUserId(cc.getUserId());
        if (c0 != null) {
          ClientServiceImpl.instance.updateStatus(c0.getId(),ClientStatus.Offline);
        }
      }
    }
);
    ctx.close();
  }
}