driver crash if VAO is bound after EBO

Seems like this is a long-standing issue:

glGenBuffers(1, &ebo);
glGenVertexArrays(1, &vao);
glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, nullptr);

Exception thrown at 0x0000000066C68EC0 (nvoglv64.dll) in test.exe: 0xC0000005: Access violation reading location 0x0000000000000000:
nvoglv64.dll!0000000066c68ec0() Unknown
nvoglv64.dll!00000000663ca42c() Unknown

glDrawElements(unsigned int arg0=4, int arg1=3, unsigned int arg2=5125, const void * arg3=0x0000000000000000)

Moving the VAO init to the beginning avoids the crash. The same code works on the iGPU IIRC.
Windows 10.0.18362 Driver v436.15
GTX 1060

Note that it crashes in a different place in a separate thread if the number of elements is larger.

Hi, newbie here, with no experience in OpenGL or NVidia (or anything). That said, looking at the spec for glDrawElements, it appears that the arg3, which is currently nullptr, cannot be nullptr (== 0). It has to point to the beginning of the indices that you intend to render.

My guess for a fix would be something like:

glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &vao);

If the compiler complains about that, try:

glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &vao[0]);

If a VAO is bound that parameter becomes an offset.