For some time, we see various unaligned exceptions running apt-get on hppa:
http(13559): unaligned access to 0x00000000fa703d49 at ip=0x00000000f9f0a9bb
handle_unaligned: 37 callbacks suppressed
http(13810): unaligned access to 0x00000000fa703d49 at ip=0x00000000f9f0a9bb
http(13810): unaligned access to 0x00000000fa703d49 at ip=0x00000000f9f0a9c3
http(13810): unaligned access to 0x00000000fa703d49 at ip=0x00000000f9f0cdf3
http(13810): unaligned access to 0x00000000fa703d49 at ip=0x00000000f9f0cecf
http(13810): unaligned access to 0x00000000fa703d4d at ip=0x00000000f9f0c69b
Helge and myself tracked the first of these exceptions to the following line
hp->rcode = NOERROR; /* default */
The argument answer has the type u_char *. Thus, the function __libc_res_nquery
should nominally be prepared to access the HEADER struct on a byte boundary.
However, the struct HEADER is not defined with the packed attribute, so accesses
to the bit fields in the struct are done with word rather than byte accesses.
This causes the above faults.
This is very inefficient on strict alignment targets such as hppa and ia64, and
slow on x86, etc.
Adding "__attribute__((packed))" to the HEADER typedef appears to eliminate
the unaligned accesses from http.
New patch here:
New patch is here: