patchThe GNU Hurd - Patches: patch #6830, rpctrace traces all tasks and...


You are not allowed to post comments on this tracker with your current authentication level.

patch #6830: rpctrace traces all tasks and threads

Submitter:  Zheng Da <zhengda>
Submitted:  Sat 16 May 2009 05:24:05 PM UTC
Category:  other Hurd Priority:  5 - Normal
Status:  Works For Me Privacy:  Public
Assigned to:  None Open/Closed:  Open
Planned Release:  None
Wiki-like text discussion box: 

( Jump to the original submission )

Tue 01 Sep 2009 01:47:27 PM UTC, comment #7: 

Yes, I sent the patch implementing the more complex solution. I sent it to the mailing list for review, but haven't get many feedbacks except the ones from antrik.
I wanted more feedbacks before posting it here.
I did very fundamental change in rpctrace and the patch is very large. I think it's much easier to give feedbacks in the mailing list.

Zheng Da <zhengda>
Project Member
Tue 01 Sep 2009 01:35:35 PM UTC, comment #6: 

You mean you have sent the patch earlier?  You should probably post it
here too for the record, as patches on lists tend to get forgotten

Samuel Thibault <sthibaul>
Project Administrator
Tue 01 Sep 2009 01:28:46 PM UTC, comment #5: 

This patch can make rpctrace to trace all threads but cannot really enable rpctrace to work with multitask programs properly. That's why I send a more complex solution to the mailing list.
Do you think I should commit the patch?

Zheng Da <zhengda>
Project Member
Mon 31 Aug 2009 10:02:37 PM UTC, comment #4: 

The git transition is done, please commit my fixed version of the

Samuel Thibault <sthibaul>
Project Administrator
Sun 17 May 2009 08:00:35 PM UTC, comment #3: 

Just spelling & cosmetic changes.  I believe it can be commited (but
only after Thomas finishes the migration to git of course).

(file #18156)

Samuel Thibault <sthibaul>
Project Administrator
Sun 17 May 2009 01:23:41 AM UTC, comment #2: 

The name is assigned to the new created task or thread port, so usually there shouldn't be any names, but I update the patch to check it.

Zheng Da <zhengda>
Project Member
Sat 16 May 2009 07:27:33 PM UTC, comment #1: 

@@ -563,6 +566,37 @@ print_contents (mach_msg_header_t *inp,

        ti = rewrite_right (&portnames[i], &newtypes[i]);

+       /* the reply message for thread_create or task_create */
+       if (inp->msgh_id == 2161 || inp->msgh_id == 2107)
+ {
+   err = mach_port_insert_right (mach_task_self (),
+ portnames[i], portnames[i],
+   if (err)
+     error (0, err, "mach_port_insert_right");
+   if (inp->msgh_id == 2161)
+     {

Please put a comment just to make clear that this is the thread_create case.

+       err = thread_set_kernel_port (orig_port, portnames[i]);
+       if (err)
+ error (0, err, "thread_set_kernel_port");
+       asprintf (&ti->name, "thread(port %d)", (int) orig_port);

Aren't you leaking the previous ti->name's memory here?


Samuel Thibault <sthibaul>
Project Administrator
Sat 16 May 2009 05:24:05 PM UTC, original submission:  

rpctrace wraps all task and thread control ports by calling task_set_kernel_port() and thread_set_kernel_port().
In order to trace the first thread of the first task, rpctrace keeps checking exec_startup_get_info() (I assume exec_startup_get_info is always called when the traced program starts.)
This patch solves bug #3939[1] with the solution discussed in

Zheng Da <zhengda>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #18156:  rpctrace.diff added by sthibaul (4KiB - text/x-diff)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by sthibaul (Posted a comment)
  • -email is unavailable- added by zhengda (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.




    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-05-17 sthibaul Attached File#18151 Removed
    2009-05-17 sthibaul Attached File- Added rpctrace.diff, #18156
    2009-05-17 zhengda Attached File- Added rpctrace.diff, #18151
    2009-05-17 zhengda Attached File#18148 Removed
    2009-05-16 zhengda SummaryTrace all tasks and threads rpctrace traces all tasks and threads
    2009-05-16 zhengda Attached File- Added rpctrace.diff, #18148

    Back to the top

    Powered by Savane 3.9