Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: gdb-patches ml <gdb-patches@sourceware.org>
Subject: [PATCH] Fix PR 12702 - gdb can hang waiting for thread group leader (gdbserver)
Date: Sat, 20 Jul 2013 10:00:00 -0000	[thread overview]
Message-ID: <CANFwon2cWyxzWi+Sqfk6mUK0ZCWQRisMmGWe6mxPMgDLTV_j2g@mail.gmail.com> (raw)

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  <hui@codesourcery.com>

	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");


             reply	other threads:[~2013-07-20 10:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-20 10:00 Hui Zhu [this message]
2013-07-24 18:25 ` Pedro Alves
2013-11-19  6:19   ` Hui Zhu
2014-01-23 14:51     ` Pedro Alves
2014-01-23 14:10       ` [PATCH 1/5] Move ptid_match to common/ptid.c Pedro Alves
2014-01-23 14:10         ` [PATCH 4/5] Teach gdbserver's linux backend about no unwaited-for children (TARGET_WAITDKIND_NO_RESUMED) Pedro Alves
2014-01-23 14:10         ` [PATCH 5/5] Add TARGET_WAITKIND_NO_RESUMED support to the RSP Pedro Alves
2014-01-23 14:10         ` [PATCH 3/5] Linux waitpid/__WALL emulation wrapper: If WNOHANG is set, don't touch sigprocmask Pedro Alves
2014-02-27 14:47           ` Pedro Alves
2014-01-23 14:10         ` [PATCH 2/5] Move status_to_str to nat/linux-waitpid.c Pedro Alves
2014-02-27 14:38       ` [PATCH] Fix PR 12702 - gdb can hang waiting for thread group leader (gdbserver) Pedro Alves
2014-02-27 14:54         ` Luis Machado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANFwon2cWyxzWi+Sqfk6mUK0ZCWQRisMmGWe6mxPMgDLTV_j2g@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox