From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25426 invoked by alias); 18 May 2011 19:32:58 -0000 Received: (qmail 25415 invoked by uid 22791); 18 May 2011 19:32:57 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 May 2011 19:32:38 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4IJWU3L001279 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 18 May 2011 15:32:30 -0400 Received: from host1.jankratochvil.net (ovpn-113-35.phx2.redhat.com [10.3.113.35]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p4IJWS1s010384 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 May 2011 15:32:30 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p4IJWRix018148; Wed, 18 May 2011 21:32:27 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p4IJWQDm018138; Wed, 18 May 2011 21:32:26 +0200 Date: Wed, 18 May 2011 19:32:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org, Doug Evans Subject: Re: [patch] Workaround for 10970, 12702, avoid calling waitpid Message-ID: <20110518193226.GA14601@host1.jankratochvil.net> References: <20110517181920.7EE51246196@ruffy.mtv.corp.google.com> <201105181916.59767.pedro@codesourcery.com> <20110518185302.GA5585@host1.jankratochvil.net> <201105182017.22006.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201105182017.22006.pedro@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00409.txt.bz2 On Wed, 18 May 2011 21:17:21 +0200, Pedro Alves wrote: > When the last lwp exits, we'll report it's exit code as the > inferior exit code to infrun, instead of the leader's exit > code. Which is correct, isn't it? $ ./groupexit; echo $? 5 (gdb) run Starting program: /home/jkratoch/t/groupexit [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [New Thread 0x7ffff7822700 (LWP 18087)] [Thread 0x7ffff7822700 (LWP 18087) exited] [Inferior 1 (process 18084) exited with code 05] Thanks, Jan #include #include #include static void *start (void *arg) { sleep (1); _exit (5); return arg; } int main (void) { pthread_t thread1; int i; i = pthread_create (&thread1, NULL, start, NULL); assert (i == 0); pthread_exit (NULL); assert (0); return 0; }