From owner-freebsd-questions@FreeBSD.ORG Tue Apr 11 11:00:00 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B74916A403 for ; Tue, 11 Apr 2006 11:00:00 +0000 (UTC) (envelope-from xfb52@dial.pipex.com) Received: from smtp-out4.blueyonder.co.uk (smtp-out4.blueyonder.co.uk [195.188.213.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA51643D49 for ; Tue, 11 Apr 2006 10:59:59 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from [172.23.170.143] (helo=anti-virus02-10) by smtp-out4.blueyonder.co.uk with smtp (Exim 4.52) id 1FTGbF-0005wf-N1; Tue, 11 Apr 2006 11:59:57 +0100 Received: from [80.192.25.195] (helo=[192.168.0.2]) by asmtp-out2.blueyonder.co.uk with esmtp (Exim 4.52) id 1FTGbE-00067Q-BT; Tue, 11 Apr 2006 11:59:56 +0100 Message-ID: <443B8C2B.7080006@dial.pipex.com> Date: Tue, 11 Apr 2006 11:59:55 +0100 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.12) Gecko/20060305 X-Accept-Language: en MIME-Version: 1.0 To: Keith Bottner References: <027201c65ca5$54c89ab0$0e01a8c0@Stile> In-Reply-To: <027201c65ca5$54c89ab0$0e01a8c0@Stile> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: SIGCHLD and sockets HELP! X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2006 11:00:00 -0000 Keith Bottner wrote: >I am having a problem with SIGCHLD signals and their interaction with >sockets. > >I have an application that forks modules in separate processes and use UNIX >domain sockets for communication. The main application handles the SIGCHLD >signal so that it can detect when/if a module crashes and if so restart that >specific module. The problem arises when the module crashes and before the >main application is notified with the SIGCHLD signal the socket will >continue to allow writes. I expected that there would be occasions when the >SIGCHLD signal would occur after my attempt to write into the socket, but I >also expected the socket to return an error at which point I could then mark >the module for restart as well. > >My question is, has anybody else had this problem? Does anybody know exactly >what is going on an why? And most importantly, does anybody have a solution? > >Thanks in advance for your time, it is quite an interesting problem so I am >hoping to get some insightful answers. > > No-one is chiming in so maybe it would help if you posted a code fragment that shows the write to the socket which you expect to fail, but which doesn't seem to. --Alex