I was having a problem with code from a GLFW tutorial (open.gl) and I narrowed it down to it being caused by
glfwSwapBuffers(window);
The full code: http://pastebin.com/Evtf5PRf
The CMakeLists.txt I am using: http://pastebin.com/vKUQiMtf
This is on Ubuntu 12.04
Changing to the proprietary drivers has fixed the issue! (See answer from me below)