I currently test shared contextes with a render thread that issues render commands and a background thread that issues buffer uploads. I use fence sync for synchronization of the two. Recently however I have to fight with segfaults, so I enabled a debug context with error callbacks and got the following error message:
glClientWaitSync: sync is not the name of an existing Sync Object(GL_INVALID_VALUE)
I added logging to every glDeleteSync call too see who might destroy the sync object but it apparently never happens.
What commands besides glDeleteSync could cause a deletion of the sync object in a way that the error above is triggered?