Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 4 Oct 2001 04:59:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 4 Oct 2001 04:59:41 -0400 Received: from smtpde02.sap-ag.de ([194.39.131.53]:11153 "EHLO smtpde02.sap-ag.de") by vger.kernel.org with ESMTP id ; Thu, 4 Oct 2001 04:59:34 -0400 From: Christoph Rohland To: Paul Menage Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH][RFC] Pollable /proc// - avoid SIGCHLD/poll() races In-Reply-To: Organisation: SAP LinuxLab Date: 04 Oct 2001 10:59:07 +0200 In-Reply-To: Message-ID: Lines: 24 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SAP: out X-SAP: out Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hi Paul, On Thu, 04 Oct 2001, Paul Menage wrote: > > I've recently run across a problem where a server (in this case, > sshd) can deadlock itself if a SIGCHLD arrives just before it calls > select(), but after it has checked whether its child_terminated. So > when the select() is called, the SIGCHLD signal handler has already > run and set the child_terminated flag, and there's nothing to wake > the select(). > > The only real user-space solution to this is to have the SIGCHLD > handler somehow cause the select() to return immediately ... or implement pselect: http://mesh.eecs.umich.edu/cgi-bin/man2html/usr/share/man/man2/select.2.gz or use sigsetjmp/siglongjmp Both would be portable and not special to child handling. Greetings Christoph - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/