Crash while cleaning up an exiting process in 21.5.

stephen at xemacs.org stephen at xemacs.org
Tue Aug 22 05:33:05 EDT 2006


Malcolm Purvis writes:

 > On my Mac the following function causes 21.5 HEAD to crash out with a Fatal
 > Error 13.

Now I observe this, don't know why I didn't see it before (and don't
know why I tried it again, for that matter!)

Lstreams don't know anything about what they're driving, but AFAIK
they are able to detect if what they're driving is dead.  So it looks
to me like where (in deactivate_process in process.c) we go

/* ---------------- cut ---------------- */
  if (!NILP (DATA_OUTSTREAM (p)))
    Lstream_close (XLSTREAM (DATA_OUTSTREAM (p)));
  if (!NILP (DATA_INSTREAM (p)))
    Lstream_close (XLSTREAM (DATA_INSTREAM (p)));
  if (!NILP (DATA_ERRSTREAM (p)))
    Lstream_close (XLSTREAM (DATA_ERRSTREAM (p)));

  /* Provide minimal implementation for deactivate_process
     if there's no process-specific one */
  if (HAS_PROCMETH_P (deactivate_process))
    PROCMETH (deactivate_process, (p, &in_usid, &err_usid));
  else
    event_stream_delete_io_streams (p->pipe_instream,
				    p->pipe_outstream,
				    p->pipe_errstream,
				    &in_usid, &err_usid);
/* ---------------- cut ---------------- */

we should close the process's io_streams first (which is protected
from SIGPIPE for exactly this reason in process-unix.c, see
unix_deactivate_process), then close the DATA_*STREAMS (which are
coding streams that protect the process streams from having to know
about character encoding).

Ben, can this cause any trouble?

Steve

P.S.  Ben I got your other mail and will be working on it in a bit.




More information about the XEmacs-Beta mailing list