Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Mar 2003 02:40:09 -0800 (PST)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/50100: Ping doesn't handle SIGINT while resolving hosts
Message-ID:  <200303191040.h2JAe9S9058075@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/50100; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: Johan Mulder <johan@localhost.nl>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/50100: Ping doesn't handle SIGINT while resolving hosts
Date: Wed, 19 Mar 2003 21:38:40 +1100 (EST)

 On Tue, 18 Mar 2003, Johan Mulder wrote:
 
 > On Wed, Mar 19, 2003 at 07:13:57AM +1100, Bruce Evans wrote:
 > > On Wed, 12 Mar 2003, Johan Mulder wrote:
 > > > >Fix:
 > > >
 > > > 	Fix the signal handler.
 > >
 > > The signal handler is not broken.  Last time I looked the bug seemed to
 > > be deep in the resolver library.  res_send() retries after EINTR for some
 > > reason.
 >
 > Ok. So then I should do a bug report for res_send I suppose? ;>
 
 I think another one is unnecessary.  Maxim Konovalov pointed out an old
 PR about the same bug.
 
 The bug seems to be in almost every networking function that checks
 EINTR.  It is a rather silly bug.  These functions "know" that they
 must always restart the select(), poll(), kevent(), accept() and
 recvfrom() syscalls explicity after a signal is caught because the
 kernel never does it, but they never restart other syscalls because
 the kernel "always" does it.  However, the kernel actually only restarts
 other syscalls if SA_RESTART is set for the relevant signal.  Restarting
 some syscalls unconditionally breaks this.  I think res_send() needs
 to restart if and only if the EINTR was for a signal with SA_RESTART
 clear, but it can't do this because it can't determine anything about
 the signal except that there was one.
 
 Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303191040.h2JAe9S9058075>