I'm encoutering what I think is a bug in the x86_64 Linux driver. When trying to open more than 455 drawables, glXMakeCurrent fails with a GLXBadDrawable error ( Major opcode 144, minor opcode 5).
The attached program, 'example.c', shows this behaviour. Once compiled, run the program with an integer argument of the number of windows you wish it to open (depending on your machine it may appear to freeze your WM for a moment, but it should recover). Running the program with 455 windows works fine, running with 456 fails with the aforementioned error. I have tried this on multiple machines, with the 180.44 and 180.51 drivers.
I'm aware that opening this many windows is not a typical use case, but the software we run needs to open around 1000 or so; possibly more.
I should note that using the vesa driver, the error does not occur.
Attached is the example program and the output of the nvidia bug reporting script.
Thank you in advance.