Have you tried to run it without windowing, i.e. using command
$ xemacs -nw
I know, you like xemacs because of "x", but if you do not get the error message any more, then problem might be on the X window libraries.
For this kind of problem I have used trace tools; trace, strace or...