bug-hurd
[Top][All Lists]
Advanced

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

[PATCH] Fix segfault in ps after integration of TASK_EVENTS_INFO


From: David Höppner
Subject: [PATCH] Fix segfault in ps after integration of TASK_EVENTS_INFO
Date: Sat, 5 Jan 2013 14:22:56 +0100

Hi,

this fixes a segfault of ps (ps a -o msgin) after TASK_EVENTS_INFO
will be integrated in gnumach.

thanks,
David

Subject: [PATCH] Fix segfault in ps after integration of TASK_EVENTS_INFO

* libps/procstat.c (merge_procinfo): Also copy taskevents.
* libps/procstat.c (set_procinfo_flags): Set pointer to task_events_info.
* tasks: Remove TASK_EVENTS_INFO item.
---
 libps/procstat.c |    6 ++++++
 tasks            |    2 --
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/libps/procstat.c b/libps/procstat.c
index ba92378..da03f7e 100644
--- a/libps/procstat.c
+++ b/libps/procstat.c
@@ -226,6 +226,10 @@ merge_procinfo (struct proc_stat *ps, ps_flags_t
need, ps_flags_t have)
     /* Task info.  */
     bcopy (&old_pi_hdr.taskinfo, &new_pi->taskinfo,
           sizeof (struct task_basic_info));
+   if (have & PSTAT_TASK_EVENTS)
+    /* Event info. */
+    bcopy (&old_pi_hdr.taskevents, &new_pi->taskevents,
+          sizeof (struct task_events_info));
   /* That's it for now.  */

   if (new_pi != ps->proc_info)
@@ -637,6 +641,8 @@ set_procinfo_flags (struct proc_stat *ps,
ps_flags_t need, ps_flags_t have)
         gotten them, as the information will be newer.  */
       if (have & PSTAT_TASK_BASIC)
        ps->task_basic_info = &pi->taskinfo;
+      if (have & PSTAT_TASK_EVENTS)
+       ps->task_events_info = &pi->taskevents;
       if (have & PSTAT_NUM_THREADS)
        ps->num_threads = count_threads (pi, have);
       if (had & PSTAT_THREAD_BASIC)
diff --git a/tasks b/tasks
index 871bde1..933a63a 100644
--- a/tasks
+++ b/tasks
@@ -101,8 +101,6 @@ Please discuss proposed microkernel work with
thomas@gnu.org.
     have said their could could be released to the public (but it has not
     appeared).

-  * Implement TASK_EVENTS_INFO.
-
   * Add an anonymous swap allocation statistic to the task info structure.

 
-- 
1.7.10.4

Attachment: 003-ps-segfault-taskevents.patch
Description: Binary data


reply via email to

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