Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix PR 12702 - gdb can hang waiting for thread group leader (gdbserver)
@ 2013-07-20 10:00 Hui Zhu
  2013-07-24 18:25 ` Pedro Alves
  0 siblings, 1 reply; 12+ messages in thread
From: Hui Zhu @ 2013-07-20 10:00 UTC (permalink / raw)
  To: gdb-patches ml

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-02-27 14:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-20 10:00 [PATCH] Fix PR 12702 - gdb can hang waiting for thread group leader (gdbserver) Hui Zhu
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox