I have the same issue. I tested the above short example with my laptop running Vista64 with Ubuntu32 10.04 guest OS. Drivers are nVidia 195.62 on Quadro FX 770M. I then downloaded and installed bugle (opengl capture) and ran it like this:
bme@bme-vbox:~$ BUGLE_CHAIN=trace LD_PRELOAD=./libbugle.so ./opengl-test
glutInit
glutInitDisplayMode
glutInitWindowPosition
glutInitWindowSize
glutCreateWindow
OpenGL Warning: XGetVisualInfo returned 0 visuals for 9b9c250
Segmentation fault
The output of the trace gives this:
bme@bme-vbox:~$ cat bugle.log
[INFO] trace.call: glXQueryExtension(0x9a852e0, NULL, NULL) = True
[INFO] trace.call: glXChooseFBConfig(0x9a852e0, 0, 0xbff9f5c4 -> { GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, GLX_DEPTH_SIZE, 1, GLX_SYNC_FRAME_SGIX }, 0xbff9f75c -> 64) = 0x9a93028 -> { 0x9b9c250, 0x9b9f850, 0x9b9c5b0, 0x9b9fbb0, 0x9b9c400, 0x9b9fa00, 0x9b9c760, 0x9b9fd60, 0x9b9cfd0, 0x9ba05d0, 0x9b9d330, 0x9ba0930, 0x9b9d180, 0x9ba0780, 0x9b9d4e0, 0x9ba0ae0, 0x9b9b4d0, 0x9b9ead0, 0x9b9b830, 0x9b9ee30, 0x9b9b680, 0x9b9ec80, 0x9b9b9e0, 0x9b9efe0, 0x9b9a750, 0x9b9dd50, 0x9b9aab0, 0x9b9e0b0, 0x9b9a900, 0x9b9df00, 0x9b9ac60, 0x9b9e260, 0x9b9c328, 0x9b9f928, 0x9b9c688, 0x9b9fc88, 0x9b9c4d8, 0x9b9fad8, 0x9b9c838, 0x9b9fe38, 0x9b9d0a8, 0x9ba06a8, 0x9b9d408, 0x9ba0a08, 0x9b9d258, 0x9ba0858, 0x9b9d5b8, 0x9ba0bb8, 0x9b9b5a8, 0x9b9eba8, 0x9b9b908, 0x9b9ef08, 0x9b9b758, 0x9b9ed58, 0x9b9bab8, 0x9b9f0b8, 0x9b9a828, 0x9b9de28, 0x9b9ab88, 0x9b9e188, 0x9b9a9d8, 0x9b9dfd8, 0x9b9ad38, 0x9b9e338 }
Only 2 opengl calls are made and returns seemingly valid information.
glXChooseFBConfig return 64 GLX frame buffer configurations and glut calls XGetVisualInfo with dpy (1. arg) set to the first returned GLX frame buffer configuration pointer at which point it crashes.
I am not sure if calling XGetVisualInfo with a GLX frame buffer configuration is allowed or not (I dont think it is). I would have thought that glXGetVisualFromFBConfig should have been used instead of XGetVisualInfo. freeglut3 could be buggy here?