Alignment problem?

James Peach jpeach at
Sun Sep 4 06:39:46 GMT 2005

On Sat, 2005-09-03 at 20:31 +0200, Volker Lendecke wrote:
> Hi!
> Attached find a little, trivial simplification (I think...). As I've been
> bitten by alignment problems on Solaris, can someone please look over this? We
> have other entities like share_access or file_id in this sequence of
> assignments that should have the same restrictions.

This looks ok to me since fill_share_mode doesn't get called from
anywhere that doesn't take care to fix the alignment.

The alignment problems tend to bite when you get a structure back from
tdb_traverse(). tdb_fetch() (inadvertantly?) guarantees malloc
alignment, but tdb_traverse() doesn't. I have a diff somewhere that
teaches tdb_traverse() to align the data structure on a useful boundary
which I should dig up ...

AFAICT, the share_mode_entry in locking.c:traverse_fn() is guaranteed to
be properly aligned only because sizeof(struct locking_key) happens to
be a multiple of 4.

James Peach | jpeach at

More information about the samba-technical mailing list