From e75fa13f1038436d0ebd4cabd637c4c477c125de Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Sun, 7 Mar 1999 23:21:44 +0000 Subject: Sun Mar 7 18:19:07 1999 Thomas Bushnell, BSG * mgt.c (process_has_exited): Use mach_port_destroy instead of mach_port_deallocate to release P->p_msgport. (complete_exit): Likewise for P->p_task. These changes eliminate a race; we are destroying the receiver of the dead-name notifications on these ports, but if that means we lose a notification, then the ref-count on the name will get incremented and we can't re-decrement it since we never hear the notification. --- proc/ChangeLog | 11 +++++++++++ proc/mgt.c | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'proc') diff --git a/proc/ChangeLog b/proc/ChangeLog index 4bb36d93..772abb05 100644 --- a/proc/ChangeLog +++ b/proc/ChangeLog @@ -1,3 +1,14 @@ +Sun Mar 7 18:19:07 1999 Thomas Bushnell, BSG + + * mgt.c (process_has_exited): Use mach_port_destroy instead of + mach_port_deallocate to release P->p_msgport. + (complete_exit): Likewise for P->p_task. + These changes eliminate a race; we are destroying the receiver of + the dead-name notifications on these ports, but if that means we + lose a notification, then the ref-count on the name will get + incremented and we can't re-decrement it since we never hear the + notification. + 1999-03-06 Mark Kettenis * notify.c (do_mach_notify_dead_name): Deallocate reference to diff --git a/proc/mgt.c b/proc/mgt.c index e8af38d4..4a8aa510 100644 --- a/proc/mgt.c +++ b/proc/mgt.c @@ -1,5 +1,5 @@ /* Process management - Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1999 Free Software Foundation, Inc. This file is part of the GNU Hurd. @@ -652,7 +652,7 @@ process_has_exited (struct proc *p) alert_parent (p); if (p->p_msgport) - mach_port_deallocate (mach_task_self (), p->p_msgport); + mach_port_destroy (mach_task_self (), p->p_msgport); p->p_msgport = MACH_PORT_NULL; prociterate ((void (*) (struct proc *, void *))check_message_dying, p); @@ -717,7 +717,7 @@ complete_exit (struct proc *p) remove_proc_from_hash (p); if (p->p_task != MACH_PORT_NULL) - mach_port_deallocate (mach_task_self (), p->p_task); + mach_port_destroy (mach_task_self (), p->p_task); /* Remove us from our parent's list of children. */ if (p->p_sib) -- cgit v1.2.3