title: Segfault on glNamedBufferStorage
body: <p>I am currently reading the OpenGL Super Bible 7th edition. Based on that, I wrote some simple code like this:</p>
  
  <pre><code>void startup() {
      static const float data[] = {
          0.25f, -0.25f, 0.5f, 1.0f,
          -0.25f, -0.25f, 0.5f, 1.0f,
          0.25f, 0.25f, 0.5f, 1.0f,
      };
  
  
      glGenVertexArrays(1, &amp;m_VAO);
      glBindVertexArray(m_VAO);
  
      glGenBuffers(1, &amp;m_VBO);
      glBindBuffer(GL_ARRAY_BUFFER, m_VBO);
      printf("Size of data[]: %lu bytes\n", sizeof(data));
      glNamedBufferStorage(m_VBO, sizeof(data), data, GL_DYNAMIC_STORAGE_BIT);
      glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), NULL);
      glEnableVertexAttribArray(0);
  
  }
  </code></pre>
  
  <p>This is a method of a class that is run before the main rendering loop.</p>
  
  <p>The problem is that this code generates a segfault at <code>glNamedBufferStorage</code>.</p>
  
  <p>I tried debugging it with gdb - and learned only where the segfault occurs, not why. I tried to understand if there is a problem with <code>data</code>'s size (hence the <code>printf sizeof</code>). But it seems to be ok. I also tried to use different flags - also to no avail.</p>
  
  <p>I also did a <code>grep -R</code> on the accompanying source code, but found no usage examples.</p>
  
  <p>System: Ubuntu, clang++</p>