Saturday, 12 May 2012

Synergy 1.3.8 crashes with Shift & other modifier keys

Synergy is one of those reliable applications which rarely goes wrong. However, following an upgrade either to the client or server, my Ubuntu synergy client crashed every time I used a modifier key such as Shift. Oddly enough, I have two synergy clients (one Debian, one Ubuntu), both using the same version (1.3.8), yet only the Ubuntu client suffered from this problem.


This problem is not uncommon, and the accepted solution is to upgrade to the latest beta version of synergy on both the server and the affected client.


Upgrading Ubuntu to 1.4.8 beta was predictably easy; download the .deb and install using your method of choice; either double-click or use dpkg.

Upgrading the synergy server was more complex, since that runs on my FreeBSD box. I originally installed it via the ports collection.

The process I followed was:

$ wget http://synergy.googlecode.com/files/synergy-1.4.8-Source.tar.gz
$ tar xf synergy-1.4.8-Source.tar.gz
$ cd synergy-1.4.8-Source
$ chmod +x configure
$ ./configure

Then I hit an error about a missing XKBlib.h. That clearly wasn't the case, the configure script was just looking in the wrong place:


$ find /usr/ -name XKBlib.h 2>/dev/null
/usr/local/include/X11/XKBlib.h

After messing around with CMakeLists.txt for some time without success, I found a helpful comment on an issue tracker which provided the less-than-obvious workaround:

$ rm -f CMakeCache.txt
$ cmake \
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \
-DCMAKE_C_FLAGS="${CFLAGS} -I/usr/local/include -L/usr/local/lib" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS} -I/usr/local/include -L/usr/local/lib" \
-G "Unix Makefiles"

After that, I could proceed:

$ ./configure
$ make
$ cd bin
# cp synergys /usr/local/bin/synergys-1.4.8b
# mv /usr/local/bin/synergys /usr/local/bin/synergys-1.3.8
# ln -s /usr/local/bin/synergys-1.4.8b /usr/local/bin/synergys
# pkill synergys
# synergys -c /etc/synergy.conf