[dspam-users] bug fix for dspam 3.6.0 Bus error on sparc64 linux hash_drv

From: Nicolas Zin <n.zin@restosducoeur.asso.fr>
Date: Mon Oct 24 2005 - 07:13:14 EDT

Hi again,

i think I found the problem on 64 bit arch (bus error)

In hash_drv.c, you should try this small diff

---
1080c1080
<   rec->hashcode = wrec->hashcode;
---
 >   bcopy((char*)wrec,(char*)rec,sizeof(struct _hash_drv_spam_record));
For technical explanation: in _hash_drv_set_spamrecord() dpsam try to 
write from in memory structure to a mmaped structure. But the mmapped 
structure is 4 bytes aligned, but not 8 bytes aligned (*), and so the 
processor can't make a copy on a (long long) type.
I used a bcopy because it seems that memcpy is proned to alignment 
problems too. :-(
I do not have seen any other place were the problem arises.
Sounds good to everyone?
/nicolas
(*), for dspam developpers, apparently the file is composed first on a 
_hash_drv_header structure, and next dozens of _hash_drv_spam_record 
structures. _hash_drv_header have a size of a multiple of 4, not 8. so 
the other ones are not 8 bytes aligned
Received on Mon Oct 24 07:11:10 2005

This archive was generated by hypermail 2.1.8 : Tue Oct 25 2005 - 00:00:01 EDT