I got this after running XEmacs for couple of days.
xemacs-21.4.1: Fatal I/O Error 0 (Error 0) on display connection ":0.0"
after 1861692 requests (1861691 known processed) with 4 events remaining.
(gdb) where
#0 0xfed18228 in _poll () from /usr/lib/libc.so.1
#1 0xfeccb808 in select () from /usr/lib/libc.so.1
#2 0xfefbb5c4 in _XtWaitForSomething () from /usr/openwin/lib/libXt.so.4
#3 0xfefc0798 in XtAppPending () from /usr/openwin/lib/libXt.so.4
#4 0x17bb24 in drain_X_queue ()
#5 0x17bc50 in emacs_Xt_event_pending_p ()
#6 0xb95a0 in event_stream_event_pending_p ()
#7 0xba1bc in detect_input_pending ()
#8 0xbb7a4 in run_pre_idle_hook ()
#9 0xbbb74 in Fnext_event ()
#10 0x6bf7c in Fcommand_loop_1 ()
#11 0x895dc in condition_case_1 ()
#12 0x6b894 in command_loop_3 ()
#13 0x6b8c8 in command_loop_2 ()
#14 0x8923c in internal_catch ()
#15 0x6bac0 in initial_command_loop ()
#16 0x855f0 in xemacs_21_4_1_sparc_sun_solaris2_7 ()
#17 0x85e7c in main ()
Tony