Program: 113465
Project: 113465
Buggy source:
@Override public void startRequest(MRCRequest rq) throws Throwable {
  final listxattrRequest rqArgs=(listxattrRequest)rq.getRequestArgs();
  final VolumeManager vMan=master.getVolumeManager();
  final FileAccessManager faMan=master.getFileAccessManager();
  validateContext(rq);
  Path p=new Path(rqArgs.getVolumeName(),rqArgs.getPath());
  StorageManager sMan=vMan.getStorageManagerByName(p.getComp(0));
  PathResolver res=new PathResolver(sMan,p);
  faMan.checkSearchPermission(sMan,res,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
  res.checkIfFileDoesNotExist();
  FileMetadata file=res.getFile();
  Map<String,byte[]> attrs=new HashMap<String,byte[]>();
  DatabaseResultSet<XAttr> myAttrs=sMan.getXAttrs(file.getId(),rq.getDetails().userId);
  DatabaseResultSet<XAttr> globalAttrs=sMan.getXAttrs(file.getId(),StorageManager.GLOBAL_ID);
  while (globalAttrs.hasNext()) {
    XAttr attr=globalAttrs.next();
    attrs.put(attr.getKey(),attr.getValue());
  }
  globalAttrs.destroy();
  while (myAttrs.hasNext()) {
    XAttr attr=myAttrs.next();
    attrs.put(attr.getKey(),attr.getValue());
  }
  myAttrs.destroy();
  for (  SysAttrs attr : SysAttrs.values()) {
    String key="String_Node_Str" + attr.toString();
    String value=MRCHelper.getSysAttrValue(master.getConfig(),sMan,master.getOSDStatusManager(),faMan,res.toString(),file,attr.toString());
    if (!value.equals("String_Node_Str"))     attrs.put(key,value.getBytes());
  }
  List<String> policyAttrNames=MRCHelper.getSpecialAttrNames(sMan,file.getId(),MRCHelper.POLICY_ATTR_PREFIX);
  for (  String attr : policyAttrNames)   attrs.put(attr,new byte[0]);
  List<String> volAttrAttrNames=MRCHelper.getSpecialAttrNames(sMan,file.getId(),MRCHelper.VOL_ATTR_PREFIX);
  for (  String attr : volAttrAttrNames)   attrs.put(attr,new byte[0]);
  listxattrResponse.Builder result=listxattrResponse.newBuilder();
  Iterator<Entry<String,byte[]>> it=attrs.entrySet().iterator();
  while (it.hasNext()) {
    Entry<String,byte[]> attr=it.next();
    org.xtreemfs.pbrpc.generatedinterfaces.MRC.XAttr.Builder builder=org.xtreemfs.pbrpc.generatedinterfaces.MRC.XAttr.newBuilder().setName(attr.getKey());
    if (!rqArgs.getNamesOnly())     builder.setValue(new String(attr.getValue())).setValueBytes(ByteString.copyFrom(attr.getValue()));
    result.addXattrs(builder.build());
  }
  rq.setResponse(result.build());
  finishRequest(rq);
}

Fixed version (ground truth):
@Override public void startRequest(MRCRequest rq) throws Throwable {
  final listxattrRequest rqArgs=(listxattrRequest)rq.getRequestArgs();
  final VolumeManager vMan=master.getVolumeManager();
  final FileAccessManager faMan=master.getFileAccessManager();
  validateContext(rq);
  Path p=new Path(rqArgs.getVolumeName(),rqArgs.getPath());
  StorageManager sMan=vMan.getStorageManagerByName(p.getComp(0));
  PathResolver res=new PathResolver(sMan,p);
  faMan.checkSearchPermission(sMan,res,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
  res.checkIfFileDoesNotExist();
  FileMetadata file=res.getFile();
  Map<String,byte[]> attrs=new HashMap<String,byte[]>();
  DatabaseResultSet<XAttr> myAttrs=sMan.getXAttrs(file.getId(),rq.getDetails().userId);
  DatabaseResultSet<XAttr> globalAttrs=sMan.getXAttrs(file.getId(),StorageManager.GLOBAL_ID);
  while (globalAttrs.hasNext()) {
    XAttr attr=globalAttrs.next();
    attrs.put(attr.getKey(),attr.getValue());
  }
  globalAttrs.destroy();
  while (myAttrs.hasNext()) {
    XAttr attr=myAttrs.next();
    attrs.put(attr.getKey(),attr.getValue());
  }
  myAttrs.destroy();
  for (  SysAttrs attr : SysAttrs.values()) {
    String key="String_Node_Str" + attr.toString();
    String value=MRCHelper.getSysAttrValue(master.getConfig(),sMan,master.getOSDStatusManager(),faMan,res.toString(),file,attr.toString());
    if (!value.equals("String_Node_Str"))     attrs.put(key,value.getBytes());
  }
  if (file.getId() == 1) {
    List<String> policyAttrNames=MRCHelper.getSpecialAttrNames(sMan,MRCHelper.POLICY_ATTR_PREFIX);
    for (    String attr : policyAttrNames)     attrs.put(attr,sMan.getXAttr(1,StorageManager.SYSTEM_UID,attr));
    List<String> volAttrAttrNames=MRCHelper.getSpecialAttrNames(sMan,MRCHelper.VOL_ATTR_PREFIX);
    for (    String attr : volAttrAttrNames)     attrs.put(attr,sMan.getXAttr(1,StorageManager.SYSTEM_UID,attr));
  }
  listxattrResponse.Builder result=listxattrResponse.newBuilder();
  for (  Entry<String,byte[]> attr : attrs.entrySet()) {
    org.xtreemfs.pbrpc.generatedinterfaces.MRC.XAttr.Builder builder=org.xtreemfs.pbrpc.generatedinterfaces.MRC.XAttr.newBuilder().setName(attr.getKey());
    if (!rqArgs.getNamesOnly())     builder.setValue(new String(attr.getValue())).setValueBytes(ByteString.copyFrom(attr.getValue()));
    result.addXattrs(builder.build());
  }
  rq.setResponse(result.build());
  finishRequest(rq);
}