delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/12/27/11:59:48

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Wed, 27 Dec 2000 11:59:00 -0500
From: Jason Tishler <Jason DOT Tishler AT dothill DOT com>
To: Cygwin <cygwin AT sources DOT redhat DOT com>
Subject: Signal Handler Overwrites errno (or YACPP)
Message-ID: <20001227115900.B251@dothill.com>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
Organization: Dot Hill Systems Corp.

On Fri, 10 Dec 1999 20:51:27 -0500, Chris Faylor wrote:
> I've checked in changes that seem to fix this.  It was an interesting
> problem.  read() was setting the EINTR errno but it was getting
> overwritten by a signal handler because I've changed the way signal
> handlers are called now.  Although, actually, I would not be surprised
> to hear that this cropped up with B20.1 one time in a thousand too.
> 
> So, now, in some situations, I save the errno for restoration when
> a signal handler returns.

I am observing the same behavior as above but with select() and a SIGCHLD
handler when PostgreSQL has multiple TCP/IP connections.  Unfortunately,
this causes PostgreSQL's postmaster to abort since it perceives that
select() has returned with an unexpected error.

At first, I (possibly erroneously) concluded that the problem was on
the PostgreSQL side and I "fixed" it by modifying the appropriate signal
handler (i.e., reaper()) to save and restore errno.  If interested, see
the following for details:

    http://www.postgresql.org/mhonarc/pgsql-ports/2000-12/msg00046.html

After some reflection over the holidays (i.e., pondering on how Cygwin
would implement POSIX signals and handlers using the Win32 API) and
searching of the archives, I am no longer sure now.

What is responsible for preserving the errno value during signal handler
execution?  Is it the system (e.g., Cygwin) or the application (e.g.,
PostgreSQL)?

I've started to read the relevant Cygwin code, but it is (understandably)
not the easiest portion to grok.  So, I've decided to punt until I
hopefully get some feedback on whether or not this is actually a Cygwin
problem.

Thanks,
Jason

-- 
Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corp.               Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason DOT Tishler AT dothill DOT com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019