title: glBindVertexArray random INVALID_OPERATION
body: <p>I am facing a strange crash that randomly appears when trying to bind a VAO.</p>
  
  <p>the VAO itself has previously been generated by glGenVertexArrays, which returns no error.</p>
  
  <pre><code>glGenVertexArrays(NUM_VAO,vao);
  glGenBuffers(NUM_VAO,vbo);
  
  glBindVertexArray(vao[2]);
  glBindBuffer(GL_ARRAY_BUFFER,vbo[2]);
  glBufferData(GL_ARRAY_BUFFER,1024*sizeof(GLfloat),NULL,GL_DYNAMIC_DRAW);
  glVertexAttribPointer(...);
  glEnableVertexAttribArray(...);
  </code></pre>
  
  <p>during execution, a call to:</p>
  
  <pre><code>glBindVertexArray(vao[2])
  </code></pre>
  
  <p>may or may not generate an INVALID_OPERATION. Note that the content of vao[2] is the same returned by glGenVertexArrays and the array is never deleted during execution.</p>
  
  <p>According to the specs, an INVALID_OPERATION is issued only when a non-zero name is passed and the name itself was not returned by glGenVertexArrays, which is clearly not the case.</p>
  
  <p>The problem occurs sporadically, approximately only 15% of the times the application is run, otherwise everything works as expected. The problem persists in debug mode.</p>
  
  <p>I just upgraded my workstation, I used to develop on OpenSUSE 12.1 with NVidia drivers 290.10 and Qt 4.7.1 and never had this problem.</p>
  
  <p>I just moved to OpenSUSE 12.2 with NVidia drivers 304.43 and Qt 4.8.1 and I have this issue.</p>
  
  <p>Have someone encountered such a situation before? Am I missing something?</p>