Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/mach Fix an unitialized variable bug that caused ...



details:   https://anonhg.NetBSD.org/src/rev/844b5c221d68
branches:  trunk
changeset: 555203:844b5c221d68
user:      manu <manu%NetBSD.org@localhost>
date:      Tue Nov 11 15:00:09 2003 +0000

description:
Fix an unitialized variable bug that caused a crash in mach_task_suspend().
While we are there, resolved another mystery: the unallocated port described
in the comment removed by this commit was in fact allocated by mach_task_pid().

diffstat:

 sys/compat/mach/mach_task.c |  16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diffs (52 lines):

diff -r 75f970953e7c -r 844b5c221d68 sys/compat/mach/mach_task.c
--- a/sys/compat/mach/mach_task.c       Tue Nov 11 13:48:50 2003 +0000
+++ b/sys/compat/mach/mach_task.c       Tue Nov 11 15:00:09 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_task.c,v 1.28 2003/11/09 11:10:11 manu Exp $ */
+/*     $NetBSD: mach_task.c,v 1.29 2003/11/11 15:00:09 manu Exp $ */
 
 /*-
  * Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include "opt_compat_darwin.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_task.c,v 1.28 2003/11/09 11:10:11 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_task.c,v 1.29 2003/11/11 15:00:09 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -493,21 +493,13 @@
        mach_task_suspend_request_t *req = args->smsg;
        mach_task_suspend_reply_t *rep = args->rmsg;
        size_t *msglen = args->rsize;
+       struct lwp *l = args->l;
        mach_port_t mn;
        struct mach_right *mr;
-       struct lwp *l;
        struct proc *p;
        struct mach_emuldata *med;
        int s;
 
-       /*
-        * XXX Two bugs when gdb calls this function:
-        * - gdb uses a port it never allocated (apparently)
-        * - this makes mach_right_check panic because of the lock operation
-        *   on a draining lock.
-        */
-       return mach_msg_error(args, 0);
-
        /* XXX more permission checks nescessary here? */
        mn = req->req_msgh.msgh_remote_port;
        if ((mr = mach_right_check(mn, l, MACH_PORT_TYPE_ALL_RIGHTS)) == 0)
@@ -555,9 +547,9 @@
        mach_task_resume_request_t *req = args->smsg;
        mach_task_resume_reply_t *rep = args->rmsg;
        size_t *msglen = args->rsize;
+       struct lwp *l = args->l;
        mach_port_t mn;
        struct mach_right *mr;
-       struct lwp *l = args->l;
        struct proc *p;
        struct mach_emuldata *med;
        int s;



Home | Main Index | Thread Index | Old Index