From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23632 invoked by alias); 20 Jul 2013 10:00:22 -0000 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 Received: (qmail 23617 invoked by uid 89); 20 Jul 2013 10:00:21 -0000 X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_40,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RDNS_NONE,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mail-ob0-f176.google.com) (209.85.214.176) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 20 Jul 2013 10:00:20 +0000 Received: by mail-ob0-f176.google.com with SMTP id v19so6341838obq.21 for ; Sat, 20 Jul 2013 03:00:13 -0700 (PDT) X-Received: by 10.182.52.202 with SMTP id v10mr15143910obo.73.1374314413269; Sat, 20 Jul 2013 03:00:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.116.101 with HTTP; Sat, 20 Jul 2013 02:59:33 -0700 (PDT) From: Hui Zhu Date: Sat, 20 Jul 2013 10:00:00 -0000 Message-ID: Subject: [PATCH] Fix PR 12702 - gdb can hang waiting for thread group leader (gdbserver) To: gdb-patches ml Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-07/txt/msg00475.txt.bz2 Hi, I got a issue with leader-exit.exp will hang with target_board=native-gdbserver. I found the reason is gdbserver still have this issue. So I post a patch for gdbserver. Thanks, Hui 2013-07-20 Hui Zhu PR gdb/12702 * linux-low.c (my_waitpid): Check if pid is exiting. --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -423,6 +423,15 @@ my_waitpid (int pid, int *status, int fl if (wnohang) break; + /* If just wait PID and it is exiting, sigsuspend will + hang. So check before call it. */ + if (pid > 0 && linux_proc_pid_is_zombie (pid)) + { + *status = 0; + ret = pid; + break; + } + if (debug_threads) fprintf (stderr, "blocking\n");