Operating System - HP-UX
1833196 Members
3090 Online
110051 Solutions
New Discussion

Question on initlock/lock_write() in HP-UX 11.00

 
Darren Reed
Occasional Contributor

Question on initlock/lock_write() in HP-UX 11.00

My system is panic'ing the first time I call lock_write() on a 'struct rw_lock' object after calling initlock() on it.

After calling initlock(), printf's show fields to be:
interlock b6a00000000000 delay 0 r_c 0 w_w 26 w_u 110 w -120 n_w 0

just prior to calling lock_write():
i/l b6a00000000000 w_w 26 w_u 110 w -120

so we can assume the data structure isn't changed. But the panic is:
Trap Type 15 (Data page fault):
Instruction Address (pcsq.pcoq) = 0x0.0x123af4
Instruction (iir) = 0x0f4015c1 (load/store)
Target Address (isr.ior) = 0x0.0x00b6a00000000000
Base Register (gr26) = 0x00b6a00000000000
Savestate Ptr (ssp) = 0x7bba800.0x400003ffffff25d0
Savestate Return Pointer (ss_rp) = 0x9019c4

the address passed into lock_write is 0x906008

The instruction it falls over at is lock_write+0x2c. I make this out to be:
LDCWS,CO 0(r26)r1

where do I go next to track this problem down?

The lock is initialised like this:

#pragma align 16
struct rw_lock mylock;
...
initlock(&mylock, 0, 0, "mylock");
...
lock_write(&mylock)

I just can't make heads or tails of why it's doing this.

Does anyone out there have any clues?
Or tips on what to look for with q4?