title: GLEW 1.10: EXC_BAD_ACCESS in glewInit
body: <p>Trying to initialize the recent GLEW, the program interrupts and lldb gives the mentioned message.</p>
  
  <p>Minimal example:</p>
  
  <pre><code>#define GLEW_STATIC
  #include &lt;GL/glew.h&gt;
  
  int main(int argc, const char * argv[]) {
      glewExperimental = GL_TRUE;
      glewInit();    &lt;&lt;&lt;&lt; EXC_BAD_ACCESS here
  }
  </code></pre>
  
  <p>The stack frames the debugger outputs:</p>
  
  <p><code>1 ___lldb_unnamed_function...</code>:</p>
  
  <pre><code>libGLEW.1.10.0.dylib`___lldb_unnamed_function2$$libGLEW.1.10.0.dylib:
  0x100005e30:  pushq  %rbp
  0x100005e31:  movq   %rsp, %rbp
  0x100005e34:  pushq  %r15
  0x100005e36:  pushq  %r14
  0x100005e38:  pushq  %r12
  0x100005e3a:  pushq  %rbx
  0x100005e3b:  movl   $7938, %edi
  0x100005e40:  callq  0x100044668               ; symbol stub for: glGetString
  0x100005e45:  movl   $1, %r14d        &lt;&lt;&lt;&lt; EXC_BAD_ACCESS here
  0x100005e4b:  testq  %rax, %rax
  0x100005e4e:  je     0x100034a86               ; ___lldb_unnamed_function2$$libGLEW.1.10.0.dylib + 191574
  ...
  </code></pre>
  
  <p><code>0 glGetString</code>:</p>
  
  <pre><code>libGL.dylib`glGetString:
  0x7fff8bfa28a6:  pushq  %rbp
  0x7fff8bfa28a7:  movq   %rsp, %rbp
  0x7fff8bfa28aa:  movl   %edi, %eax
  0x7fff8bfa28ac:  movq   %gs:240, %rdx
  0x7fff8bfa28b5:  movq   944(%rdx), %rcx    &lt;&lt;&lt;&lt; EXC_BAD_ACCESS here
  0x7fff8bfa28bc:  movq   (%rdx), %rdi
  0x7fff8bfa28bf:  movl   %eax, %esi
  0x7fff8bfa28c1:  popq   %rbp
  0x7fff8bfa28c2:  jmpq   *%rcx
  </code></pre>
  
  <p>Is this some error in GLEW, or in my configuration?</p>