So, I've done some looking and it seems that the BadAccess is supposedly caused by trying to make an opengl current while it is being used by another thread. However - the same binary works fine on most desktop environments (cinnamon, gnome 2.x and 3.x, IceWM (with metacity running)) but not on unity and lxde (sometimes - this one is hit and miss).

Thus, I tested it in a single threaded program - with exactly the same results under the troublesome desktop environments. GDB is of no use at all as it thinks the program terminated successfully and thus refuses to give me a trace of any kind.

Is anyone aware of anything that could cause this behaviour to happen or of some technical reason why some desktop environments are causing this/ The only workaround for the time being is to switch to the SDL backend which is slow, buggy and lacking (no FBOs and such).