I've started using a minor mode which ends up invoking
call-process a lot and at about the same time I started seeing
xemacs (21.4.21) crash with errors like the following:
xemacs: Fatal I/O Error 11 (Resource temporarily
unavailable) on display connection ":0.0"
after 2531260 requests (2531257 known processed) with 0
events remaining.
Autosaving and exiting...
Program exited with code 0106.
These errors are intermittent and difficult to trigger reliably.
After staring at this for a while time, I happened to notice
that begin_dont_check_for_quit is called in the child process
after forking in unix_create_process, but not in the
corresponding part of Fold_call_process_internal. A bit of
poking around with the debugger shows that check_quit can also
be called from this context:
#0 check_quit () at
/scratch/phelps/devel/xemacs-21.4.21/src/signal.c:507
#1 0x000000000048a261 in unbind_to_hairy (count=19)
at /scratch/phelps/devel/xemacs-21.4.21/src/eval.c:4973
#2 0x000000000048a1fb in unbind_to (count=19,
value=140387798618672)
at /scratch/phelps/devel/xemacs-21.4.21/src/eval.c:4959
#3 0x0000000000450cf9 in dfc_convert_to_external_format (
source_type=DFC_TYPE_LISP_STRING, source=0x7fff9f9195c0,
coding_system=140387800737424, sink_type=DFC_TYPE_DATA,
sink=0x7fff9f9195b0)
at /scratch/phelps/devel/xemacs-21.4.21/src/buffer.c:1970
#4 0x000000000045d2c3 in child_setup (in=6, out=8, err=8,
new_argv=0x7fff9f919650,
current_dir=0x3316ba8
"/scratch/phelps/devel/xemacs-21.4.21-debug")
at /scratch/phelps/devel/xemacs-21.4.21/src/callproc.c:725
#5 0x000000000045cc10 in Fold_call_process_internal (nargs=5,
args=0x7fff9f91db38)
at /scratch/phelps/devel/xemacs-21.4.21/src/callproc.c:424
[stack frames #6-#52 elided]
Since check_quit can muck around with the Xlib socket, we
clearly don't want it to be called from this context without
first setting dont_check_for_quit to a non-zero value.
I've copied the call to begin_dont_check_for_quit from
unix_create_process into Fold_call_process_internal and
haven't seen the problem in the last 5 days, so I reckon it's
working. I've attached this trivial patch in the hopes that
you find it useful.
Thanks,
-Ted
|