[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs abort backtrace from C-g in Message mode

From: David Hunter
Subject: Re: emacs abort backtrace from C-g in Message mode
Date: Tue, 17 May 2005 22:16:27 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)

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.


*** 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 */
+       signal (SIGPIPE, old_sigpipe);
 #ifndef VMS
       proc = process_sent_to;
       p = XPROCESS (proc);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]