bug-hurd
[Top][All Lists]
Advanced

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

Re: problems with rpctrace


From: nickb
Subject: Re: problems with rpctrace
Date: Sun, 14 Oct 2001 20:12:06 -0500 (CDT)

On Sat, 13 Oct 2001, Roland McGrath wrote:

> It's not totally clear to me what all your debug printfs mean.  When using
> a modified version of the program, please include your changes so we can
> see exactly what your program was printing.  I can't tell whether your
> output includes all the essential information from the mach_msg_header_t
> details of the incoming message.
> 
> It's most useful to use hex for printing port names (mach_port_t).  The
> kernel tends to assign names that have more zeros when printed in hex than
> in decimal.  And it also makes it more obvious when there is a really
> suspicious value like all the `sent_to' values in your output, which look
> like pointers rather than likely port names.
> 

Are there any other values in Mach that one should always print in hex?



--- rpctrace.c  Sun Oct 14 13:13:36 2001
+++ rpctrace.c.debug    Sun Oct 14 13:08:12 2001
@@ -519,6 +519,41 @@
      ports (traced_class).  */
   info = ports_lookup_port (traced_bucket, inp->msgh_local_port, 0);

+  printf("DEBUG: struct mach_msg_header_t *inp -------------->\n");
+  printf("DEBUG: mach_msg_bits_t msgh_bits: %x\n", inp->msgh_bits);
+  printf("DEBUG: mach_msg_size_t msgh_size: %d\n", inp->msgh_size);
+  printf("DEBUG: mach_port_t msgh_remote_port: %x\n",
inp->msgh_remote_port);
+  printf("DEBUG: mach_port_t msgh_local_port: %x\n",
inp->msgh_local_port);
+  printf("DEBUG: mach_port_seqno_t msgh_seqno: %d\n", inp->msgh_seqno);
+  printf("DEBUG: mach_msg_id_t msgh_msg_id: %d\n", inp->msgh_id);
+
+  printf("DEBUG: struct mach_msg_header_t *outp -------------->\n");
+  printf("DEBUG: mach_msg_bits_t msgh_bits: %x\n", outp->msgh_bits);
+  printf("DEBUG: mach_msg_size_t msgh_size: %d\n", outp->msgh_size);
+  printf("DEBUG: mach_port_t msgh_remote_port: %x\n",
outp->msgh_remote_port);
+  printf("DEBUG: mach_port_t msgh_local_port: %x\n",
outp->msgh_local_port);
+  printf("DEBUG: mach_port_seqno_t msgh_seqno: %d\n", outp->msgh_seqno);
+  printf("DEBUG: mach_msg_id_t msgh_msg_id: %d\n", outp->msgh_id);
+
+  printf("DEBUG: struct traced_info info -------------->\n");
+  printf("DEBUG: int refcnt: %d\n", info->pi.refcnt);
+  printf("DEBUG: int weakrefcnt: %d\n", info->pi.weakrefcnt);
+  printf("DEBUG: struct port_info mach_port_mscount_t mscount: %d\n",
+          info->pi.mscount);
+  printf("DEBUG: struct port_info mach_msg_seqno_t
cancel_threshold: %d\n",
+          info->pi.cancel_threshold);
+  printf("DEBUG: struct port_info int flags: %d\n", info->pi.flags);
+  printf("DEBUG: struct port_info mach_port_t port_right: %x\n",
+          info->pi.port_right);
+  printf("DEBUG: mach_port_t forward: %x\n", info->forward);
+  printf("DEBUG: mach_msg_type_name_t type: %d\n", info->type);
+  printf("DEBUG: char *name: %s\n", info->name);
+  printf("DEBUG: u struct send **locp: %p\n", info->u.send.locp);
+  printf("DEBUG: u struct send_once mach_port_t sent_to: %x\n",
+          info->u.send_once.sent_to);
+  printf("DEBUG: u struct send_once mach_msg_id_t sent_msgid: %d\n",
+          info->u.send_once.sent_msgid);
+
   assert (info);
   assert (MACH_MSGH_BITS_LOCAL (inp->msgh_bits) == info->type);



root@hurd:~/hurd.stuff/gnu-hurd/hurd/src/build/utils# ./rpctrace
/hurd/storeio
DEBUG: struct mach_msg_header_t *inp -------------->
DEBUG: mach_msg_bits_t msgh_bits: 1112
DEBUG: mach_msg_size_t msgh_size: 24
DEBUG: mach_port_t msgh_remote_port: 43
DEBUG: mach_port_t msgh_local_port: 41
DEBUG: mach_port_seqno_t msgh_seqno: 0
DEBUG: mach_msg_id_t msgh_msg_id: 2030
DEBUG: struct mach_msg_header_t *outp -------------->
DEBUG: mach_msg_bits_t msgh_bits: 12
DEBUG: mach_msg_size_t msgh_size: 32
DEBUG: mach_port_t msgh_remote_port: 43
DEBUG: mach_port_t msgh_local_port: 0
DEBUG: mach_port_seqno_t msgh_seqno: 0
DEBUG: mach_msg_id_t msgh_msg_id: 2130
DEBUG: struct traced_info info -------------->
DEBUG: int refcnt: 3
DEBUG: int weakrefcnt: 1
DEBUG: struct port_info mach_port_mscount_t mscount: 1
DEBUG: struct port_info mach_msg_seqno_t cancel_threshold: 0
DEBUG: struct port_info int flags: 1
DEBUG: struct port_info mach_port_t port_right: 41
DEBUG: mach_port_t forward: 40
DEBUG: mach_msg_type_name_t type: 17
DEBUG: char *name: task2551
DEBUG: u struct send **locp: 0x804cc48
DEBUG: u struct send_once mach_port_t sent_to: 804cc48
DEBUG: u struct send_once mach_msg_id_t sent_msgid: 0
task2551-> 2030 ()DEBUG: struct mach_msg_header_t *inp -------------->
DEBUG: mach_msg_bits_t msgh_bits: 1200
DEBUG: mach_msg_size_t msgh_size: 88
DEBUG: mach_port_t msgh_remote_port: 0
DEBUG: mach_port_t msgh_local_port: 42
DEBUG: mach_port_seqno_t msgh_seqno: 0
DEBUG: mach_msg_id_t msgh_msg_id: 2130
DEBUG: struct mach_msg_header_t *outp -------------->
DEBUG: mach_msg_bits_t msgh_bits: 0
DEBUG: mach_msg_size_t msgh_size: 32
DEBUG: mach_port_t msgh_remote_port: 0
DEBUG: mach_port_t msgh_local_port: 0
DEBUG: mach_port_seqno_t msgh_seqno: 0
DEBUG: mach_msg_id_t msgh_msg_id: 2230
DEBUG: struct traced_info info -------------->
DEBUG: int refcnt: 3
DEBUG: int weakrefcnt: 0
DEBUG: struct port_info mach_port_mscount_t mscount: 0
DEBUG: struct port_info mach_msg_seqno_t cancel_threshold: 0
DEBUG: struct port_info int flags: 0
DEBUG: struct port_info mach_port_t port_right: 42
DEBUG: mach_port_t forward: 43
DEBUG: mach_msg_type_name_t type: 18
DEBUG: char *name: reply(66:2030)
DEBUG: u struct send **locp: 0x42
DEBUG: u struct send_once mach_port_t sent_to: 42
DEBUG: u struct send_once mach_msg_id_t sent_msgid: 2030
 = 0 {4096 15986 4733 7028 3847 314096 0 55697 121200 1922090 179525
209989 195113}
DEBUG: struct mach_msg_header_t *inp -------------->
DEBUG: mach_msg_bits_t msgh_bits: 1112
DEBUG: mach_msg_size_t msgh_size: 32
DEBUG: mach_port_t msgh_remote_port: 43
DEBUG: mach_port_t msgh_local_port: 41
DEBUG: mach_port_seqno_t msgh_seqno: 1
DEBUG: mach_msg_id_t msgh_msg_id: 2029
DEBUG: struct mach_msg_header_t *outp -------------->
DEBUG: mach_msg_bits_t msgh_bits: 12
DEBUG: mach_msg_size_t msgh_size: 32
DEBUG: mach_port_t msgh_remote_port: 43
DEBUG: mach_port_t msgh_local_port: 0
DEBUG: mach_port_seqno_t msgh_seqno: 0
DEBUG: mach_msg_id_t msgh_msg_id: 2129
DEBUG: struct traced_info info -------------->
DEBUG: int refcnt: 3
DEBUG: int weakrefcnt: 1
DEBUG: struct port_info mach_port_mscount_t mscount: 1
DEBUG: struct port_info mach_msg_seqno_t cancel_threshold: 0
DEBUG: struct port_info int flags: 1
DEBUG: struct port_info mach_port_t port_right: 41
DEBUG: mach_port_t forward: 40
DEBUG: mach_msg_type_name_t type: 17
DEBUG: char *name: task2551
DEBUG: u struct send **locp: 0x804cc48
DEBUG: u struct send_once mach_port_t sent_to: 804cc48
DEBUG: u struct send_once mach_msg_id_t sent_msgid: 0
task2551-> 2029 (134217728)DEBUG: struct mach_msg_header_t *inp
-------------->
DEBUG: mach_msg_bits_t msgh_bits: 80001200
DEBUG: mach_msg_size_t msgh_size: 96
DEBUG: mach_port_t msgh_remote_port: 0
DEBUG: mach_port_t msgh_local_port: 42
DEBUG: mach_port_seqno_t msgh_seqno: 1
DEBUG: mach_msg_id_t msgh_msg_id: 2129
DEBUG: struct mach_msg_header_t *outp -------------->
DEBUG: mach_msg_bits_t msgh_bits: 0
DEBUG: mach_msg_size_t msgh_size: 32
DEBUG: mach_port_t msgh_remote_port: 0
DEBUG: mach_port_t msgh_local_port: 0
DEBUG: mach_port_seqno_t msgh_seqno: 0
DEBUG: mach_msg_id_t msgh_msg_id: 2229
DEBUG: struct traced_info info -------------->
DEBUG: int refcnt: 3
DEBUG: int weakrefcnt: 0
DEBUG: struct port_info mach_port_mscount_t mscount: 0
DEBUG: struct port_info mach_msg_seqno_t cancel_threshold: 0
DEBUG: struct port_info int flags: 0
DEBUG: struct port_info mach_port_t port_right: 42
DEBUG: mach_port_t forward: 43
DEBUG: mach_msg_type_name_t type: 18
DEBUG: char *name: reply(66:2029)
DEBUG: u struct send **locp: 0x42
DEBUG: u struct send_once mach_port_t sent_to: 42
DEBUG: u struct send_once mach_msg_id_t sent_msgid: 2029
 = 0 134512640 20480 5 7 1 0   66 0
DEBUG: struct mach_msg_header_t *inp -------------->
DEBUG: mach_msg_bits_t msgh_bits: 1112
DEBUG: mach_msg_size_t msgh_size: 32
DEBUG: mach_port_t msgh_remote_port: 43
DEBUG: mach_port_t msgh_local_port: 41
DEBUG: mach_port_seqno_t msgh_seqno: 2
DEBUG: mach_msg_id_t msgh_msg_id: 3206
DEBUG: struct mach_msg_header_t *outp -------------->
DEBUG: mach_msg_bits_t msgh_bits: 12
DEBUG: mach_msg_size_t msgh_size: 32
DEBUG: mach_port_t msgh_remote_port: 43
DEBUG: mach_port_t msgh_local_port: 0
DEBUG: mach_port_seqno_t msgh_seqno: 0
DEBUG: mach_msg_id_t msgh_msg_id: 3306
DEBUG: struct traced_info info -------------->
DEBUG: int refcnt: 3
DEBUG: int weakrefcnt: 1
DEBUG: struct port_info mach_port_mscount_t mscount: 1
DEBUG: struct port_info mach_msg_seqno_t cancel_threshold: 0
DEBUG: struct port_info int flags: 1
DEBUG: struct port_info mach_port_t port_right: 41
DEBUG: mach_port_t forward: 40
DEBUG: mach_msg_type_name_t type: 17
DEBUG: char *name: task2551
DEBUG: u struct send **locp: 0x804cc48
DEBUG: u struct send_once mach_port_t sent_to: 804cc48
DEBUG: u struct send_once mach_msg_id_t sent_msgid: 0
task2551-> 3206 (pn{  5})DEBUG: struct mach_msg_header_t *inp
-------------->
DEBUG: mach_msg_bits_t msgh_bits: 1200
DEBUG: mach_msg_size_t msgh_size: 32
DEBUG: mach_port_t msgh_remote_port: 0
DEBUG: mach_port_t msgh_local_port: 42
DEBUG: mach_port_seqno_t msgh_seqno: 2
DEBUG: mach_msg_id_t msgh_msg_id: 70
DEBUG: struct mach_msg_header_t *outp -------------->
DEBUG: mach_msg_bits_t msgh_bits: 0
DEBUG: mach_msg_size_t msgh_size: 32
DEBUG: mach_port_t msgh_remote_port: 0
DEBUG: mach_port_t msgh_local_port: 0
DEBUG: mach_port_seqno_t msgh_seqno: 0
DEBUG: mach_msg_id_t msgh_msg_id: 170
DEBUG: struct traced_info info -------------->
DEBUG: int refcnt: 3
DEBUG: int weakrefcnt: 1
DEBUG: struct port_info mach_port_mscount_t mscount: 1
DEBUG: struct port_info mach_msg_seqno_t cancel_threshold: 0
DEBUG: struct port_info int flags: 1
DEBUG: struct port_info mach_port_t port_right: 42
DEBUG: mach_port_t forward: 45
DEBUG: mach_msg_type_name_t type: 17
DEBUG: char *name: (null)
DEBUG: u struct send **locp: 0x804cc4c
DEBUG: u struct send_once mach_port_t sent_to: 804cc4c
DEBUG: u struct send_once mach_msg_id_t sent_msgid: 2029
rpctrace: ../../../utils/rpctrace.c:558: trace_and_forward: Assertion
`(((inp->msgh_bits) & 0x0000ff00) >> 8) == info->type' failed.
Aborted





reply via email to

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