STREAMS/UX for the HP 9000 Reference Manual

212
Debugging STREAMS/UX Modules and Drivers
Debugging Examples
Now that we have the values of sp for flushq, we know the q address we are
interested in is at 0x7ffe7420 - 0x64:
0x7ffe7420-0x64/X
7FFE73BC: 5E9C00
Looking at the first few words of the q structure, we can determine the value
of q_first, which is the second word:
5E9C00/4X
5E9C00: 294160 5D8C00 6C1880 0
Looking at q_first, we can see that the sixth word, b_datap, is NULL:
5D8C00/8X
5D8C00: 646480 0 646400 644000
6440D1 0 0 0
We can also use strdb to look at q and q_first. See the strdb section of this
chapter for more information. Because there may be several instances of the
sp driver, each with a different minor number, we must look at each one until
we find the stream which contains a queue whose address is the same as the
address we have for q. The strdb STREAMS/UX subsystem la command
will tell us what minor numbers are in use for the sp driver:
:la sp
sp MAJOR = 115
ACTIVE Minor 0x000013 Stream head RQ = 0x00607b00
ACTIVE Minor 0x000012 Stream head RQ = 0x00605c00
These instances of sp are far fewer than we had expected. lm on minor
number 0x12 shows that lmodc has already been popped off the stream:
:lm sp 0x12
STREAM Head
Driver sp
and using :qh sp 0x12, and o and n as needed to traverse all the queues in
this stream shows that none of these queues have address 0x5e9c00. lm on
sp 0x13 shows that lmodc is still pushed above sp on this stream, but
traversing all the queues in this stream shows that none of them are the
queue we are looking for. We can use the strdb primary mode :x command
to format q_first as a struct msgb to confirm our finding from adb that
q->q_first->b_datap is NULL. (We find the structure type for q_first from
/usr/include/sys/stream.h).