STREAMS/UX for the HP 9000 Reference Manual

213
Debugging STREAMS/UX Modules and Drivers
Debugging Examples
:x msgb 0x5d8c00
struct msgb 0x5d8c00 S:1
b_next = 0x646480
b_prev = 0x0
b_cont = 0x646400
b_rptr = 0x644000
b_wptr = 0x6440d1
b_datap = 0x0
b_band = 0
b_pad1 = 00
b_flag = 0x0
b_pad2 = 0
b_datap could be NULL because its resources have been freed, or it could
be NULL because the data structure was corrupted in some way. To try to
narrow this down, we want to look at the message buffer b_cont. If its
b_datap is also NULL, the possibility of corruption becomes less likely. We
can use :x msgb 0x646400 to format the b_cont field of q->q_first. It is
easier, however, to see if there is a navigation key available for the b_cont
field. “?” lists the available navigation keys:
navigation for structure msgb
'n' = b_next (msgb)
'p' = b_prev (msgb)
'm' = b_rptr (b_rptr)
'c' = b_cont (msgb)
'd' = b_datap (datab)
Using the c navigation key, we see that b_datap for b_cont is also NULL.
This makes it very likely that this message has already been freed.
struct msgb 0x646400 S:2
b_next = 0x5d8c00
b_prev = 0x0
b_cont = 0x0
b_rptr = 0x651400
b_wptr = 0x6517e1
b_datap = 0x0
b_band = 0
b_pad1 = 00
b_flag = 0x0
b_pad2 = 0
Now we try to get information about the queue which was pointing to this
message at the time of the panic. We use :x to format 0x5e9c00 as a queue
structure to see what information it may still contain.
:x queue 0x5e9c00