[Top][All Lists]

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

PATCH: proc_do_stop and rpctrace

From: Marcus Brinkmann
Subject: PATCH: proc_do_stop and rpctrace
Date: Thu, 31 Jul 2003 23:29:09 +0200
User-agent: Mutt/1.5.4i


the below patch by ogi fixes a problem with rpctrace and CTRL-C.
I want to apply the patch, please let me know if you have objections.

When the traced task calls proc_do_stop with the contthread port, then
rpctrace creates an intermediate port and substitutes the contthread send

Because of this, proc fails in comparing (numerically) the contthread with
the send rights Mach supplies to proc when listing all threads in the task.
The port by Mach is not the one rpctrace gives to proc.  Thus, all threads
in the task are suspended.

The patch fixes this by suspending all tasks and then resuming contthread.
This works because then contthread is suspended once directly by proc, and
then resumed indirectly by rpctrace.


2003-06-16  Ognyan Kulev  <address@hidden>

        * mgt.c (S_proc_dostop): Instead of suspending all threads except
        CONTTHREAD, first suspend all threads, and then resume CONTTHREAD.

--- /home/ogi/cvs/hurd/proc/mgt.c       2002-05-08 12:24:52.000000000 +0300
+++ hurd/proc/mgt.c     2003-06-16 18:40:34.000000000 +0300
@@ -1,5 +1,5 @@
 /* Process management
-   Copyright (C) 1992,93,94,95,96,99,2000,01,02 Free Software Foundation, Inc.
+   Copyright (C) 1992,93,94,95,96,99,2000,01,02,03 Free Software Foundation, 
 This file is part of the GNU Hurd.
@@ -350,12 +350,12 @@ S_proc_dostop (struct proc *p,
   for (i = 0; i < nthreads; i++)
-      if (threads[i] != contthread)
-       thread_suspend (threads[i]);
+      thread_suspend (threads[i]);
       mach_port_deallocate (mach_task_self (), threads[i]);
   if (threads != threadbuf)
     munmap (threads, nthreads * sizeof (thread_t));
+  thread_resume (contthread);
   err = task_resume (p->p_task);
   if (err)
     return err;

`Rhubarb is no Egyptian god.' GNU    address@hidden
Marcus Brinkmann              The Hurd

reply via email to

[Prev in Thread] Current Thread [Next in Thread]