Subject: Re: unaligned access: how to track ?
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Chris G. Demetriou <cgd@netbsd.org>
List: port-alpha
Date: 06/07/2000 09:20:39
Manuel Bouyer <bouyer@antioche.lip6.fr> writes:
> This looks like the problem is in libc/db, but I'm not sure how to fix it and
> anyway I don't have the time to look at it.

No, it's not.  It's a bug in the code using the db interfaces.  To
quote dbopen(3):

KEY/DATA PAIRS
       Access to all file types is based on key/data pairs.  Both
       keys and data are represented by the following data struc-
       ture:
[ ... ]
       Key  and data byte strings may reference strings of essen-
       tially unlimited length although any two of them must  fit
       into  available  memory  at  the  same time.  It should be
       noted that the access methods provide no guarantees  about
       byte string alignment.

i.e., if you want to access them as structures, it's on you to make
sure you've put them in a form such that that is safe.


cgd
-- 
Chris Demetriou - cgd@netbsd.org - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.