I'm trying to synchronize buffer uploads of a glBufferData call using fences. However, it occasionally happens that the program stops inside the glClientWaitSync function and remains there forever. This is the callstack:

1 sched_yield syscall-template.S 84 0x7ffff3fcca37
2 ?? 0x7fffd5259ea4
3 ?? 0x7fffd4efa083
4 ?? 0x7fffd4e6dea2
return ( ::glClientWaitSync ( m_BufferUploadSync, 0, 1 ) == GL_ALREADY_SIGNALED ); // this is to check if the buffer has already uploaded and is probed once per frame.

This i how the fence is initialized before:

m_BufferUploadSync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);

It usually happens when I upload/render lots of stuff. Is this normal?