I can reproduce the problem with the following:
1. Have the following ~/.vnc/xstartup file:
valgrind --trace-children=yes -v unity-2d-shell &
2. Run vncserver - log file will be created in ~/.vnc. You don't have to connect with vncviewer, it will just crash after a few seconds.
Note that I had to run it via valgrind, otherwise the stacktrace I was getting was completly useless. Attaching valgrind output.
The problem appears to be in XListInputDevices returning NULL list ptr, while indicating positive number of devices.