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

From: Jonathan Zdziarski <jonathan@nuclearelephant.com>
Date: Mon Oct 24 2005 - 11:28:11 EDT

...and each record, of course.

Jonathan

On Oct 24, 2005, at 11:27 AM, Jonathan Zdziarski wrote:

> What would we need to do to make that work, just adjust the size of
> the header to be a multiple of 8 bytes? sorry, i'm not very
> familiar with alignment.
>
> Jonathan
>
>
> On Oct 24, 2005, at 11:28 AM, Nicolas Zin wrote:
>
>
>> Jonathan Zdziarski a écrit :
>>
>>
>>
>>> it would seem that you'd have to do more than this, wouldn't
>>> you? you'd also have to copy the bytes out when you want to read
>>> the records, i would think.
>>>
>>>
>>
>> oups right. I didn't checked everywhere. New diff for hash_drv.c
>> below. I'm running this new version, but further testing who be
>> welcome, my installation is just a testbed :-)
>> I don't think more has to be done, what would you suggest?
>>
>> Indeed it would have been simpler to make file record 8 bytes
>> aligned (but I'm just dreaming, don't pay attention)
>>
>>
>> ---
>>
>>
>> 1013a1014
>> > unsigned long long mmap_hashcode=0;
>> 1022,1023c1023,1025
>> < while(rec->hashcode != hashcode && /* Match token */
>> < rec->hashcode != 0 && /* Insert on empty */
>> ---
>> > bcopy(&rec->hashcode,&mmap_hashcode,sizeof(unsigned long long));
>> > while(mmap_hashcode != hashcode && /* Match token */
>> > mmap_hashcode != 0 && /* Insert on empty */
>> 1031a1034
>> > bcopy(&rec->hashcode,&mmap_hashcode,sizeof(long long));
>> 1034c1037
>> < if (rec->hashcode == hashcode)
>> ---
>> > if (mmap_hashcode == hashcode)
>> 1037c1040
>> < if (rec->hashcode == 0 && (flags & HSEEK_INSERT))
>> ---
>> > if (mmap_hashcode == 0 && (flags & HSEEK_INSERT))
>> 1080,1082c1083
>> < rec->hashcode = wrec->hashcode;
>> < rec->nonspam = wrec->nonspam;
>> < rec->spam = wrec->spam;
>> ---
>> > bcopy((char*)wrec,(char*)rec,sizeof(struct
>> _hash_drv_spam_record));
>> 1117a1119
>> > // no bcopy need, we don't copy disalign rec->hashcode
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
Received on Mon Oct 24 11:29:43 2005

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