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

 
 

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

patch #6830: rpctrace traces all tasks and threads

Submitted by:  Zheng Da <zhengda>
Submitted on:  Sat 16 May 2009 05:24:05 PM UTC  
 
Category: other HurdPriority: 5 - Normal
Status: Works For MePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Planned Release: None
Wiki-like text discussion box: 

(Jump to the original submission 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
about.

Samuel Thibault <sthibaul>
Project Member
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
patch.

Samuel Thibault <sthibaul>
Project Member
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 Member
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],
+ MACH_MSG_TYPE_MAKE_SEND);
+ 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

Samuel Thibault <sthibaul>
Project Member
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 http://savannah.gnu.org/patch/?1633
[1] http://savannah.gnu.org/bugs/?3939

Zheng Da <zhengda>
Project Member

 

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 17 May 2009 08:01:15 PM UTCsthibaulAttached File#18151=>Removed
    Sun 17 May 2009 08:00:35 PM UTCsthibaulAttached File-=>Added rpctrace.diff, #18156
    Sun 17 May 2009 01:19:52 AM UTCzhengdaAttached File-=>Added rpctrace.diff, #18151
    Sun 17 May 2009 01:19:11 AM UTCzhengdaAttached File#18148=>Removed
    Sat 16 May 2009 05:24:49 PM UTCzhengdaSummaryTrace all tasks and threads=>rpctrace traces all tasks and threads
    Sat 16 May 2009 05:24:05 PM UTCzhengdaAttached File-=>Added rpctrace.diff, #18148

    Back to the top


    Powered by Savane 3.1-cleanup