This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Re: PTRACE_EVENT_CLONE patch causing deadlock?
- From: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- To: drow at false dot org (Daniel Jacobowitz)
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 29 Jul 2004 20:34:17 +0200 (CEST)
- Subject: [PATCH] Re: PTRACE_EVENT_CLONE patch causing deadlock?
Daniel Jacobowitz wrote:
> Probably it's never been tested. Resuming the parent seems right to
> me - see lin_lwp_handle_extended. Does just adding a PTRACE_CONT in
> there work?
Indeed, the following patch fixes the deadlock.
Tested on s390-ibm-linux and s390x-ibm-linux.
OK?
ChangeLog:
* lin-lwp.c (child_wait): Continue inferior after processing
PTRACE_EVENT_CLONE event.
Index: gdb/lin-lwp.c
===================================================================
RCS file: /cvs/src/src/gdb/lin-lwp.c,v
retrieving revision 1.56
diff -c -p -r1.56 lin-lwp.c
*** gdb/lin-lwp.c 26 Jul 2004 14:53:02 -0000 1.56
--- gdb/lin-lwp.c 29 Jul 2004 13:16:34 -0000
*************** child_wait (ptid_t ptid, struct target_w
*** 1213,1218 ****
--- 1213,1219 ----
{
ptrace (PTRACE_DETACH, ourstatus->value.related_pid, 0, 0);
ourstatus->kind = TARGET_WAITKIND_IGNORE;
+ ptrace (PTRACE_CONT, pid, 0, 0);
pid = -1;
save_errno = EINTR;
}
--
Dr. Ulrich Weigand
weigand@informatik.uni-erlangen.de