Confirmed that the bug is related to 3D!I do not have any hangs anymore after I commented these two lines in xorg.conf:
Section "Module"
...
#Load "glx"
#Load "GLcore"
...
EndSection
This probably means that the bug actually is not in ksmserver... but in
xorg.
Thanks,
Andriy