From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29483 invoked by alias); 14 Jun 2005 13:56:43 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 29302 invoked by uid 22791); 14 Jun 2005 13:56:25 -0000 Received: from ext-nj2gw-3.online-age.net (HELO ext-nj2gw-3.online-age.net) (216.35.73.165) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 14 Jun 2005 13:56:25 +0000 Received: from int-nj2gw-5.online-age.net (int-nj2gw-5 [3.159.236.69]) by ext-nj2gw-3.online-age.net (8.12.9/8.12.9/990426-RLH) with ESMTP id j5EDtvkT012618 for ; Tue, 14 Jun 2005 09:56:01 -0400 (EDT) Received: from uswaumsxb1medge.am.med.ge.com (localhost [127.0.0.1]) by int-nj2gw-5.online-age.net (8.12.9/8.12.8/990426-RLH) with ESMTP id j5EDttNu004880 for ; Tue, 14 Jun 2005 09:55:56 -0400 (EDT) Received: from uswaumsxb3medge.am.med.ge.com (uswaumsxb3medge.med.ge.com [3.57.24.74]) by uswaumsxb1medge.am.med.ge.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2656.59) id MSMGJJN8; Tue, 14 Jun 2005 08:55:55 -0500 Received: from gsao.gso.med.ge.com (uswaucs03 [3.57.24.237]) by uswaumsxb3medge.am.med.ge.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2656.59) id M8FBZF36; Tue, 14 Jun 2005 08:55:55 -0500 Received: from godzilla (IDENT:12539@godzilla [3.70.204.208]) by gsao.gso.med.ge.com (8.12.10+Sun/8.12.10) with ESMTP id j5EDuimk010235 for ; Tue, 14 Jun 2005 08:56:44 -0500 (CDT) Date: Tue, 14 Jun 2005 13:56:00 -0000 From: Rich Coe To: gdb@sources.redhat.com Subject: gdb x86_64 ERESTARTNOHAND Message-ID: <20050614085425.6717c34b@godzilla> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2005-06/txt/msg00129.txt.bz2 Run the program below in gdb on x86_64, compiled either -m32 or 64 bit, stop the execution with control-C call a function, in this case doNothing(), but sleep(1) works as well continue gdb passes errno 514 to the program. 514=ERESTARTNOHAND I see that strace prints out information about ERESTARTNOHAND, so it knows about it. I was wondering if gdb should know about this, is this an x86_64 kernel error, or what? Even though strace knows about ERESTARTNOHAND on i386, and prints it, gdb does not print or cause the program to receive this errno on a 32bit kernel. -- Rich Coe richard.coe@med.ge.com General Electric Healthcare Technologies Global Software Platforms, Computer Technology Team #include #include #include #include int myselect(int fd, void* ptr) { printf("myselect\n"); fd_set in; AGAIN: FD_ZERO(&in); FD_SET(fd, &in); if(select(32, &in, 0, 0, 0) == -1) { printf("select error=%d: %s\n", errno, strerror(errno)); } goto AGAIN; return 0; } int func_two(int fd, void* ptr) { printf("func_two\n"); return myselect(fd, ptr); } int func_one(int fd, void*ptr) { printf("func_one\n"); return func_two(fd, ptr); } void catch(int sig) { char buf[218]; sprintf(buf, "caught %d\n", sig); write(fileno(stdout), buf, strlen(buf)); } void docatch() { struct sigaction act = { 0 } ; act.sa_handler = catch; //act.sa_mask = 0; act.sa_flags = 0; /* auto restart interrupted system calls */ act.sa_flags = SA_RESTART; if(sigaction(SIGINT, &act, NULL) < 0) { perror(__FILE__ ": sigaction"); exit(1); } if(sigaction(SIGHUP, &act, NULL) < 0) { perror(__FILE__ ": sigaction"); exit(1); } if(sigaction(SIGTERM, &act, NULL) < 0) { perror(__FILE__ ": sigaction"); exit(1); } } int a = 0; void doNothing() { a += 5; } int main(int argc, char*argv[]) { doNothing(); docatch(); printf("main\n"); return func_one(fileno(stdin), myselect); }