[Dovecot] IMAP crashes with signal 10 (SIGBUS)

Timo Sirainen tss at iki.fi
Sat Jan 8 02:23:43 EET 2005

On 8.1.2005, at 01:59, Joseph Tam wrote:

> Subsequent versions still crashed and I looked into the problem 
> further.  Specifically it
> crashes at this line
>  	offset = *((const uint64_t *)data);
> when "data" assumes a non-64 bit aligned value.  At first I thought 
> that 64-bit
> ints should always be aligned on 64-bit boundaries, but when I 
> isolated this code
> into a standalone executable to demonstrate it (no arguments to cause 
> a crash, one
> argument is OK):

The bug is that the data pointer in there should always be 64bit 
aligned. There exists code which tries to keep it 64bit aligned, but 
apparently there's a bug somewhere. I haven't yet tried to find it. So 
many other things to do..

> They claim that this casting violates ISO aliasing rules and the 
> results like
> crashing are to be expected.  Maybe this statement ought to be 
> rewritten
>  	memcpy(&offset,data,sizeof(uint64_t));

That's a good workaround until it's really fixed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://dovecot.org/pipermail/dovecot/attachments/20050108/7108a8a6/attachment-0001.bin>

More information about the dovecot mailing list