STREAMS/UX for the HP 9000 Reference Manual
201
Debugging STREAMS/UX Modules and Drivers
Debugging Examples
timeout(sp_timeout,lp,1);
break;
default:
printf(“Routine spput: Should not be here\n”);
break;
}
}
Note that spput() never updates lp->mp. It just adds the new message to the
tail of the list using lp->last_mp. But once sp_timeout() has processed the
last message on the list and set lp->mp to NULL, spput() will never update
lp->mp to point at the next message it receives. This causes sp_timeout() to
be called with lp->mp == NULL. If we change spput() if statement to
properly update lp->mp as shown below, this panic will be fixed.
if (!lp->mp)
/*
* head of list is NULL so list is empty -- put new message
* at head of list
*/
lp->mp = mp;
else
/*
* list is not empty -- put new message at tail of list
*/
lp->last_mp->b_next = mp;
/*
* update list tail pointer to point to new message
*/
lp->last_mp = mp;
Example 2
The following core dump was obtained while using a modified version of the
sp driver, which is described in example #2 in the strdb section of this
chapter.
On entry to adb, we first look at the msgbuf to look for the panic message
and hex stack trace. The interesting portion of msgbuf for this dump is:
msgbuf+0xc/s
.
.
.
trap type 15, pcsq.pcoq = 0.3b584, isr.ior = 0.0
B2352A HP-UX () #1: Fri Aug 14 00:49:59 PDT 1992
panic: (display==0xbf00, flags==0x0) Data segmentation fault
PC-Offset Stack Trace (read across, most recent is 1st):
0x0013e81c 0x000cc108 0x000bd3f4 0x0003b584 0x00049a48 0x0004bd0c
0x0002f7d4 0x00046178 0x00049a48 0x000460d0 0x00046594 0x0012cc10
0x000bedd0 0x00024cf0
End Of Stack