PM: fix ptrace(T_EXIT) 'exit_proc: not idle' race condition.

This commit is contained in:
David van Moolenbroek
2009-07-11 13:22:56 +00:00
parent 14f3a0e018
commit 1a9e07b0e5
9 changed files with 66 additions and 63 deletions
+8 -1
View File
@@ -112,7 +112,14 @@ PUBLIC int do_trace()
switch (m_in.request) {
case T_EXIT: /* exit */
exit_proc(child, (int) m_in.data, PM_EXIT_TR);
child->mp_flags |= TRACE_EXIT;
/* Defer the exit if the traced process has an FS call pending. */
if (child->mp_fs_call != PM_IDLE || child->mp_fs_call2 != PM_IDLE)
child->mp_exitstatus = (int) m_in.data; /* save for later */
else
exit_proc(child, (int) m_in.data, FALSE /*dump_core*/);
/* Do not reply to the caller until FS has processed the exit
* request.
*/