Richard Stallman wrote:
Does this fix it?
<patch against process.c 1.450>

I finally reproduced this bug.  By opening a TCP network stream 
(`open-network-stream') to a localhost server that connects and immediately 
closes the connection, then attempting to write to the stream, a reliable 
SIGPIPE is thrown.  strace shows that emacs fails to unblock SIGPIPE or restore 
the signal handler.

Richard fixed the blocked SIGPIPE.  The following patch restores the signal 
handler.  I have not verified that it's possible to crash emacs by killing the 
X server after a SIGPIPE (or that anyone would see the result), but strace 
output validates the change.

-Dave

*** process.c 14 May 2005 14:06:33 -0000 1.451
--- process.c 17 May 2005 04:02:22 -0000
***************
*** 5134,5139 ****
--- 5134,5140 ----
int rv;
struct coding_system *coding;
struct gcpro gcpro1;
+ volatile SIGTYPE (*old_sigpipe)();
GCPRO1 (object);
***************
*** 5258,5264 ****
while (len > 0)
{
int this = len;
- SIGTYPE (*old_sigpipe)();
/* Decide how much data we can send in one batch.
Long lines need to be split into multiple batches. */
--- 5259,5264 ----
***************
*** 5401,5406 ****
--- 5401,5407 ----
#endif /* not VMS */
else
{
+ signal (SIGPIPE, old_sigpipe);
#ifndef VMS
proc = process_sent_to;
p = XPROCESS (proc);




_______________________________________________
Emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to