I've been hitting this bug regularly and I agree its pretty annoying.
The synergy X11 backend claims to only make Xlib calls from the main thread:
// NOTE -- the X display is shared among several objects but is owned
// by the CXWindowsScreen. Xlib is not reentrant so we must ensure
// that no two objects can simultaneously call Xlib with the display.
// this is easy since we only make X11 calls from the main thread.
This is not true, for example we call Xflush() from multiple threads:
I'm not an Xlib expert, but it appears that we need to call XInitThreads() if we multiple threads call into Xlib. The following patch does that, and I haven't seen the fail with it applied in a few hours (usually fails in 30 minutes).
I've been hitting this bug regularly and I agree its pretty annoying.
The synergy X11 backend claims to only make Xlib calls from the main thread:
// NOTE -- the X display is shared among several objects but is owned
// by the CXWindowsScreen. Xlib is not reentrant so we must ensure
// that no two objects can simultaneously call Xlib with the display.
// this is easy since we only make X11 calls from the main thread.
This is not true, for example we call Xflush() from multiple threads:
synergyc( CXWindowsEventQ ueueBuffer: :flush( )+0x55) synergyc( CXWindowsEventQ ueueBuffer: :waitForEvent( double) +0x60) CEventQueue: :getEvent( CEvent& , double)+0x157) main+0x13d)
synergyc(
synergyc
synergyc(
and:
synergyc( CXWindowsEventQ ueueBuffer: :flush( )+0x55) CXWindowsEventQ ueueBuffer: :addEvent( unsigned int)+0x82) CEventQueue: :addEvent( CEvent const&)+0x72) CTCPSocket: :sendEvent( unsigned int)+0x55) CTCPSocket: :serviceConnect ed(ISocketMulti plexerJob* , bool, bool, bool)+0x16f) TSocketMultiple xerMethodJob< CTCPSocket> ::run(bool, bool, bool)+0x5b) CSocketMultiple xer::serviceThr ead(void* )+0x2d1) TMethodJob< CSocketMultiple xer>::run( )+0x2a) CThread: :threadFunc( void*)+ 0x76) CArchMultithrea dPosix: :doThreadFunc( CArchThreadImpl *)+0x50) CArchMultithrea dPosix: :threadFunc( void*)+ 0x42) i686/cmov/ libpthread. so.0 i686/cmov/ libc.so. 6(clone+ 0x5e)
synergyc(
synergyc(
synergyc(
synergyc(
synergyc(
synergyc(
synergyc(
synergyc(
synergyc(
synergyc(
/lib/tls/
/lib/tls/
I'm not an Xlib expert, but it appears that we need to call XInitThreads() if we multiple threads call into Xlib. The following patch does that, and I haven't seen the fail with it applied in a few hours (usually fails in 30 minutes).