I think I've found a decent workaround for ubuntu now, but I have no idea what's actually wrong tbh. I've posted my workaround to the 'ubuntu installation thread', and posted all the remaining details here.
Fyi, Ubuntu install thread is here:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Integrate;action=display;num=1210090496;start=15
It appears there are several commonly occuring java-related bugs associated with 'xcb locks', whatever they are! And likely aren't restricted to the official Sun runtime. Whilst looking for a solution to this I discovered that glxgears was dying on exit, as described in this bug report:
https://bugs.launchpad.net/ubuntu/+source/xcb/+bug/91077
I fixed that problem by uninstalling the 'OpenJava' runtime.
Sun has an extensive thread on the subject here, fairly little of which I care to understand, but it was informative all the same:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6532373
Two other threads with useful workaround info on the problem are these:
"Java problems after upgrade"
http://ubuntuforums.org/showthread.php?t=816018&highlight=xcb
and, "Cannot start matlab..."
https://answers.launchpad.net/ubuntu/+question/26562
Anyway, I believe the lock problem doesn't occur with the latest install of java-6-sun-1.6.0.06 but processing doesn't use this version. It ships with it's own runtime - 1.5 by the looks of things. This runtime does appear to do 'the bad thing' whatever that may be. Simply renaming the directory and creating a link to the ubuntu installed version works for me (/usr/lib/jvm/java-6-sun-1.6.0.06/).
Painful
Cheers,
Sam