[parisc-linux] ldcw in __pthread_acquire
John Marvin
jsm@udlkern.fc.hp.com
Fri, 15 Dec 2000 03:12:09 -0700 (MST)
I just ran into an unaligned data reference in user land. The problem is
that the routine __pthread_acquire (in libpthread) does a ldcw, but it is
not ensuring that the address it is operating on is 16 byte aligned (it is
operating on the address that was passed in as the first argument). Some
processors don't require the 16 byte alignment, but many do.
I haven't looked at the source (I just found the location by disassembly),
so I don't know what the root cause is. The actual ldcw is probably from
an inlined function or macro, e.g. spin_lock(). My first guess would be
that it is using the machine dependent spin_lock macro, but the procedure
which called __pthread_acquire is passing in a structure whose lock field
does not have the aligned(16) attribute.
I don't have time to look at this right now. Any volunteers?
John Marvin
jsm@fc.hp.com