Cyrus IMAPd 2.3.7 Released

Дейтер Александр Валери Дейтер Александр Валери
Wed Jul 12 12:32:19 EDT 2006


Gabor Gombas wrote:

>> Program terminated with signal 10, Bus error.
>> #0  0x0000000100011e04 in mailbox_write_index_header
>> (mailbox=0xffffffff7fff3f70) at mailbox.c:1319
>> 1319        *((bit64 *)(buf+OFFSET_HIGHESTMODSEQ_64)) =
>> htonll(mailbox->highestmodseq);
> 
> Could you do a "p &buf" here? My guess would be that it is not 8-byte
> aligned (because nobody told the compiler that it should be), and
> therefore the code above generates an unaligned access, which explains
> the bus error perfectly.

Program terminated with signal 10, Bus error.
#0  0x0000000100011e04 in mailbox_write_index_header
(mailbox=0xffffffff7fff3f70)
    at mailbox.c:1319
1319        *((bit64 *)(buf+OFFSET_HIGHESTMODSEQ_64)) =
htonll(mailbox->highestmodseq);
(gdb) p &buf
$1 = (char (*)[96]) 0xffffffff7fff3da0

> You can also try to replace
> 
> 	char buf[INDEX_HEADER_SIZE];
> 
> with
> 
> 	union {
> 		char buf[INDEX_HEADER_SIZE];
> 	#ifdef HAVE_LONG_LONG_INT
> 		long long int dummy;
> 	#endif
> 	} u;
> 
> to force the required alignment, and also replace every reference to
> "buf" with "u.buf" inside the function. You may also use an unnamed
> union and avoid the u.buf replaces if the Sun compiler supports unnamed
> unions.

#0  0x0000000100011dec in mailbox_write_index_header
(mailbox=0xffffffff7fff3f60)
    at mailbox.c:1322
1322        *((bit64 *)(u.buf+OFFSET_HIGHESTMODSEQ_64)) =
htonll(mailbox->highestmodseq);
(gdb) p &u.buf
$1 = (char (*)[96]) 0xffffffff7fff3d90

Thanks a lot!

-- 
Alex Deiter


More information about the Info-cyrus mailing list