The system hangs in _NET_WM_SYNC_REQUEST protocol processing.
If a client window try to participate in _NET_WM_SYNC_REQUEST protocol and use XSyncSetCounter with swapped low and high part of the XSyncValue argument, the whole system hangs immediately after the XSyncSetCounter (xcb_sync_set_counter) function call.
In the same time, XSyncSetCounter works OK if executed without activated _NET_WM_SYNC_REQUEST protocol. This way proving that the problem is in the window manager.
In addition, the same application runs with openbox without such an issues. (Of course _NET_WM_SYNC_REQUEST is not working at all).
I'm not sure whether this is because the counter value is too high, or the high part is expected to be 0 somewhere in the code.