Program: 70741
Project: 70741
Buggy source:
public void setupSelection(GLAutoDrawable drawable){
  GL2 gl=myViewer.getGL().getGL2();
  GLU glu=myViewer.getGLU();
  myGl=gl;
  myTotalMaxQ=myViewer.numSelectionQueriesNeeded();
  myCurrentMaxQ=myTotalMaxQ;
  myCurrentIdx=-1;
  myIdxBase=0;
  myMaxQStack.clear();
  myIdxBaseStack.clear();
  gl.glGetIntegerv(GL2.GL_VIEWPORT,mySavedViewport,0);
  gl.glMatrixMode(GL2.GL_PROJECTION);
  gl.glPushMatrix();
  gl.glLoadIdentity();
  myViewW=(int)Math.ceil(myRectW);
  myViewH=(int)Math.ceil(myRectH);
  int[] viewport=new int[]{0,0,myViewW,myViewH};
  glu.gluPickMatrix(myRectX,mySavedViewport[3] - myRectY,myRectW,myRectH,mySavedViewport,0);
  gl.glViewport(viewport[0],viewport[1],viewport[2],viewport[3]);
  Vector2d zRange=new Vector2d();
  myViewer.getZRange(zRange);
  myViewer.setViewVolume(zRange.x,zRange.y);
  gl.glMatrixMode(GL2.GL_MODELVIEW);
  gl.glDisable(GL2.GL_LIGHTING);
  gl.glColor4f(0,0,0,0);
  gl.glGenFramebuffers(1,frameBufferId,0);
  gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER,frameBufferId[0]);
  gl.glGenRenderbuffers(1,renderBufferId,0);
  gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER,renderBufferId[0]);
  gl.glRenderbufferStorage(GL2.GL_RENDERBUFFER,GL2.GL_RGBA8,myViewW,myViewH);
  gl.glFramebufferRenderbuffer(GL2.GL_FRAMEBUFFER,GL2.GL_COLOR_ATTACHMENT0,GL2.GL_RENDERBUFFER,renderBufferId[0]);
  gl.glGenRenderbuffers(1,depthBufferId,0);
  gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER,depthBufferId[0]);
  gl.glRenderbufferStorage(GL2.GL_RENDERBUFFER,GL2.GL_DEPTH_COMPONENT16,myViewW,myViewH);
  gl.glFramebufferRenderbuffer(GL2.GL_FRAMEBUFFER,GL2.GL_DEPTH_ATTACHMENT,GL2.GL_RENDERBUFFER,depthBufferId[0]);
  int status=gl.glCheckFramebufferStatus(GL2.GL_FRAMEBUFFER);
  if (status != GL2.GL_FRAMEBUFFER_COMPLETE) {
    throw new InternalErrorException("String_Node_Str");
  }
  savedBlend=gl.glIsEnabled(GL.GL_BLEND);
  if (savedBlend) {
    gl.glDisable(GL.GL_BLEND);
  }
  savedMulti=gl.glIsEnabled(GL.GL_MULTISAMPLE);
  if (savedMulti) {
    gl.glDisable(GL.GL_MULTISAMPLE);
  }
}

Fixed version (ground truth):
public void setupSelection(GLAutoDrawable drawable){
  GL2 gl=myViewer.getGL().getGL2();
  GLU glu=myViewer.getGLU();
  myGl=gl;
  myTotalMaxQ=myViewer.numSelectionQueriesNeeded();
  myCurrentMaxQ=myTotalMaxQ;
  myCurrentIdx=-1;
  myIdxBase=0;
  myMaxQStack.clear();
  myIdxBaseStack.clear();
  gl.glGetIntegerv(GL2.GL_VIEWPORT,mySavedViewport,0);
  gl.glMatrixMode(GL2.GL_PROJECTION);
  gl.glPushMatrix();
  gl.glLoadIdentity();
  myViewW=(int)Math.ceil(myRectW);
  myViewH=(int)Math.ceil(myRectH);
  int[] viewport=new int[]{0,0,myViewW,myViewH};
  glu.gluPickMatrix(myRectX,mySavedViewport[3] - myRectY,myRectW,myRectH,mySavedViewport,0);
  gl.glViewport(viewport[0],viewport[1],viewport[2],viewport[3]);
  Vector2d zRange=new Vector2d();
  myViewer.getZRange(zRange);
  myViewer.setViewVolume(zRange.x,zRange.y);
  gl.glMatrixMode(GL2.GL_MODELVIEW);
  gl.glDisable(GL2.GL_LIGHTING);
  gl.glColor4f(0,0,0,0);
  fbo=new FrameBufferObject(0,0,myViewW,myViewH,1,null,null,gl);
  fbo.setupFBO();
  fbo.activate();
  savedBlend=gl.glIsEnabled(GL.GL_BLEND);
  if (savedBlend) {
    gl.glDisable(GL.GL_BLEND);
  }
  savedMulti=gl.glIsEnabled(GL.GL_MULTISAMPLE);
  if (savedMulti) {
    gl.glDisable(GL.GL_MULTISAMPLE);
  }
}