From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24480 invoked by alias); 13 May 2005 12:37:21 -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 24437 invoked from network); 13 May 2005 12:37:14 -0000 Received: from unknown (HELO mtagate2.de.ibm.com) (195.212.29.151) by sourceware.org with SMTP; 13 May 2005 12:37:14 -0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.12.10/8.12.10) with ESMTP id j4DCbDSp160828 for ; Fri, 13 May 2005 12:37:13 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j4DCbD3r259258 for ; Fri, 13 May 2005 14:37:13 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11/8.13.3) with ESMTP id j4DCbCY4023850 for ; Fri, 13 May 2005 14:37:13 +0200 Received: from 53v30g15.boeblingen.de.ibm.com (53v30g15.boeblingen.de.ibm.com [9.152.26.155]) by d12av02.megacenter.de.ibm.com (8.12.11/8.12.11) with ESMTP id j4DCbCfH023847; Fri, 13 May 2005 14:37:12 +0200 Received: from 53v30g15.boeblingen.de.ibm.com (localhost [127.0.0.1]) by 53v30g15.boeblingen.de.ibm.com (8.12.10/8.12.10) with ESMTP id j4DCatql014771; Fri, 13 May 2005 14:36:55 +0200 Received: (from uweigand@localhost) by 53v30g15.boeblingen.de.ibm.com (8.12.10/8.12.10/Submit) id j4DCatE5014770; Fri, 13 May 2005 14:36:55 +0200 From: Ulrich Weigand Message-Id: <200505131236.j4DCatE5014770@53v30g15.boeblingen.de.ibm.com> Subject: Re: [RFA] Fix internal error in wait_lwp (interrupted system call) To: drow@false.org (Daniel Jacobowitz) Date: Fri, 13 May 2005 13:43:00 -0000 Cc: uweigand@de.ibm.com (Ulrich Weigand), gdb-patches@sources.redhat.com In-Reply-To: <20050512211439.GA14174@nevyn.them.org> from "Daniel Jacobowitz" at May 12, 2005 05:14:39 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2005-05/txt/msg00324.txt.bz2 Daniel Jacobowitz wrote: > I think that's because GDB mostly uses signal(). That automatically > has SA_RESTART behavior, right? Andreas Schwab wrote: > Depends on whether signal() has BSD or SYSV semantics. I wasn't completely certain how to verify this at the source code level, so I simply checked via 'strace': and indeed the signal() library calls performed by gdb are transformed to sigaction() system calls *with* SA_RESTART set on my Linux system. This is IMO yet another argument for using SA_RESTART with the explicit sigaction calls in linux-nat.c as well. Daniel Jacobowitz wrote: > 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. As verifying correct EINTR handling everywhere appears to be a major effort, and the simple SA_RESTART patch both fixes a serious problem, and appears to be correct in any case, I'd argue for applying that patch now, and maybe later on adding EINTR handling as required. Bye, Ulrich -- Dr. Ulrich Weigand Linux on zSeries Development Ulrich.Weigand@de.ibm.com