Created attachment 108740 [details]
Created attachment 108741 [details]
I suspect the problem can occur on machines other than my Intel
machine but I can't confirm. The problem occurs when one closes a
window while it is being rendered to with glClear. The
xcb_wait_for_reply function which is deep in the callstack should
return with a BadDrawable error probably. How I triggered the problem
was that I built and ran my program at
which is a federation of processes and has a seperate process for
drawing to the window than the one that created it and killed the
window creating process while the drawer process was using
glClear. Strangely, while my gui process which listens for user input
failed with an error upon the window being destroyed the drawer
process got stuck in glClear.
Created attachment 108743 [details]
A very hacky test case
One can use this test case and kill the child to reproduce the bug.
A similar problem can happen where eglSwapBuffer returns EGL_FAILURE but then sets the result of eglGetError to EGL_SUCCESS when the window is concurrently closed.