From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4777 invoked by alias); 12 May 2005 21:14:42 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4724 invoked from network); 12 May 2005 21:14:39 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 12 May 2005 21:14:39 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50) id 1DWL0x-0003jG-HG; Thu, 12 May 2005 17:14:39 -0400 Date: Thu, 12 May 2005 21:35:00 -0000 From: Daniel Jacobowitz To: Ulrich Weigand Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Fix internal error in wait_lwp (interrupted system call) Message-ID: <20050512211439.GA14174@nevyn.them.org> Mail-Followup-To: Ulrich Weigand , gdb-patches@sources.redhat.com References: <20050512191849.GA10326@nevyn.them.org> <200505122102.j4CL2tCS014283@53v30g15.boeblingen.de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200505122102.j4CL2tCS014283@53v30g15.boeblingen.de.ibm.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-05/txt/msg00313.txt.bz2 On Thu, May 12, 2005 at 11:02:55PM +0200, Ulrich Weigand wrote: > Daniel Jacobowitz wrote: > > > On the one hand, this is very clever. On the other hand, it's not very > > robust. This is not the only signal that could arrive. Shouldn't > > wait_lwp be looping on EINTR anyway, probably by using my_waitpid > > (which is a recent addition)? > > Well, this isn't very robust either as waitpid isn't the only system > call that could be interrupted -- it just typically has the biggest > race window as it tends to sleep ... > > Using SA_RESTART has the advantage that it handles *all* (well, > nearly all) system calls automatically, without having to add > EINTR loops all over the place. > > If other signals are in fact a problem, too, I'd rather install > them with SA_RESTART too. (However, I haven't ever seen the > problem with any other signal.) I think that's because GDB mostly uses signal(). That automatically has SA_RESTART behavior, right? I'm just worried that this will require non-local fixes; the SIGCHLD handler was in the same file, but arbitrary other signal handlers could be at arbitrary places in GDB. Not handling EINTR from a library call which is allowed to return EINTR is, pedantically, always a bug. Perhaps we should make both changes. -- Daniel Jacobowitz CodeSourcery, LLC