[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Zmailer 2.2e10 lib/allocate.c can fail to align enough
My router was dumping wierd cores under Irix 6.2 when compiled with
one of their new 64-bit-ish compilation models (-n32, for the curious).
It turns out that this is because under this model, off_t's in struct
stat structures are 64 bits and must be aligned on 8 byte boundaries.
lib/allocate.c assumed that things only had to be aligned on 4 byte
This was a pernicious bug to track down because it was so mysterious.
The router fell over with SIGBUS in an innocuous spot; neither dbx
nor the kernel complained of alignment problems (presumably neither
tried to copy the off_t as a single unit, thus not using an opcode
with alignment restrictions).
People working on 64-bit or neo-64-bit systems may want to take
note. On similar neo-64-bit systems, people may want to look into
uses of longs that should perhaps be off_t's (cf struct envelope
from include/mailer.h, for example).